import type { RedisClient } from '../../session/session-store.js'; export interface OAuthClientRegistration { clientId: string; redirectUris: string[]; clientName?: string; } export interface PendingAuthRequest { clientId: string; redirectUri: string; codeChallenge: string; state?: string; resource: string; } export interface AuthCodeRecord { authRequestId: string; sub: string; } export interface RefreshTokenRecord { sub: string; clientId: string; resource: string; } /** * Contentful CMA token cache key — space-scoped for shared Redis across hosts. */ export declare function contentfulTokenKey(sub: string, spaceId: string): string; /** * Pre-3.4.5 key (not space-scoped). Read as fallback; migrate to space-scoped on hit. */ export declare function legacyContentfulTokenKey(sub: string): string; /** * Host space for OAuth token isolation. * Prefer explicit spaceId (deployment); fall back to CONTENTFUL_SPACE_ID. * Returns undefined when neither is set — callers treat as missing token / store error. */ export declare function resolveOAuthSpaceId(explicit?: string): string | undefined; export declare function refreshTokenKey(token: string): string; export interface OAuthStore { registerOAuthClient(input: { redirectUris: string[]; clientName?: string; }): Promise; getOAuthClient(clientId: string): Promise; savePendingAuthRequest(request: PendingAuthRequest): Promise<{ authRequestId: string; }>; getPendingAuthRequest(authRequestId: string): Promise; saveAuthCode(code: string, record: AuthCodeRecord): Promise; consumeAuthCode(code: string): Promise; storeContentfulToken(sub: string, token: string, spaceId?: string): Promise; getContentfulToken(sub: string, spaceId?: string): Promise; saveRefreshToken(token: string, record: RefreshTokenRecord): Promise; getRefreshToken(token: string): Promise; revokeRefreshToken(token: string): Promise; } export declare function createOAuthStore(redis: RedisClient): OAuthStore; //# sourceMappingURL=store.d.ts.map