UNPKG

1.88 kBTypeScriptView Raw
1/**
2 * -------------------------------------------------------------------------------------------
3 * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
4 * See License in the project root for license information.
5 * -------------------------------------------------------------------------------------------
6 */
7/**
8 * @module AuthenticationHandler
9 */
10import { AuthenticationProvider } from "../IAuthenticationProvider";
11import { Context } from "../IContext";
12import { Middleware } from "./IMiddleware";
13/**
14 * @class
15 * @implements Middleware
16 * Class representing AuthenticationHandler
17 */
18export declare class AuthenticationHandler implements Middleware {
19 /**
20 * @private
21 * A member representing the authorization header name
22 */
23 private static AUTHORIZATION_HEADER;
24 /**
25 * @private
26 * A member to hold an AuthenticationProvider instance
27 */
28 private authenticationProvider;
29 /**
30 * @private
31 * A member to hold next middleware in the middleware chain
32 */
33 private nextMiddleware;
34 /**
35 * @public
36 * @constructor
37 * Creates an instance of AuthenticationHandler
38 * @param {AuthenticationProvider} authenticationProvider - The authentication provider for the authentication handler
39 */
40 constructor(authenticationProvider: AuthenticationProvider);
41 /**
42 * @public
43 * @async
44 * To execute the current middleware
45 * @param {Context} context - The context object of the request
46 * @returns A Promise that resolves to nothing
47 */
48 execute(context: Context): Promise<void>;
49 /**
50 * @public
51 * To set the next middleware in the chain
52 * @param {Middleware} next - The middleware instance
53 * @returns Nothing
54 */
55 setNext(next: Middleware): void;
56}