UNPKG

kaven-utils

Version:

Utils for Node.js.

55 lines (54 loc) 2.26 kB
/******************************************************************** * @author: Kaven * @email: kaven@wuwenkai.com * @website: http://blog.kaven.xyz * @file: [Kaven-Utils] /src/net/authentication/KavenDigestAuthentication.ts * @create: 2019-03-26 14:22:50.325 * @modify: 2023-12-07 10:59:05.566 * @version: 5.4.0 * @times: 44 * @lines: 143 * @copyright: Copyright © 2019-2023 Kaven. All Rights Reserved. * @description: [description] * @license: [license] ********************************************************************/ import { IHttpAuthorizationInfo } from "../../base/Interfaces.js"; import { HttpResponseMessage } from "../http/HttpResponseMessage.js"; import { KavenAuthentication } from "./KavenAuthentication.js"; export declare class KavenDigestAuthentication extends KavenAuthentication { /** * A server-specified string which should be uniquely generated each * time a 401 response is made. It is advised that this string be * Base64 or hexadecimal data. Specifically, since the string is * passed in the header field lines as a quoted string, the double- * quote character is not allowed, unless suitably escaped. */ get Nonce(): string; /** * A string of data, specified by the server, that SHOULD be returned * by the client unchanged in the Authorization header field of * subsequent requests with URIs in the same protection space. It is * RECOMMENDED that this string be Base64 or hexadecimal data. */ get Opaque(): string; Name: string; /** * Indicates the "quality of protection" options applied to the * response by the server. * * The value "auth" indicates authentication; * * the value "auth-int" indicates authentication with integrity protection. * * The server SHOULD use the same value for the qop parameter in the response as was sent by the client in the * corresponding request. */ QOP: string; /** * Only support MD5 for now. */ Algorithm: string; private md5?; Authenticate(req: IHttpAuthorizationInfo): Promise<boolean>; Update(response: HttpResponseMessage): HttpResponseMessage; }