UNPKG

@gftdcojp/gftd-orm

Version:

Enterprise-grade real-time data platform with ksqlDB, inspired by Supabase architecture

153 lines 3.4 kB
/** * Next.js Edge Runtime対応 Auth0 SDK * * Vercel Edge Functions、Cloudflare Workers、その他のEdge環境に対応 * Node.js APIを使用せず、Web標準APIのみで実装 */ /** * Edge Runtime用の設定 */ export interface EdgeAuth0Config { domain: string; clientId: string; clientSecret: string; appBaseUrl: string; secret: string; runtime?: 'edge' | 'nodejs'; scope?: string; audience?: string; signInReturnToPath?: string; session?: { absoluteLifetime?: number; rollingDuration?: number; rolling?: boolean; cookie?: { secure?: boolean; sameSite?: 'strict' | 'lax' | 'none'; path?: string; }; }; } /** * Edge Runtime用セッション */ export interface EdgeSession { user: { sub: string; email?: string; name?: string; picture?: string; [key: string]: any; }; accessToken: string; idToken: string; refreshToken?: string; expiresAt: number; createdAt: number; } /** * Edge Runtime対応 Auth0 クライアント */ export declare class EdgeAuth0Client { private config; constructor(config: EdgeAuth0Config); /** * 設定検証 */ private validateConfig; /** * 🌐 Edge Runtime Compatible Methods */ /** * Web Crypto APIを使用した暗号化 */ private encryptSession; /** * Web Crypto APIを使用した復号化 */ private decryptSession; /** * Base64URL エンコード(Edge Runtime互換) */ private base64UrlEncode; /** * Base64URL デコード(Edge Runtime互換) */ private base64UrlDecode; /** * 🔐 Edge-compatible JWT verification */ private verifyJwtSignature; /** * 🌍 Edge Runtime Request Handlers */ /** * Edge Runtime用のミドルウェア */ handleRequest(request: Request): Promise<Response>; /** * 認証ルートハンドラー */ private handleAuthRoute; /** * Login handler for Edge Runtime */ private handleLogin; /** * Logout handler for Edge Runtime */ private handleLogout; /** * Callback handler for Edge Runtime */ private handleCallback; /** * Profile handler for Edge Runtime */ private handleProfile; /** * 🔧 Helper Methods for Edge Runtime */ /** * リクエストからセッションを取得 */ private getSessionFromRequest; /** * Cookie文字列を解析 */ private parseCookies; /** * Login URL生成 */ private buildLoginUrl; /** * Logout URL生成 */ private buildLogoutUrl; /** * Code exchange for tokens */ private exchangeCodeForTokens; } /** * Edge Runtime用クライアント作成関数 */ export declare function createEdgeAuth0Client(config: EdgeAuth0Config): EdgeAuth0Client; /** * 🌐 Edge Runtime使用例 */ export declare const edgeAuth0Examples: { /** * Vercel Edge Function での使用例 */ vercelEdge: string; /** * Cloudflare Workers での使用例 */ cloudflareWorkers: string; /** * Deno Deploy での使用例 */ denoDeploy: string; }; //# sourceMappingURL=nextjs-auth0-edge.d.ts.map