-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
28 lines (23 loc) · 909 Bytes
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2023-latest the httpland authors. All rights reserved. MIT license.
// This module is browser compatible.
/** Credentials API.
* @see [RFC 9110, 11.4. Credentials](https://www.rfc-editor.org/rfc/rfc9110.html#section-11.4)
*/
export interface Credentials {
/** Authentication scheme. */
readonly authScheme: string;
/** Authentication parameters. */
readonly params: Token68 | AuthParams | null;
}
/** Representation of [token68](https://www.rfc-editor.org/rfc/rfc9110.html#auth.params). */
export type Token68 = string;
/** Pair of name and value.
* Representation of [auth-param](https://www.rfc-editor.org/rfc/rfc9110.html#section-11.2-5).
*/
export interface AuthParams {
readonly [k: string]: string;
}
/** Authorization API.
* @see [RFC 9110, 11.6.2. Authorization](https://www.rfc-editor.org/rfc/rfc9110.html#section-11.6.2)
*/
export type Authorization = Credentials;