import { Response } from "express"; import { OAuthRegisteredClientsStore } from "../src/server/auth/clients.js"; import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from "../src/shared/auth.js"; import { AuthInfo } from "../src/server/auth/types.js"; import { AuthorizationParams, OAuthServerProvider } from "../src/server/auth/provider.js"; export type StorageOperations = { createClient(client: OAuthClientInformationFull): Promise; getClient(clientId: string): Promise; saveAuthorizationCode(code: string, data: AuthorizationCodeData): Promise; getAuthorizationCode(code: string): Promise; deleteAuthorizationCode(code: string): Promise; saveRevokedToken(token: string, clientId: string): Promise; isTokenRevoked(token: string): Promise; }; export type AuthorizationCodeData = { clientId: string; codeChallenge: string; userId: string; scopes?: string[]; expiresAt: number; }; export type StorageProviderOptions = { storage: StorageOperations; jwtSecret: string; tokenExpiresIn?: number; refreshTokenExpiresIn?: number; authorizationCodeExpiresIn?: number; }; /** * Implements an OAuth server that stores all necessary data in a storage backend. */ export declare class StorageOAuthServerProvider implements OAuthServerProvider { private readonly storage; private readonly jwtSecret; private readonly tokenExpiresIn; private readonly refreshTokenExpiresIn; private readonly authorizationCodeExpiresIn; constructor(options: StorageProviderOptions); get clientsStore(): OAuthRegisteredClientsStore; authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise; challengeForAuthorizationCode(_client: OAuthClientInformationFull, authorizationCode: string): Promise; exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, _codeVerifier?: string): Promise; exchangeRefreshToken(client: OAuthClientInformationFull, refreshToken: string, scopes?: string[]): Promise; verifyAccessToken(token: string): Promise; revokeToken(client: OAuthClientInformationFull, request: OAuthTokenRevocationRequest): Promise; private generateTokens; private generateId; private generateSecret; } //# sourceMappingURL=storageProvider.d.ts.map