@thunderid/javascript 1.0.7 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/IsomorphicCrypto.d.ts +18 -0
- package/dist/IsomorphicCrypto.d.ts.map +1 -1
- package/dist/StorageManager.d.ts +1 -0
- package/dist/StorageManager.d.ts.map +1 -1
- package/dist/ThunderIDJavaScriptClient.d.ts +6 -0
- package/dist/ThunderIDJavaScriptClient.d.ts.map +1 -1
- package/dist/api/agents/createAgent.d.ts +28 -0
- package/dist/api/agents/createAgent.d.ts.map +1 -0
- package/dist/api/agents/deleteAgent.d.ts +27 -0
- package/dist/api/agents/deleteAgent.d.ts.map +1 -0
- package/dist/api/agents/getAgent.d.ts +28 -0
- package/dist/api/agents/getAgent.d.ts.map +1 -0
- package/dist/api/agents/getAgents.d.ts +23 -0
- package/dist/api/agents/getAgents.d.ts.map +1 -0
- package/dist/api/agents/updateAgent.d.ts +33 -0
- package/dist/api/agents/updateAgent.d.ts.map +1 -0
- package/dist/api/applications/createApplication.d.ts +28 -0
- package/dist/api/applications/createApplication.d.ts.map +1 -0
- package/dist/api/applications/deleteApplication.d.ts +27 -0
- package/dist/api/applications/deleteApplication.d.ts.map +1 -0
- package/dist/api/applications/getApplication.d.ts +28 -0
- package/dist/api/applications/getApplication.d.ts.map +1 -0
- package/dist/api/applications/getApplications.d.ts +24 -0
- package/dist/api/applications/getApplications.d.ts.map +1 -0
- package/dist/api/applications/updateApplication.d.ts +33 -0
- package/dist/api/applications/updateApplication.d.ts.map +1 -0
- package/dist/api/updateMeCredentials.d.ts +66 -0
- package/dist/api/updateMeCredentials.d.ts.map +1 -0
- package/dist/api/users/createUser.d.ts +28 -0
- package/dist/api/users/createUser.d.ts.map +1 -0
- package/dist/api/users/deleteUser.d.ts +27 -0
- package/dist/api/users/deleteUser.d.ts.map +1 -0
- package/dist/api/users/getUser.d.ts +28 -0
- package/dist/api/users/getUser.d.ts.map +1 -0
- package/dist/api/users/getUsers.d.ts +24 -0
- package/dist/api/users/getUsers.d.ts.map +1 -0
- package/dist/api/users/updateUser.d.ts +33 -0
- package/dist/api/users/updateUser.d.ts.map +1 -0
- package/dist/cjs/index.cjs +1175 -7
- package/dist/constants/AgentQueryKeys.d.ts +10 -0
- package/dist/constants/AgentQueryKeys.d.ts.map +1 -0
- package/dist/constants/ApplicationQueryKeys.d.ts +10 -0
- package/dist/constants/ApplicationQueryKeys.d.ts.map +1 -0
- package/dist/constants/BackchannelLogoutConstants.d.ts +13 -0
- package/dist/constants/BackchannelLogoutConstants.d.ts.map +1 -0
- package/dist/constants/CredentialConstants.d.ts +22 -0
- package/dist/constants/CredentialConstants.d.ts.map +1 -0
- package/dist/constants/UserQueryKeys.d.ts +10 -0
- package/dist/constants/UserQueryKeys.d.ts.map +1 -0
- package/dist/edge/index.js +1142 -8
- package/dist/errors/exception.d.ts +7 -0
- package/dist/errors/exception.d.ts.map +1 -1
- package/dist/i18n/models/i18n.d.ts +14 -0
- package/dist/i18n/models/i18n.d.ts.map +1 -1
- package/dist/i18n/translations/en-US.d.ts.map +1 -1
- package/dist/i18n/translations/fr-FR.d.ts.map +1 -1
- package/dist/i18n/translations/hi-IN.d.ts.map +1 -1
- package/dist/i18n/translations/ja-JP.d.ts.map +1 -1
- package/dist/i18n/translations/pt-BR.d.ts.map +1 -1
- package/dist/i18n/translations/pt-PT.d.ts.map +1 -1
- package/dist/i18n/translations/si-LK.d.ts.map +1 -1
- package/dist/i18n/translations/ta-IN.d.ts.map +1 -1
- package/dist/i18n/translations/te-IN.d.ts.map +1 -1
- package/dist/index.d.ts +55 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1142 -8
- package/dist/models/agent-resource.d.ts +96 -0
- package/dist/models/agent-resource.d.ts.map +1 -0
- package/dist/models/api.d.ts +57 -0
- package/dist/models/api.d.ts.map +1 -0
- package/dist/models/application.d.ts +271 -0
- package/dist/models/application.d.ts.map +1 -0
- package/dist/models/config.d.ts +26 -1
- package/dist/models/config.d.ts.map +1 -1
- package/dist/models/embedded-flow.d.ts +14 -1
- package/dist/models/embedded-flow.d.ts.map +1 -1
- package/dist/models/embedded-signup-flow.d.ts +4 -0
- package/dist/models/embedded-signup-flow.d.ts.map +1 -1
- package/dist/models/logout-token.d.ts +58 -0
- package/dist/models/logout-token.d.ts.map +1 -0
- package/dist/models/managed-user.d.ts +44 -0
- package/dist/models/managed-user.d.ts.map +1 -0
- package/dist/utils/AuthenticationHelper.d.ts +31 -0
- package/dist/utils/AuthenticationHelper.d.ts.map +1 -1
- package/dist/utils/evaluateChangePasswordForm.d.ts +64 -0
- package/dist/utils/evaluateChangePasswordForm.d.ts.map +1 -0
- package/dist/utils/evaluatePasswordPolicy.d.ts +60 -0
- package/dist/utils/evaluatePasswordPolicy.d.ts.map +1 -0
- package/dist/utils/mapCredentialUpdateError.d.ts +31 -0
- package/dist/utils/mapCredentialUpdateError.d.ts.map +1 -0
- package/dist/utils/parseKeyValuePairs.d.ts +21 -0
- package/dist/utils/parseKeyValuePairs.d.ts.map +1 -0
- package/dist/utils/requestManagementResource.d.ts +41 -0
- package/dist/utils/requestManagementResource.d.ts.map +1 -0
- package/dist/utils/resolveChangeCredentialPolicy.d.ts +24 -0
- package/dist/utils/resolveChangeCredentialPolicy.d.ts.map +1 -0
- package/dist/utils/resolveResourceEndpoint.d.ts +1 -1
- package/dist/utils/resolveResourceEndpoint.d.ts.map +1 -1
- package/dist/utils/supportsCredential.d.ts +32 -0
- package/dist/utils/supportsCredential.d.ts.map +1 -0
- package/dist/utils/validateLogoutTokenClaims.d.ts +15 -0
- package/dist/utils/validateLogoutTokenClaims.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The claims of a validated back-channel logout token.
|
|
3
|
+
*/
|
|
4
|
+
export interface LogoutTokenClaims {
|
|
5
|
+
/**
|
|
6
|
+
* Other claims the server included.
|
|
7
|
+
*/
|
|
8
|
+
[claim: string]: unknown;
|
|
9
|
+
aud: string | string[];
|
|
10
|
+
events: Record<string, unknown>;
|
|
11
|
+
exp: number;
|
|
12
|
+
iat: number;
|
|
13
|
+
iss: string;
|
|
14
|
+
jti: string;
|
|
15
|
+
/**
|
|
16
|
+
* The server session that ended. Present on every ThunderID logout token.
|
|
17
|
+
*/
|
|
18
|
+
sid?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The subject whose session ended.
|
|
21
|
+
*/
|
|
22
|
+
sub?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* What a logout token's claims are checked against.
|
|
26
|
+
*/
|
|
27
|
+
export interface LogoutTokenValidationOptions {
|
|
28
|
+
clientId: string;
|
|
29
|
+
/**
|
|
30
|
+
* Allowed clock difference in seconds.
|
|
31
|
+
*/
|
|
32
|
+
clockTolerance?: number;
|
|
33
|
+
issuer: string;
|
|
34
|
+
/**
|
|
35
|
+
* The current time in seconds since the epoch. Defaults to the system clock.
|
|
36
|
+
*/
|
|
37
|
+
now?: number;
|
|
38
|
+
/**
|
|
39
|
+
* The signature algorithms the SDK accepts.
|
|
40
|
+
*/
|
|
41
|
+
supportedAlgorithms: readonly string[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The outcome of handling a back-channel logout request.
|
|
45
|
+
*/
|
|
46
|
+
export interface BackchannelLogoutResult {
|
|
47
|
+
/**
|
|
48
|
+
* When the server issued the logout token, in seconds since the epoch.
|
|
49
|
+
*/
|
|
50
|
+
issuedAt: number;
|
|
51
|
+
/**
|
|
52
|
+
* How many local sessions were ended. Zero when the token named no session held here.
|
|
53
|
+
*/
|
|
54
|
+
sessionsEnded: number;
|
|
55
|
+
sid?: string;
|
|
56
|
+
sub?: string;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=logout-token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logout-token.d.ts","sourceRoot":"","sources":["../../src/models/logout-token.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ApiPaginationLink } from './api';
|
|
2
|
+
/**
|
|
3
|
+
* A user record managed through the ThunderID management API.
|
|
4
|
+
*
|
|
5
|
+
* This is a server record, distinct from {@link User}, which describes the signed-in user.
|
|
6
|
+
*/
|
|
7
|
+
export interface ManagedUser {
|
|
8
|
+
attributes?: Record<string, unknown>;
|
|
9
|
+
display?: string;
|
|
10
|
+
id: string;
|
|
11
|
+
isReadOnly?: boolean;
|
|
12
|
+
ouHandle?: string;
|
|
13
|
+
ouId: string;
|
|
14
|
+
type: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A page of users.
|
|
18
|
+
*/
|
|
19
|
+
export interface ManagedUserListResponse {
|
|
20
|
+
count: number;
|
|
21
|
+
links?: ApiPaginationLink[];
|
|
22
|
+
startIndex: number;
|
|
23
|
+
totalResults: number;
|
|
24
|
+
users: ManagedUser[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The payload used to create a user.
|
|
28
|
+
*/
|
|
29
|
+
export interface CreateManagedUserRequest {
|
|
30
|
+
attributes?: Record<string, unknown>;
|
|
31
|
+
groups?: string[];
|
|
32
|
+
ouId: string;
|
|
33
|
+
type: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The payload used to update a user.
|
|
37
|
+
*/
|
|
38
|
+
export interface UpdateManagedUserRequest {
|
|
39
|
+
attributes?: Record<string, unknown>;
|
|
40
|
+
groups?: string[];
|
|
41
|
+
ouId?: string;
|
|
42
|
+
type?: string;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=managed-user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managed-user.d.ts","sourceRoot":"","sources":["../../src/models/managed-user.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAExC;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IsomorphicCrypto } from '../IsomorphicCrypto';
|
|
2
|
+
import { LogoutTokenClaims } from '../models/logout-token';
|
|
2
3
|
import { OIDCDiscoveryEndpointsApiResponse, OIDCDiscoveryApiResponse } from '../models/oidc-discovery';
|
|
3
4
|
import { TokenResponse } from '../models/token';
|
|
4
5
|
import { User } from '../models/user';
|
|
@@ -14,6 +15,9 @@ declare class AuthenticationHelper<T> {
|
|
|
14
15
|
private config;
|
|
15
16
|
private oidcProviderMetaData;
|
|
16
17
|
private cryptoHelper;
|
|
18
|
+
private jwksCache;
|
|
19
|
+
private jwksFetch;
|
|
20
|
+
private jwksFetchStartedAt;
|
|
17
21
|
/**
|
|
18
22
|
* Creates a new `AuthenticationHelper` instance.
|
|
19
23
|
*
|
|
@@ -65,6 +69,33 @@ declare class AuthenticationHelper<T> {
|
|
|
65
69
|
* @throws {ThunderIDAuthException} When the JWKS endpoint is missing or the request fails.
|
|
66
70
|
*/
|
|
67
71
|
validateIdToken(idToken: string): Promise<boolean>;
|
|
72
|
+
/**
|
|
73
|
+
* Validates a back-channel logout token: its type, event, issuer, audience and lifetime, then its
|
|
74
|
+
* signature against the server's keys. The claims are checked first, so a malformed token costs
|
|
75
|
+
* neither a key fetch nor a signature check.
|
|
76
|
+
*
|
|
77
|
+
* @param logoutToken - The raw `logout_token` the server posted.
|
|
78
|
+
* @returns The token's claims.
|
|
79
|
+
* @throws {InvalidLogoutTokenError} When the token is not valid.
|
|
80
|
+
*/
|
|
81
|
+
validateLogoutToken(logoutToken: string): Promise<LogoutTokenClaims>;
|
|
82
|
+
/**
|
|
83
|
+
* Returns the server key with the given identifier from a cached key set. An unknown identifier
|
|
84
|
+
* triggers one re-fetch, to follow key rotation, no more often than the minimum interval: the
|
|
85
|
+
* logout endpoint is unauthenticated, so an unbounded re-fetch would let anyone drive requests
|
|
86
|
+
* to the server. Requests that arrive while a fetch runs share it.
|
|
87
|
+
*/
|
|
88
|
+
private getCachedJwk;
|
|
89
|
+
/**
|
|
90
|
+
* Fetches the key set unless a fetch is already running, in which case that one is shared.
|
|
91
|
+
*/
|
|
92
|
+
private fetchJwksOnce;
|
|
93
|
+
/**
|
|
94
|
+
* Fetches the server's JSON Web Key Set.
|
|
95
|
+
*
|
|
96
|
+
* @throws {ThunderIDAuthException} When the JWKS endpoint is missing or the request fails.
|
|
97
|
+
*/
|
|
98
|
+
private fetchJwks;
|
|
68
99
|
/**
|
|
69
100
|
* Extracts user information from a decoded ID token payload.
|
|
70
101
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationHelper.d.ts","sourceRoot":"","sources":["../../src/utils/AuthenticationHelper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuthenticationHelper.d.ts","sourceRoot":"","sources":["../../src/utils/AuthenticationHelper.ts"],"names":[],"mappings":"AAYA,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAGrD,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAC,iCAAiC,EAAE,wBAAwB,EAAC,MAAM,0BAA0B,CAAC;AAErG,OAAO,EAAU,aAAa,EAAyB,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAC,IAAI,EAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C;;;;;GAKG;AACH,cAAM,oBAAoB,CAAC,CAAC;IAC1B,OAAO,CAAC,cAAc,CAAoB;IAE1C,OAAO,CAAC,MAAM,CAAqC;IAEnD,OAAO,CAAC,oBAAoB,CAA0C;IAEtE,OAAO,CAAC,YAAY,CAAmB;IAEvC,OAAO,CAAC,SAAS,CAAwD;IAIzE,OAAO,CAAC,SAAS,CAAsC;IAEvD,OAAO,CAAC,kBAAkB,CAAK;IAE/B;;;;;OAKG;gBACgB,sBAAsB,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,oBAAoB,EAAE,gBAAgB;IAQpG;;;;;;;;;OASG;IACH,OAAO,CAAC,0BAA0B;IAkBlC;;;;;;OAMG;IACU,gBAAgB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAMpG;;;;;;OAMG;IACU,0BAA0B,IAAI,OAAO,CAAC,iCAAiC,CAAC;IAyCrF;;;;;;;OAOG;IACU,yBAAyB,IAAI,OAAO,CAAC,iCAAiC,CAAC;IAmCpF;;;;;;OAMG;IACU,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAiB/D;;;;;;;;OAQG;IACU,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA2CjF;;;;;OAKG;YACW,YAAY;IAiC1B;;OAEG;IACH,OAAO,CAAC,aAAa;IAiBrB;;;;OAIG;YACW,SAAS;IA0CvB;;;;;OAKG;IACI,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAetD;;;;;;;OAOG;IACU,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA6C3F;;;;OAIG;IACU,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzD;;;;;;;;OAQG;IACU,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CA2C9F;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { PasswordPolicy, PasswordRuleResult } from './evaluatePasswordPolicy';
|
|
2
|
+
/**
|
|
3
|
+
* The two values a change-password form collects.
|
|
4
|
+
*
|
|
5
|
+
* There is deliberately no `currentPassword` here. The self-service credential write
|
|
6
|
+
* endpoint does not verify the account's existing value today, so a field the server
|
|
7
|
+
* ignores would only teach the user a false sense of security; once server-side
|
|
8
|
+
* current-value verification ships, this form gains that field back.
|
|
9
|
+
*/
|
|
10
|
+
export interface ChangePasswordFormValues {
|
|
11
|
+
/**
|
|
12
|
+
* The re-typed new password, used only to catch typos client-side.
|
|
13
|
+
*/
|
|
14
|
+
confirmPassword: string;
|
|
15
|
+
/**
|
|
16
|
+
* The password to set.
|
|
17
|
+
*/
|
|
18
|
+
newPassword: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The derived state a change-password form needs to render and to gate submission.
|
|
22
|
+
*/
|
|
23
|
+
export interface ChangePasswordFormEvaluation {
|
|
24
|
+
/**
|
|
25
|
+
* Whether the new password and its confirmation match.
|
|
26
|
+
*/
|
|
27
|
+
confirmMatches: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the values are complete and internally consistent. Callers combine this with
|
|
30
|
+
* their own in-flight flag, since whether a request is pending is UI state rather than
|
|
31
|
+
* validation.
|
|
32
|
+
*/
|
|
33
|
+
isValid: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the new password satisfies every configured rule.
|
|
36
|
+
*/
|
|
37
|
+
meetsPolicy: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Per-rule results, for the live requirement checklist.
|
|
40
|
+
*/
|
|
41
|
+
ruleResults: PasswordRuleResult[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Evaluates a change-password form against a policy.
|
|
45
|
+
*
|
|
46
|
+
* Every predicate a change-password UI needs is derived here so the React and Vue
|
|
47
|
+
* components stay pure rendering concerns and cannot drift apart on what counts as a
|
|
48
|
+
* submittable form.
|
|
49
|
+
*
|
|
50
|
+
* @param values - The current field values.
|
|
51
|
+
* @param policy - The rules the new password must satisfy.
|
|
52
|
+
* @returns The derived flags plus the per-rule results.
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const {isValid, ruleResults} = evaluateChangePasswordForm(
|
|
56
|
+
* {confirmPassword, newPassword},
|
|
57
|
+
* {regex: '^.{12,}$'},
|
|
58
|
+
* );
|
|
59
|
+
* const canSubmit = !loading && isValid;
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
declare const evaluateChangePasswordForm: (values: ChangePasswordFormValues, policy: PasswordPolicy) => ChangePasswordFormEvaluation;
|
|
63
|
+
export default evaluateChangePasswordForm;
|
|
64
|
+
//# sourceMappingURL=evaluateChangePasswordForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluateChangePasswordForm.d.ts","sourceRoot":"","sources":["../../src/utils/evaluateChangePasswordForm.ts"],"names":[],"mappings":"AAGA,OAA+B,EAAC,cAAc,EAAE,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAEpG;;;;;;;GAOG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,WAAW,EAAE,kBAAkB,EAAE,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,0BAA0B,GAC9B,QAAQ,wBAAwB,EAChC,QAAQ,cAAc,KACrB,4BAUF,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-side password rule used to drive both the requirement checklist and the
|
|
3
|
+
* submit gate of a change-password form.
|
|
4
|
+
*
|
|
5
|
+
* The server does not enforce the user type schema's `password` regex on the credential
|
|
6
|
+
* write path, and the default schema ships without a regex at all, so this rule is
|
|
7
|
+
* advisory: it exists to give the user actionable feedback before the request is sent.
|
|
8
|
+
* The schema's `regex` is the sole source of truth; the SDK does not layer its own
|
|
9
|
+
* character-class or length rules on top, since doing so could reject a password the
|
|
10
|
+
* organization's policy accepts.
|
|
11
|
+
*/
|
|
12
|
+
export interface PasswordPolicy {
|
|
13
|
+
/**
|
|
14
|
+
* A regular expression the whole value must match. Typically sourced from the
|
|
15
|
+
* `password` attribute's `regex` in `GET /users/me/meta`.
|
|
16
|
+
*/
|
|
17
|
+
regex?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The outcome of the password rule.
|
|
21
|
+
*/
|
|
22
|
+
export interface PasswordRuleResult {
|
|
23
|
+
/**
|
|
24
|
+
* Stable identifier for the rule, usable as a React key or test selector.
|
|
25
|
+
*/
|
|
26
|
+
key: string;
|
|
27
|
+
/**
|
|
28
|
+
* i18n key describing the requirement. Resolved by the consuming component rather
|
|
29
|
+
* than here, so this module stays free of translation concerns.
|
|
30
|
+
*/
|
|
31
|
+
messageKey: string;
|
|
32
|
+
/**
|
|
33
|
+
* Substitution params for `messageKey`, in the `{token}` form the i18n layer expects.
|
|
34
|
+
*/
|
|
35
|
+
params?: Record<string, string | number>;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the value satisfies this rule.
|
|
38
|
+
*/
|
|
39
|
+
passed: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Evaluates a password against a policy, returning one result when the policy configures
|
|
43
|
+
* a `regex` and none otherwise.
|
|
44
|
+
*
|
|
45
|
+
* An uncompilable `regex` is treated as passing, matching `evaluateValidationRule`:
|
|
46
|
+
* the SDK stays lenient so a misconfigured schema cannot lock a user out of their own
|
|
47
|
+
* password change.
|
|
48
|
+
*
|
|
49
|
+
* @param value - The candidate password.
|
|
50
|
+
* @param policy - The rule to apply.
|
|
51
|
+
* @returns A single-item list when `policy.regex` is set, otherwise an empty list.
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* const results = evaluatePasswordPolicy('sh0rt', {regex: '^.{8,}$'});
|
|
55
|
+
* const isValid = results.every(result => result.passed);
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare const evaluatePasswordPolicy: (value: string, policy: PasswordPolicy) => PasswordRuleResult[];
|
|
59
|
+
export default evaluatePasswordPolicy;
|
|
60
|
+
//# sourceMappingURL=evaluatePasswordPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluatePasswordPolicy.d.ts","sourceRoot":"","sources":["../../src/utils/evaluatePasswordPolicy.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IACzC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,sBAAsB,GAAI,OAAO,MAAM,EAAE,QAAQ,cAAc,KAAG,kBAAkB,EAqBzF,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The form field a credential-update failure belongs to, or `null` when the failure has
|
|
3
|
+
* no single field to blame and belongs at form level.
|
|
4
|
+
*/
|
|
5
|
+
export type CredentialUpdateErrorField = 'newPassword' | null;
|
|
6
|
+
/**
|
|
7
|
+
* Where a credential-update failure should be shown, and what it should say.
|
|
8
|
+
*
|
|
9
|
+
* `messageKey` is always set, so the caller can resolve text with a plain
|
|
10
|
+
* `message ?? t(messageKey)` and never needs a non-null assertion. `message` is present
|
|
11
|
+
* only when the server supplied something human-readable, and takes precedence when it
|
|
12
|
+
* is. Translation is left to the caller, which keeps this module free of i18n concerns
|
|
13
|
+
* in the same way {@link evaluatePasswordPolicy} is.
|
|
14
|
+
*/
|
|
15
|
+
export interface CredentialUpdateErrorResult {
|
|
16
|
+
/**
|
|
17
|
+
* The field to attach the error to, or `null` for a form-level error.
|
|
18
|
+
*/
|
|
19
|
+
field: CredentialUpdateErrorField;
|
|
20
|
+
/**
|
|
21
|
+
* A server-supplied message, already human-readable. Shown as-is when present.
|
|
22
|
+
*/
|
|
23
|
+
message?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The i18n key to fall back to when `message` is absent. Always set.
|
|
26
|
+
*/
|
|
27
|
+
messageKey: string;
|
|
28
|
+
}
|
|
29
|
+
declare const mapCredentialUpdateError: (error: unknown) => CredentialUpdateErrorResult;
|
|
30
|
+
export default mapCredentialUpdateError;
|
|
31
|
+
//# sourceMappingURL=mapCredentialUpdateError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapCredentialUpdateError.d.ts","sourceRoot":"","sources":["../../src/utils/mapCredentialUpdateError.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG,aAAa,GAAG,IAAI,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,KAAK,EAAE,0BAA0B,CAAC;IAClC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAyBD,QAAA,MAAM,wBAAwB,GAAI,OAAO,OAAO,KAAG,2BAYlD,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { KeyValuePair } from '../models/embedded-flow';
|
|
2
|
+
/**
|
|
3
|
+
* Reads the label and value pairs a KEY_VALUE_LIST renders from the raw value found under its
|
|
4
|
+
* `source` key in `additionalData`. The server publishes them as a JSON-encoded array, since
|
|
5
|
+
* additional data carries strings, so both an array and its encoding are accepted.
|
|
6
|
+
*
|
|
7
|
+
* Entries that are not objects, or that carry no value, are dropped, since an empty row tells the
|
|
8
|
+
* user nothing. Anything that is not a list of pairs yields none.
|
|
9
|
+
*
|
|
10
|
+
* @param raw - The raw value found under the source key.
|
|
11
|
+
* @returns The pairs to render, empty when the value holds none.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* parseKeyValuePairs('[{"label":"Email","value":"a@b.com"}]'); // [{label: 'Email', value: 'a@b.com'}]
|
|
16
|
+
* parseKeyValuePairs('not json'); // []
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare const parseKeyValuePairs: (raw: unknown) => KeyValuePair[];
|
|
20
|
+
export default parseKeyValuePairs;
|
|
21
|
+
//# sourceMappingURL=parseKeyValuePairs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseKeyValuePairs.d.ts","sourceRoot":"","sources":["../../src/utils/parseKeyValuePairs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,kBAAkB,GAAI,KAAK,OAAO,KAAG,YAAY,EA2BtD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ManagementRequestConfig } from '../models/api';
|
|
2
|
+
/**
|
|
3
|
+
* Describes a single request against a management API resource collection.
|
|
4
|
+
*/
|
|
5
|
+
export interface ManagementResourceRequest {
|
|
6
|
+
/**
|
|
7
|
+
* Request payload, serialized as JSON.
|
|
8
|
+
*/
|
|
9
|
+
body?: unknown;
|
|
10
|
+
/**
|
|
11
|
+
* Collection path segment appended to `baseUrl` when no `url` is given (e.g. `applications`).
|
|
12
|
+
*/
|
|
13
|
+
collection: string;
|
|
14
|
+
/**
|
|
15
|
+
* Message prefix used when the server rejects the request.
|
|
16
|
+
*/
|
|
17
|
+
failureMessage: string;
|
|
18
|
+
/**
|
|
19
|
+
* Identifier of a single resource. When set, the request targets `{collectionUrl}/{id}`.
|
|
20
|
+
*/
|
|
21
|
+
id?: string;
|
|
22
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
23
|
+
/**
|
|
24
|
+
* Name of the calling operation, used as the prefix of every error code it raises.
|
|
25
|
+
*/
|
|
26
|
+
operation: string;
|
|
27
|
+
/**
|
|
28
|
+
* Query parameters. `undefined` values are omitted.
|
|
29
|
+
*/
|
|
30
|
+
query?: Record<string, string | number | undefined>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Performs a request against a management API resource and maps failures onto
|
|
34
|
+
* {@link ThunderIDAPIError}. HTTP 403 and 404 get their own codes so a caller can tell a missing
|
|
35
|
+
* permission from a missing resource.
|
|
36
|
+
*
|
|
37
|
+
* @returns The parsed JSON body, or `undefined` when the server returns no content.
|
|
38
|
+
*/
|
|
39
|
+
declare const requestManagementResource: <T>({ baseUrl, url, fetcher, ...requestConfig }: ManagementRequestConfig, { body, collection, failureMessage, id, method, operation, query }: ManagementResourceRequest) => Promise<T>;
|
|
40
|
+
export default requestManagementResource;
|
|
41
|
+
//# sourceMappingURL=requestManagementResource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestManagementResource.d.ts","sourceRoot":"","sources":["../../src/utils/requestManagementResource.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC1C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;CACrD;AAED;;;;;;GAMG;AACH,QAAA,MAAM,yBAAyB,GAAU,CAAC,EACxC,6CAA2C,uBAAuB,EAClE,oEAAkE,yBAAyB,KAC1F,OAAO,CAAC,CAAC,CA0FX,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PasswordPolicy } from './evaluatePasswordPolicy';
|
|
2
|
+
import { AttributeSchema } from '../api/getUsersMeMeta';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the rules a change-credential form should enforce for the given credential.
|
|
5
|
+
*
|
|
6
|
+
* The organization's own policy, expressed as the credential attribute's `regex` in
|
|
7
|
+
* `GET /users/me/meta`, is the sole source of truth: the SDK does not layer its own
|
|
8
|
+
* character-class or length rules on top, since doing so could reject a value the
|
|
9
|
+
* organization's policy accepts. When the schema carries no regex for this credential,
|
|
10
|
+
* there is no policy to check client-side and the requirement checklist is simply empty.
|
|
11
|
+
*
|
|
12
|
+
* @param userSchema - The user type schema resolved by the provider, keyed by attribute.
|
|
13
|
+
* @param attribute - The credential attribute this form manages (e.g. `password`, `pin`).
|
|
14
|
+
* @param override - An explicit policy supplied by the caller, which wins outright.
|
|
15
|
+
* @returns The policy to hand to {@link evaluatePasswordPolicy}.
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const policy = resolveChangeCredentialPolicy(userSchema, 'pin', undefined);
|
|
19
|
+
* const results = evaluatePasswordPolicy(candidate, policy);
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare const resolveChangeCredentialPolicy: (userSchema: Record<string, AttributeSchema> | null | undefined, attribute: string, override?: PasswordPolicy) => PasswordPolicy;
|
|
23
|
+
export default resolveChangeCredentialPolicy;
|
|
24
|
+
//# sourceMappingURL=resolveChangeCredentialPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveChangeCredentialPolicy.d.ts","sourceRoot":"","sources":["../../src/utils/resolveChangeCredentialPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,6BAA6B,GACjC,YAAY,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,IAAI,GAAG,SAAS,EAC9D,WAAW,MAAM,EACjB,WAAW,cAAc,KACxB,cAQF,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { BaseConfig } from '../models/config';
|
|
|
8
8
|
* issuers), these overrides let the SDK send flow and user-management requests to the resource
|
|
9
9
|
* server while OAuth requests continue to target the authorization server.
|
|
10
10
|
*/
|
|
11
|
-
export type ResourceEndpointKey = 'flowExecute' | 'flowMeta' | 'usersMe' | 'usersMeMeta';
|
|
11
|
+
export type ResourceEndpointKey = 'agents' | 'applications' | 'flowExecute' | 'flowMeta' | 'users' | 'usersMe' | 'usersMeCredentials' | 'usersMeMeta';
|
|
12
12
|
/**
|
|
13
13
|
* The `config.endpoints` keys that address resource-server endpoints rather than OIDC/OAuth
|
|
14
14
|
* endpoints. Used to keep these overrides out of the resolved OIDC provider metadata.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveResourceEndpoint.d.ts","sourceRoot":"","sources":["../../src/utils/resolveResourceEndpoint.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"resolveResourceEndpoint.d.ts","sourceRoot":"","sources":["../../src/utils/resolveResourceEndpoint.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,cAAc,GACd,aAAa,GACb,UAAU,GACV,OAAO,GACP,SAAS,GACT,oBAAoB,GACpB,aAAa,CAAC;AAElB;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,mBAAmB,EAShE,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,QAAA,MAAM,uBAAuB,GAC3B,KAAK,mBAAmB,EACxB,QAAQ,sBAAsB,GAAG,SAAS,EAC1C,cAAc,MAAM,KACnB,MAAM,GAAG,SAAiE,CAAC;AAE9E,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AttributeSchema } from '../api/getUsersMeMeta';
|
|
2
|
+
/**
|
|
3
|
+
* Whether the signed-in user's type allows them to set the given credential for themselves.
|
|
4
|
+
*
|
|
5
|
+
* The user type schema from `GET /users/me/meta` is the only thing a client can check before
|
|
6
|
+
* rendering. It says whether the credential is declared on this type at all, which is a property
|
|
7
|
+
* of the type rather than of the account, so it cannot say whether this particular user has one
|
|
8
|
+
* stored today. That second question is the server's to answer.
|
|
9
|
+
*
|
|
10
|
+
* Without this check the form would submit into a guaranteed failure. `POST
|
|
11
|
+
* /users/me/update-credentials` rejects a write for a name not declared on the type, since the
|
|
12
|
+
* entity layer only accepts schema-declared credential keys.
|
|
13
|
+
*
|
|
14
|
+
* An absent schema means the answer is not known yet, either because the profile is still loading
|
|
15
|
+
* or because the consuming app never supplied one. Both resolve to `true` so a change-credential
|
|
16
|
+
* affordance is never hidden on missing information alone, and so apps that do not wire up
|
|
17
|
+
* `userSchema` keep the behaviour they had before this check existed.
|
|
18
|
+
*
|
|
19
|
+
* @param userSchema - The user type schema resolved by the provider, keyed by attribute.
|
|
20
|
+
* @param attribute - The credential attribute to check (e.g. `password`, `pin`).
|
|
21
|
+
* @returns `false` only when the schema is known and either defines no attribute named
|
|
22
|
+
* `attribute` or defines one that isn't marked `credential: true`.
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* if (!supportsCredential(userSchema, 'pin')) {
|
|
26
|
+
* return null;
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
declare const supportsCredential: (userSchema: Record<string, AttributeSchema> | null | undefined, attribute: string) => boolean;
|
|
31
|
+
export default supportsCredential;
|
|
32
|
+
//# sourceMappingURL=supportsCredential.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supportsCredential.d.ts","sourceRoot":"","sources":["../../src/utils/supportsCredential.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,QAAA,MAAM,kBAAkB,GACtB,YAAY,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,IAAI,GAAG,SAAS,EAC9D,WAAW,MAAM,KAChB,OAMF,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LogoutTokenClaims, LogoutTokenValidationOptions } from '../models/logout-token';
|
|
2
|
+
/**
|
|
3
|
+
* Checks the header and claims of a back-channel logout token, per OpenID Connect Back-Channel
|
|
4
|
+
* Logout 1.0 section 2.6. It does not verify the signature: the caller does that with the server's
|
|
5
|
+
* keys. Messages never include the token or its claim values.
|
|
6
|
+
*
|
|
7
|
+
* @param header - The decoded JOSE header.
|
|
8
|
+
* @param payload - The decoded claims.
|
|
9
|
+
* @param options - The issuer, client and clock the claims are checked against.
|
|
10
|
+
* @returns The claims, typed.
|
|
11
|
+
* @throws {InvalidLogoutTokenError} When any check fails.
|
|
12
|
+
*/
|
|
13
|
+
declare const validateLogoutTokenClaims: (header: unknown, payload: unknown, options: LogoutTokenValidationOptions) => LogoutTokenClaims;
|
|
14
|
+
export default validateLogoutTokenClaims;
|
|
15
|
+
//# sourceMappingURL=validateLogoutTokenClaims.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateLogoutTokenClaims.d.ts","sourceRoot":"","sources":["../../src/utils/validateLogoutTokenClaims.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,iBAAiB,EAAE,4BAA4B,EAAC,MAAM,wBAAwB,CAAC;AAWvF;;;;;;;;;;GAUG;AACH,QAAA,MAAM,yBAAyB,GAC7B,QAAQ,OAAO,EACf,SAAS,OAAO,EAChB,SAAS,4BAA4B,KACpC,iBA4DF,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thunderid/javascript",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "JavaScript Ecosystem SDK for ThunderID",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"thunderid",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"rimraf": "6.1.3",
|
|
45
45
|
"rolldown": "1.0.0-beta.45",
|
|
46
46
|
"typescript": "5.9.3",
|
|
47
|
-
"vitest": "4.1.
|
|
47
|
+
"vitest": "4.1.11"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"jose": "6.2.3",
|