1 | import { Handler } from "../../handler";
|
2 | import { BaseTriggerEvent, StringMap } from "./_common";
|
3 |
|
4 | export interface GroupOverrideDetailsV2 {
|
5 | groupsToOverride?: string[] | undefined;
|
6 | iamRolesToOverride?: string[] | undefined;
|
7 | preferredRole?: string | undefined;
|
8 | }
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export interface IdTokenGeneration {
|
14 | claimsToAddOrOverride?: StringMap | undefined;
|
15 | claimsToSuppress?: string[] | undefined;
|
16 | }
|
17 |
|
18 | export interface AccessTokenGeneration {
|
19 | claimsToAddOrOverride?: StringMap | undefined;
|
20 | claimsToSuppress?: string[] | undefined;
|
21 | scopesToAdd?: string[] | undefined;
|
22 | scopesToSuppress?: string[] | undefined;
|
23 | }
|
24 |
|
25 | export interface ClaimsAndScopeOverrideDetails {
|
26 | idTokenGeneration?: IdTokenGeneration | undefined;
|
27 | accessTokenGeneration?: AccessTokenGeneration | undefined;
|
28 | groupOverrideDetails?: GroupOverrideDetailsV2 | undefined;
|
29 | }
|
30 |
|
31 | export interface BasePreTokenGenerationV2TriggerEvent<T extends string> extends BaseTriggerEvent<T> {
|
32 | request: {
|
33 | userAttributes: StringMap;
|
34 | groupConfiguration: GroupOverrideDetailsV2;
|
35 | scopes?: string[] | undefined;
|
36 | clientMetadata?: StringMap | undefined;
|
37 | };
|
38 | response: {
|
39 | claimsAndScopeOverrideDetails: ClaimsAndScopeOverrideDetails;
|
40 | };
|
41 | }
|
42 |
|
43 | export type PreTokenGenerationHostedAuthV2TriggerEvent = BasePreTokenGenerationV2TriggerEvent<
|
44 | "TokenGeneration_HostedAuth"
|
45 | >;
|
46 |
|
47 | export type PreTokenGenerationAuthenticationV2TriggerEvent = BasePreTokenGenerationV2TriggerEvent<
|
48 | "TokenGeneration_Authentication"
|
49 | >;
|
50 |
|
51 | export type PreTokenGenerationNewPasswordChallengeV2TriggerEvent = BasePreTokenGenerationV2TriggerEvent<
|
52 | "TokenGeneration_NewPasswordChallenge"
|
53 | >;
|
54 |
|
55 | export type PreTokenGenerationAuthenticateDeviceV2TriggerEvent = BasePreTokenGenerationV2TriggerEvent<
|
56 | "TokenGeneration_AuthenticateDevice"
|
57 | >;
|
58 |
|
59 | export type PreTokenGenerationRefreshTokensV2TriggerEvent = BasePreTokenGenerationV2TriggerEvent<
|
60 | "TokenGeneration_RefreshTokens"
|
61 | >;
|
62 |
|
63 |
|
64 |
|
65 |
|
66 | export type PreTokenGenerationV2TriggerEvent =
|
67 | | PreTokenGenerationHostedAuthV2TriggerEvent
|
68 | | PreTokenGenerationAuthenticationV2TriggerEvent
|
69 | | PreTokenGenerationNewPasswordChallengeV2TriggerEvent
|
70 | | PreTokenGenerationAuthenticateDeviceV2TriggerEvent
|
71 | | PreTokenGenerationRefreshTokensV2TriggerEvent;
|
72 |
|
73 | export type PreTokenGenerationV2TriggerHandler = Handler<PreTokenGenerationV2TriggerEvent>;
|