UNPKG

1.12 kBTypeScriptView Raw
1import type { HttpContext } from '@adonisjs/core/http';
2import type { GuardFactory } from './types.js';
3import { Authenticator } from './authenticator.js';
4import { AuthenticatorClient } from './authenticator_client.js';
5/**
6 * Auth manager exposes the API to register and manage authentication
7 * guards from the config
8 */
9export declare class AuthManager<KnownGuards extends Record<string, GuardFactory>> {
10 config: {
11 default: keyof KnownGuards;
12 guards: KnownGuards;
13 };
14 /**
15 * Name of the default guard
16 */
17 get defaultGuard(): keyof KnownGuards;
18 constructor(config: {
19 default: keyof KnownGuards;
20 guards: KnownGuards;
21 });
22 /**
23 * Create an authenticator for a given HTTP request. The authenticator
24 * is used to authenticated in incoming HTTP request
25 */
26 createAuthenticator(ctx: HttpContext): Authenticator<KnownGuards>;
27 /**
28 * Creates an instance of the authenticator client. The client is
29 * used to setup authentication state during testing.
30 */
31 createAuthenticatorClient(): AuthenticatorClient<KnownGuards>;
32}