-
Notifications
You must be signed in to change notification settings - Fork 46
/
interfaces.ts
49 lines (43 loc) · 1.19 KB
/
interfaces.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* @forgerock/javascript-sdk
*
* interfaces.ts
*
* Copyright (c) 2020 ForgeRock. All rights reserved.
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
import type { ConfigOptions } from '../config/interfaces';
import type FRStep from '../fr-auth/fr-step';
export interface Advices {
AuthenticateToServiceConditionAdvice?: string[];
TransactionConditionAdvice?: string[];
}
export declare type HandleStep = (step: FRStep) => Promise<FRStep>;
/**
* Options to use when making an HTTP call.
*/
export interface HttpClientRequestOptions {
bypassAuthentication?: boolean;
authorization?: {
config?: ConfigOptions;
handleStep: HandleStep;
idToken?: string;
txnID?: string;
};
init: RequestInit;
requiresNewToken?: RequiresNewTokenFn;
timeout: number;
url: string;
}
/**
* A function that determines whether a new token is required based on a HTTP response.
*/
export type RequiresNewTokenFn = (res: Response) => boolean;
export interface AuthorizationJSON {
resource: string;
actions: { [key: string]: string };
attributes: { [key: string]: string };
advices: Advices | null;
ttl: number;
}