@accounter/server
Version:
Accounter GraphQL server
24 lines (23 loc) • 823 B
TypeScript
import type { Plugin } from '@envelop/types';
export interface RawAuth {
authType: 'jwt' | 'apiKey' | null;
token: string | null;
}
/**
* AuthPluginV2 - Extracts authentication credentials from request headers.
*
* This plugin is part of the v2 authentication system (Auth0 integration).
* It ONLY handles credential extraction. Verification and context creation
* are delegated to the AuthContextProvider (Phase 4).
*
* Responsibilities:
* 1. Extract `Authorization: Bearer <token>` (JWT)
* 2. Extract `X-API-Key: <key>` (API Key)
* 3. Add `rawAuth` object to Yoga context
*
* NOTE: This plugin intentionally runs alongside the legacy auth plugin
* during the migration phase. It does NOT throw errors or block requests.
*/
export declare const authPluginV2: () => Plugin<{
rawAuth: RawAuth;
}>;