@absolutejs/auth 0.55.5 → 0.55.7
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/README.md +6 -1
- package/dist/agents/index.js +36 -6
- package/dist/agents/index.js.map +6 -5
- package/dist/index.d.ts +3400 -8
- package/dist/index.js +777 -522
- package/dist/index.js.map +17 -13
- package/dist/server.d.ts +6 -6
- package/dist/server.js +775 -522
- package/dist/server.js.map +18 -14
- package/package.json +1 -1
- package/dist/abuse/captcha.d.ts +0 -11
- package/dist/abuse/config.d.ts +0 -29
- package/dist/actions.d.ts +0 -27
- package/dist/adaptive/config.d.ts +0 -34
- package/dist/adaptive/fingerprint.d.ts +0 -2
- package/dist/adaptive/inMemoryStores.d.ts +0 -3
- package/dist/adaptive/postgresStores.d.ts +0 -245
- package/dist/adaptive/types.d.ts +0 -62
- package/dist/agents/config.d.ts +0 -44
- package/dist/agents/context.d.ts +0 -46
- package/dist/agents/idJag.d.ts +0 -49
- package/dist/agents/inMemoryStores.d.ts +0 -4
- package/dist/agents/oidcAdapter.d.ts +0 -12
- package/dist/agents/postgresStores.d.ts +0 -569
- package/dist/agents/principal.d.ts +0 -4
- package/dist/agents/registration.d.ts +0 -162
- package/dist/agents/registrationClient.d.ts +0 -50
- package/dist/agents/routes.d.ts +0 -214
- package/dist/agents/types.d.ts +0 -129
- package/dist/apikeys/config.d.ts +0 -64
- package/dist/apikeys/inMemoryStores.d.ts +0 -4
- package/dist/apikeys/postgresStores.d.ts +0 -359
- package/dist/apikeys/routes.d.ts +0 -83
- package/dist/apikeys/types.d.ts +0 -53
- package/dist/audit/config.d.ts +0 -9
- package/dist/audit/export.d.ts +0 -2
- package/dist/audit/inMemoryAuditStore.d.ts +0 -2
- package/dist/audit/integrity.d.ts +0 -19
- package/dist/audit/postgresAuditStore.d.ts +0 -116
- package/dist/audit/siem.d.ts +0 -11
- package/dist/audit/types.d.ts +0 -19
- package/dist/audit/wrap.d.ts +0 -9
- package/dist/authInstance.d.ts +0 -7
- package/dist/authorization/config.d.ts +0 -19
- package/dist/authorization/protectPermission.d.ts +0 -52
- package/dist/compliance/cipher.d.ts +0 -5
- package/dist/compliance/config.d.ts +0 -18
- package/dist/compliance/redaction.d.ts +0 -8
- package/dist/compliance/routes.d.ts +0 -89
- package/dist/constants.d.ts +0 -10
- package/dist/credentials/backgroundOps.d.ts +0 -45
- package/dist/credentials/config.d.ts +0 -68
- package/dist/credentials/emailValidation.d.ts +0 -9
- package/dist/credentials/emailVerification.d.ts +0 -83
- package/dist/credentials/import.d.ts +0 -34
- package/dist/credentials/inMemoryCredentialStore.d.ts +0 -2
- package/dist/credentials/legacyHashers.d.ts +0 -3
- package/dist/credentials/login.d.ts +0 -76
- package/dist/credentials/passwordPolicy.d.ts +0 -15
- package/dist/credentials/passwordReset.d.ts +0 -87
- package/dist/credentials/postgresCredentialStore.d.ts +0 -235
- package/dist/credentials/register.d.ts +0 -54
- package/dist/credentials/routes.d.ts +0 -201
- package/dist/credentials/types.d.ts +0 -26
- package/dist/crypto.d.ts +0 -32
- package/dist/errors.d.ts +0 -12
- package/dist/federation/tokenStore.d.ts +0 -29
- package/dist/fga/config.d.ts +0 -53
- package/dist/fga/inMemoryStores.d.ts +0 -3
- package/dist/fga/postgresStores.d.ts +0 -116
- package/dist/fga/redisCheckCache.d.ts +0 -11
- package/dist/fga/schema.d.ts +0 -2
- package/dist/fga/types.d.ts +0 -28
- package/dist/htmx/renderers.d.ts +0 -8
- package/dist/htmx/routes.d.ts +0 -514
- package/dist/htmx/types.d.ts +0 -129
- package/dist/linkedProviders/inMemoryStores.d.ts +0 -9
- package/dist/linkedProviders/neonStores.d.ts +0 -484
- package/dist/linkedProviders/oauthResolver.d.ts +0 -9
- package/dist/linkedProviders/resolver.d.ts +0 -22
- package/dist/lockout/config.d.ts +0 -17
- package/dist/lockout/inMemoryLockoutStore.d.ts +0 -2
- package/dist/lockout/postgresLockoutStore.d.ts +0 -71
- package/dist/lockout/redisLockoutStore.d.ts +0 -3
- package/dist/lockout/types.d.ts +0 -12
- package/dist/mfa/backupCodes.d.ts +0 -5
- package/dist/mfa/challenge.d.ts +0 -70
- package/dist/mfa/config.d.ts +0 -50
- package/dist/mfa/gate.d.ts +0 -2
- package/dist/mfa/inMemoryMfaStore.d.ts +0 -2
- package/dist/mfa/management.d.ts +0 -106
- package/dist/mfa/postgresMfaStore.d.ts +0 -206
- package/dist/mfa/rotation.d.ts +0 -17
- package/dist/mfa/routes.d.ts +0 -234
- package/dist/mfa/secret.d.ts +0 -2
- package/dist/mfa/sms.d.ts +0 -105
- package/dist/mfa/totp.d.ts +0 -91
- package/dist/mfa/types.d.ts +0 -23
- package/dist/migrations/generate.d.ts +0 -2
- package/dist/migrations/index.d.ts +0 -5
- package/dist/migrations/runner.d.ts +0 -13
- package/dist/migrations/types.d.ts +0 -14
- package/dist/oidc/clientAuth.d.ts +0 -19
- package/dist/oidc/clientIdMetadata.d.ts +0 -32
- package/dist/oidc/config.d.ts +0 -295
- package/dist/oidc/dpop.d.ts +0 -23
- package/dist/oidc/inMemoryStores.d.ts +0 -11
- package/dist/oidc/inMemoryVciStores.d.ts +0 -3
- package/dist/oidc/jar.d.ts +0 -14
- package/dist/oidc/keys.d.ts +0 -25
- package/dist/oidc/logout.d.ts +0 -38
- package/dist/oidc/mtls.d.ts +0 -11
- package/dist/oidc/par.d.ts +0 -28
- package/dist/oidc/postgresStores.d.ts +0 -1187
- package/dist/oidc/registration.d.ts +0 -138
- package/dist/oidc/routes.d.ts +0 -568
- package/dist/oidc/types.d.ts +0 -143
- package/dist/oidc/userinfo.d.ts +0 -21
- package/dist/oidc/vci.d.ts +0 -159
- package/dist/oidc/vciRoutes.d.ts +0 -92
- package/dist/organizations/config.d.ts +0 -46
- package/dist/organizations/inMemoryOrganizationStore.d.ts +0 -2
- package/dist/organizations/operations.d.ts +0 -39
- package/dist/organizations/postgresOrganizationStore.d.ts +0 -340
- package/dist/organizations/routes.d.ts +0 -298
- package/dist/organizations/types.d.ts +0 -45
- package/dist/passwordless/config.d.ts +0 -43
- package/dist/passwordless/inMemoryPasswordlessTokenStore.d.ts +0 -2
- package/dist/passwordless/postgresPasswordlessTokenStore.d.ts +0 -56
- package/dist/passwordless/routes.d.ts +0 -162
- package/dist/passwordless/types.d.ts +0 -9
- package/dist/portal/config.d.ts +0 -34
- package/dist/portal/inMemorySetupSessionStore.d.ts +0 -2
- package/dist/portal/operations.d.ts +0 -10
- package/dist/portal/postgresSetupSessionStore.d.ts +0 -116
- package/dist/portal/routes.d.ts +0 -160
- package/dist/portal/types.d.ts +0 -16
- package/dist/providers/clients.d.ts +0 -1818
- package/dist/providersFromEnv.d.ts +0 -19
- package/dist/roles/config.d.ts +0 -27
- package/dist/roles/inMemoryRoleStore.d.ts +0 -2
- package/dist/roles/operations.d.ts +0 -8
- package/dist/roles/postgresRoleStore.d.ts +0 -86
- package/dist/roles/resolver.d.ts +0 -17
- package/dist/roles/routes.d.ts +0 -105
- package/dist/roles/types.d.ts +0 -14
- package/dist/routes/authorize.d.ts +0 -102
- package/dist/routes/callback.d.ts +0 -64
- package/dist/routes/profile.d.ts +0 -70
- package/dist/routes/protectRoute.d.ts +0 -51
- package/dist/routes/refresh.d.ts +0 -74
- package/dist/routes/revoke.d.ts +0 -73
- package/dist/routes/sessions.d.ts +0 -103
- package/dist/routes/signout.d.ts +0 -70
- package/dist/routes/stepUp.d.ts +0 -48
- package/dist/routes/userStatus.d.ts +0 -72
- package/dist/scim/config.d.ts +0 -57
- package/dist/scim/extensions.d.ts +0 -30
- package/dist/scim/inMemoryScimTokenStore.d.ts +0 -2
- package/dist/scim/postgresScimTokenStore.d.ts +0 -86
- package/dist/scim/routes.d.ts +0 -366
- package/dist/scim/serialize.d.ts +0 -83
- package/dist/scim/types.d.ts +0 -54
- package/dist/serverConfig.d.ts +0 -10
- package/dist/session/access.d.ts +0 -33
- package/dist/session/anonymous.d.ts +0 -12
- package/dist/session/cleanup.d.ts +0 -45
- package/dist/session/impersonation.d.ts +0 -34
- package/dist/session/inMemoryStore.d.ts +0 -7
- package/dist/session/internalData.d.ts +0 -34
- package/dist/session/multiSession.d.ts +0 -27
- package/dist/session/neonStore.d.ts +0 -513
- package/dist/session/promote.d.ts +0 -23
- package/dist/session/redisStore.d.ts +0 -6
- package/dist/session/sessionsConfig.d.ts +0 -9
- package/dist/session/state.d.ts +0 -33
- package/dist/session/types.d.ts +0 -20
- package/dist/session/userSessions.d.ts +0 -19
- package/dist/sso/config.d.ts +0 -149
- package/dist/sso/discoveryRoute.d.ts +0 -63
- package/dist/sso/inMemorySamlServiceProviderStore.d.ts +0 -2
- package/dist/sso/inMemorySsoConnectionStore.d.ts +0 -2
- package/dist/sso/oidcRoutes.d.ts +0 -98
- package/dist/sso/postgresSamlServiceProviderStore.d.ts +0 -101
- package/dist/sso/postgresSsoConnectionStore.d.ts +0 -116
- package/dist/sso/samlIdpRoutes.d.ts +0 -139
- package/dist/sso/samlRoutes.d.ts +0 -178
- package/dist/sso/types.d.ts +0 -53
- package/dist/stores/postgres.d.ts +0 -5
- package/dist/stores/redis.d.ts +0 -5
- package/dist/telemetry/tracing.d.ts +0 -15
- package/dist/tenancy.d.ts +0 -9
- package/dist/typeGuards.d.ts +0 -6
- package/dist/typebox.d.ts +0 -4
- package/dist/types.d.ts +0 -421
- package/dist/utils.d.ts +0 -45
- package/dist/vault/config.d.ts +0 -20
- package/dist/vault/inMemoryVaultStore.d.ts +0 -2
- package/dist/vault/postgresVaultStore.d.ts +0 -86
- package/dist/vault/types.d.ts +0 -14
- package/dist/vc/inMemoryVpStores.d.ts +0 -2
- package/dist/vc/openid4vp.d.ts +0 -82
- package/dist/vc/postgresVcStores.d.ts +0 -300
- package/dist/vc/sdJwt.d.ts +0 -37
- package/dist/vc/statusList.d.ts +0 -29
- package/dist/vc/statusListRoutes.d.ts +0 -63
- package/dist/vc/vpRoutes.d.ts +0 -120
- package/dist/webauthn/adapter.d.ts +0 -59
- package/dist/webauthn/config.d.ts +0 -36
- package/dist/webauthn/inMemoryWebAuthnCredentialStore.d.ts +0 -2
- package/dist/webauthn/postgresWebAuthnCredentialStore.d.ts +0 -146
- package/dist/webauthn/routes.d.ts +0 -155
- package/dist/webauthn/types.d.ts +0 -17
- package/dist/webhooks/config.d.ts +0 -34
- package/dist/webhooks/dispatcher.d.ts +0 -3
- package/dist/webhooks/inMemoryStore.d.ts +0 -2
- package/dist/webhooks/postgresStore.d.ts +0 -116
- package/dist/webhooks/sign.d.ts +0 -11
- package/dist/webhooks/types.d.ts +0 -25
package/dist/oidc/config.d.ts
DELETED
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
import type { RouteString } from '../types';
|
|
2
|
-
import { type SigningKey } from './keys';
|
|
3
|
-
import type { OnClientRegistered, OnClientRegistration } from './registration';
|
|
4
|
-
import type { VciConfig } from './vci';
|
|
5
|
-
import type { AuthorizationCodeStore, BackchannelAuthStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, LogoutDeliveryStore, OAuthClient, OAuthClientStore, OidcRefreshTokenStore, PushedAuthorizationRequestStore } from './types';
|
|
6
|
-
export declare const DEFAULT_OIDC_ROUTE: RouteString;
|
|
7
|
-
export type PublicTokenGrantResult = {
|
|
8
|
-
body: Record<string, unknown>;
|
|
9
|
-
status: number;
|
|
10
|
-
};
|
|
11
|
-
export type OidcProviderConfig<UserType> = {
|
|
12
|
-
/** Additional non-conflicting RFC 8414 metadata. Reserved core OAuth keys
|
|
13
|
-
* cannot be replaced. Used by profiles such as open agent registration. */
|
|
14
|
-
additionalDiscoveryMetadata?: Record<string, unknown>;
|
|
15
|
-
/** Public extension grants whose bearer material is carried in their body
|
|
16
|
-
* (for example an agent claim_token). They run before OAuth client auth. */
|
|
17
|
-
publicTokenGrantTypes?: string[];
|
|
18
|
-
handlePublicTokenGrant?: (context: {
|
|
19
|
-
body: Record<string, string | undefined>;
|
|
20
|
-
request: Request;
|
|
21
|
-
}) => Promise<PublicTokenGrantResult | undefined>;
|
|
22
|
-
accessTokenTtlMs?: number | ((context: {
|
|
23
|
-
scopes: string[];
|
|
24
|
-
}) => number);
|
|
25
|
-
acrValuesSupported?: string[];
|
|
26
|
-
authorizationCodeStore: AuthorizationCodeStore;
|
|
27
|
-
clientAssertionJtiStore?: ClientAssertionJtiStore;
|
|
28
|
-
clientRegistrationTokenStore?: ClientRegistrationTokenStore;
|
|
29
|
-
clientStore: OAuthClientStore;
|
|
30
|
-
resolveClientIdMetadata?: (clientId: string) => Promise<OAuthClient | undefined>;
|
|
31
|
-
deviceAuthorizationStore?: DeviceAuthorizationStore;
|
|
32
|
-
deviceCodeTtlMs?: number;
|
|
33
|
-
devicePollIntervalSeconds?: number;
|
|
34
|
-
backchannelAuthStore?: BackchannelAuthStore;
|
|
35
|
-
backchannelAuthTtlMs?: number;
|
|
36
|
-
backchannelPollIntervalSeconds?: number;
|
|
37
|
-
resolveBackchannelUser?: (hint: {
|
|
38
|
-
client: OAuthClient;
|
|
39
|
-
loginHint: string;
|
|
40
|
-
}) => Promise<{
|
|
41
|
-
sub: string;
|
|
42
|
-
} | undefined>;
|
|
43
|
-
onBackchannelAuthRequest?: (context: {
|
|
44
|
-
authReqId: string;
|
|
45
|
-
bindingMessage: string | undefined;
|
|
46
|
-
clientId: string;
|
|
47
|
-
scopes: string[];
|
|
48
|
-
userSub: string;
|
|
49
|
-
}) => Promise<void> | void;
|
|
50
|
-
getAccessTokenClaims?: (context: {
|
|
51
|
-
audience?: string;
|
|
52
|
-
clientId: string;
|
|
53
|
-
scopes: string[];
|
|
54
|
-
sub: string;
|
|
55
|
-
}) => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
56
|
-
getClaims?: (user: UserType) => Record<string, unknown>;
|
|
57
|
-
consentUrl?: string;
|
|
58
|
-
needsConsent?: (context: {
|
|
59
|
-
client: {
|
|
60
|
-
clientId: string;
|
|
61
|
-
name: string;
|
|
62
|
-
};
|
|
63
|
-
requestedScopes: string[];
|
|
64
|
-
user: UserType;
|
|
65
|
-
}) => boolean | Promise<boolean>;
|
|
66
|
-
getGrantedScopes?: (context: {
|
|
67
|
-
client: {
|
|
68
|
-
clientId: string;
|
|
69
|
-
name: string;
|
|
70
|
-
};
|
|
71
|
-
requestedScopes: string[];
|
|
72
|
-
user: UserType;
|
|
73
|
-
}) => string[] | undefined | Promise<string[] | undefined>;
|
|
74
|
-
getUserId: (user: UserType) => string;
|
|
75
|
-
getUserInfo?: (sub: string) => Promise<Record<string, unknown> | undefined>;
|
|
76
|
-
idTokenTtlMs?: number;
|
|
77
|
-
issuer: string;
|
|
78
|
-
dpopNonce?: {
|
|
79
|
-
secret: string;
|
|
80
|
-
};
|
|
81
|
-
extractTlsClientCert?: (headers: Headers) => Promise<Uint8Array | undefined> | Uint8Array | undefined;
|
|
82
|
-
getAcr?: (context: {
|
|
83
|
-
scopes: string[];
|
|
84
|
-
user: UserType;
|
|
85
|
-
}) => string | undefined;
|
|
86
|
-
initialAccessTokenStore?: InitialAccessTokenStore;
|
|
87
|
-
loginUrl?: string;
|
|
88
|
-
logoutDeliveryStore?: LogoutDeliveryStore;
|
|
89
|
-
oidcRoute?: RouteString;
|
|
90
|
-
onClientRegistration?: OnClientRegistration;
|
|
91
|
-
/** Fires after RFC 7591 registration has been persisted and has a generated client id. */
|
|
92
|
-
onClientRegistered?: OnClientRegistered;
|
|
93
|
-
/** Fires after the authenticated user approves an RFC 8628 device request. */
|
|
94
|
-
onDeviceAuthorizationApproved?: (context: {
|
|
95
|
-
clientId: string;
|
|
96
|
-
scopes: string[];
|
|
97
|
-
userSub: string;
|
|
98
|
-
}) => void | Promise<void>;
|
|
99
|
-
pushedAuthorizationRequestStore?: PushedAuthorizationRequestStore;
|
|
100
|
-
pushedAuthorizationRequestTtlMs?: number;
|
|
101
|
-
refreshTokenStore: OidcRefreshTokenStore;
|
|
102
|
-
refreshTokenTtlMs?: number;
|
|
103
|
-
signingKey: SigningKey;
|
|
104
|
-
strictFapi?: boolean;
|
|
105
|
-
vciConfig?: VciConfig;
|
|
106
|
-
};
|
|
107
|
-
export type TokenExchangeResult = {
|
|
108
|
-
error: 'invalid_grant' | 'invalid_scope';
|
|
109
|
-
ok: false;
|
|
110
|
-
} | {
|
|
111
|
-
accessToken: string;
|
|
112
|
-
expiresIn: number;
|
|
113
|
-
ok: true;
|
|
114
|
-
scope: string;
|
|
115
|
-
};
|
|
116
|
-
export declare const exchangeToken: <UserType>({ actorClientId, audience, config, dpopJkt, now, requestedScopes, subjectToken }: {
|
|
117
|
-
actorClientId: string;
|
|
118
|
-
audience?: string;
|
|
119
|
-
config: OidcProviderConfig<UserType>;
|
|
120
|
-
dpopJkt?: string;
|
|
121
|
-
now?: number;
|
|
122
|
-
requestedScopes?: string[];
|
|
123
|
-
subjectToken: string;
|
|
124
|
-
}) => Promise<TokenExchangeResult>;
|
|
125
|
-
export declare const issueTokenSet: <UserType>({ acr, claims, clientCertThumbprint, clientId, config, dpopJkt, nonce, now, scopes, sub }: {
|
|
126
|
-
acr?: string;
|
|
127
|
-
claims?: Record<string, unknown>;
|
|
128
|
-
clientCertThumbprint?: string;
|
|
129
|
-
clientId: string;
|
|
130
|
-
config: OidcProviderConfig<UserType>;
|
|
131
|
-
dpopJkt?: string;
|
|
132
|
-
nonce?: string;
|
|
133
|
-
now?: number;
|
|
134
|
-
scopes: string[];
|
|
135
|
-
sub: string;
|
|
136
|
-
}) => Promise<{
|
|
137
|
-
access_token: string;
|
|
138
|
-
expires_in: number;
|
|
139
|
-
id_token: string;
|
|
140
|
-
refresh_token: string;
|
|
141
|
-
scope: string;
|
|
142
|
-
token_type: "Bearer" | "DPoP";
|
|
143
|
-
}>;
|
|
144
|
-
export declare const mcpProtectedResourceMetadata: ({ issuer, resource, scopes }: {
|
|
145
|
-
issuer: string;
|
|
146
|
-
resource: string;
|
|
147
|
-
scopes?: string[];
|
|
148
|
-
}) => {
|
|
149
|
-
authorization_servers: string[];
|
|
150
|
-
resource: string;
|
|
151
|
-
scopes_supported: string[];
|
|
152
|
-
};
|
|
153
|
-
export declare const verifyPkce: (codeVerifier: string, codeChallenge: string) => Promise<boolean>;
|
|
154
|
-
export type TokenIntrospection = {
|
|
155
|
-
active: false;
|
|
156
|
-
} | {
|
|
157
|
-
active: true;
|
|
158
|
-
client_id: string;
|
|
159
|
-
exp: number;
|
|
160
|
-
iat: number;
|
|
161
|
-
scope: string;
|
|
162
|
-
sub: string;
|
|
163
|
-
token_type: 'access_token' | 'refresh_token';
|
|
164
|
-
};
|
|
165
|
-
export type TokenTypeHint = 'access_token' | 'refresh_token';
|
|
166
|
-
export declare const introspectToken: <UserType>({ config, hint, now, token }: {
|
|
167
|
-
config: OidcProviderConfig<UserType>;
|
|
168
|
-
hint?: TokenTypeHint;
|
|
169
|
-
now?: number;
|
|
170
|
-
token: string;
|
|
171
|
-
}) => Promise<{
|
|
172
|
-
active: false;
|
|
173
|
-
} | {
|
|
174
|
-
active: true;
|
|
175
|
-
client_id: string;
|
|
176
|
-
exp: number;
|
|
177
|
-
iat: number;
|
|
178
|
-
scope: string;
|
|
179
|
-
sub: string;
|
|
180
|
-
token_type: "access_token";
|
|
181
|
-
} | {
|
|
182
|
-
active: true;
|
|
183
|
-
client_id: string;
|
|
184
|
-
exp: number;
|
|
185
|
-
iat: number;
|
|
186
|
-
scope: string;
|
|
187
|
-
sub: string;
|
|
188
|
-
token_type: "refresh_token";
|
|
189
|
-
}>;
|
|
190
|
-
export declare const revokeRefreshToken: <UserType>(config: OidcProviderConfig<UserType>, token: string) => Promise<boolean>;
|
|
191
|
-
export type DeviceAuthorizationResponse = {
|
|
192
|
-
device_code: string;
|
|
193
|
-
expires_in: number;
|
|
194
|
-
interval: number;
|
|
195
|
-
user_code: string;
|
|
196
|
-
verification_uri: string;
|
|
197
|
-
verification_uri_complete: string;
|
|
198
|
-
};
|
|
199
|
-
export declare const issueDeviceAuthorization: <UserType>({ clientId, config, now, requestedScopes }: {
|
|
200
|
-
clientId: string;
|
|
201
|
-
config: OidcProviderConfig<UserType>;
|
|
202
|
-
now?: number;
|
|
203
|
-
requestedScopes: string[];
|
|
204
|
-
}) => Promise<DeviceAuthorizationResponse>;
|
|
205
|
-
export type DeviceDecisionResult = {
|
|
206
|
-
error: 'already_decided' | 'expired_token' | 'invalid_user_code' | 'not_configured';
|
|
207
|
-
ok: false;
|
|
208
|
-
} | {
|
|
209
|
-
ok: true;
|
|
210
|
-
};
|
|
211
|
-
export declare const approveDeviceAuthorization: <UserType>({ config, userCode, userSub }: {
|
|
212
|
-
config: OidcProviderConfig<UserType>;
|
|
213
|
-
userCode: string;
|
|
214
|
-
userSub: string;
|
|
215
|
-
}) => Promise<DeviceDecisionResult>;
|
|
216
|
-
export declare const denyDeviceAuthorization: <UserType>({ config, userCode }: {
|
|
217
|
-
config: OidcProviderConfig<UserType>;
|
|
218
|
-
userCode: string;
|
|
219
|
-
}) => Promise<DeviceDecisionResult>;
|
|
220
|
-
export type DeviceCodeExchangeError = 'access_denied' | 'authorization_pending' | 'expired_token' | 'invalid_grant' | 'slow_down';
|
|
221
|
-
export type DeviceCodeExchangeResult = {
|
|
222
|
-
access_token: string;
|
|
223
|
-
expires_in: number;
|
|
224
|
-
id_token: string;
|
|
225
|
-
ok: true;
|
|
226
|
-
refresh_token: string;
|
|
227
|
-
scope: string;
|
|
228
|
-
token_type: 'Bearer' | 'DPoP';
|
|
229
|
-
} | {
|
|
230
|
-
error: DeviceCodeExchangeError;
|
|
231
|
-
ok: false;
|
|
232
|
-
};
|
|
233
|
-
export declare const exchangeDeviceCode: <UserType>({ clientId, config, deviceCode, dpopJkt, now }: {
|
|
234
|
-
clientId: string;
|
|
235
|
-
config: OidcProviderConfig<UserType>;
|
|
236
|
-
deviceCode: string;
|
|
237
|
-
dpopJkt?: string;
|
|
238
|
-
now?: number;
|
|
239
|
-
}) => Promise<DeviceCodeExchangeResult>;
|
|
240
|
-
export declare const CIBA_GRANT_TYPE = "urn:openid:params:grant-type:ciba";
|
|
241
|
-
export type BackchannelAuthResponse = {
|
|
242
|
-
auth_req_id: string;
|
|
243
|
-
expires_in: number;
|
|
244
|
-
interval: number;
|
|
245
|
-
};
|
|
246
|
-
export type BackchannelAuthError = 'expired_login_hint_token' | 'invalid_client' | 'invalid_request' | 'unknown_user_id';
|
|
247
|
-
export declare const issueBackchannelAuth: <UserType>({ clientId, config, loginHint, bindingMessage, now, requestedScopes }: {
|
|
248
|
-
clientId: string;
|
|
249
|
-
config: OidcProviderConfig<UserType>;
|
|
250
|
-
loginHint: string;
|
|
251
|
-
bindingMessage?: string;
|
|
252
|
-
now?: number;
|
|
253
|
-
requestedScopes: string[];
|
|
254
|
-
}) => Promise<{
|
|
255
|
-
error: BackchannelAuthError;
|
|
256
|
-
ok: false;
|
|
257
|
-
} | ({
|
|
258
|
-
ok: true;
|
|
259
|
-
} & BackchannelAuthResponse)>;
|
|
260
|
-
export type BackchannelDecisionResult = {
|
|
261
|
-
error: 'already_decided' | 'expired_token' | 'invalid_auth_req_id' | 'not_configured';
|
|
262
|
-
ok: false;
|
|
263
|
-
} | {
|
|
264
|
-
ok: true;
|
|
265
|
-
};
|
|
266
|
-
export declare const approveBackchannelAuth: <UserType>({ authReqId, config, userSub }: {
|
|
267
|
-
authReqId: string;
|
|
268
|
-
config: OidcProviderConfig<UserType>;
|
|
269
|
-
userSub?: string;
|
|
270
|
-
}) => Promise<BackchannelDecisionResult>;
|
|
271
|
-
export declare const denyBackchannelAuth: <UserType>({ authReqId, config }: {
|
|
272
|
-
authReqId: string;
|
|
273
|
-
config: OidcProviderConfig<UserType>;
|
|
274
|
-
}) => Promise<BackchannelDecisionResult>;
|
|
275
|
-
export type BackchannelExchangeError = 'access_denied' | 'authorization_pending' | 'expired_token' | 'invalid_grant' | 'slow_down';
|
|
276
|
-
export type BackchannelExchangeResult = {
|
|
277
|
-
access_token: string;
|
|
278
|
-
expires_in: number;
|
|
279
|
-
id_token: string;
|
|
280
|
-
ok: true;
|
|
281
|
-
refresh_token: string;
|
|
282
|
-
scope: string;
|
|
283
|
-
token_type: 'Bearer' | 'DPoP';
|
|
284
|
-
} | {
|
|
285
|
-
error: BackchannelExchangeError;
|
|
286
|
-
ok: false;
|
|
287
|
-
};
|
|
288
|
-
export declare const exchangeBackchannelAuth: <UserType>({ authReqId, clientCertThumbprint, clientId, config, dpopJkt, now }: {
|
|
289
|
-
authReqId: string;
|
|
290
|
-
clientCertThumbprint?: string;
|
|
291
|
-
clientId: string;
|
|
292
|
-
config: OidcProviderConfig<UserType>;
|
|
293
|
-
dpopJkt?: string;
|
|
294
|
-
now?: number;
|
|
295
|
-
}) => Promise<BackchannelExchangeResult>;
|
package/dist/oidc/dpop.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare const extractDpopNonceClaim: (proof: string) => string | undefined;
|
|
2
|
-
export declare const mintDpopNonce: ({ now, secret }: {
|
|
3
|
-
now?: number;
|
|
4
|
-
secret: string;
|
|
5
|
-
}) => Promise<string>;
|
|
6
|
-
export declare const verifyDpopNonce: ({ now, nonce, secret }: {
|
|
7
|
-
nonce: string;
|
|
8
|
-
now?: number;
|
|
9
|
-
secret: string;
|
|
10
|
-
}) => Promise<boolean>;
|
|
11
|
-
export type DpopResult = {
|
|
12
|
-
jkt: string;
|
|
13
|
-
jti?: string;
|
|
14
|
-
};
|
|
15
|
-
export declare const verifyDpopProof: ({ accessToken, htm, htu, isUsedJti, maxAgeMs, now, proof }: {
|
|
16
|
-
accessToken?: string;
|
|
17
|
-
htm: string;
|
|
18
|
-
htu: string;
|
|
19
|
-
isUsedJti?: (jti: string) => boolean | Promise<boolean>;
|
|
20
|
-
maxAgeMs?: number;
|
|
21
|
-
now?: number;
|
|
22
|
-
proof: string | undefined;
|
|
23
|
-
}) => Promise<DpopResult | undefined>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AuthorizationCodeStore, BackchannelAuthStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, LogoutDeliveryStore, OAuthClient, OAuthClientStore, OidcRefreshTokenStore, PushedAuthorizationRequestStore } from './types';
|
|
2
|
-
export declare const createInMemoryAuthorizationCodeStore: () => AuthorizationCodeStore;
|
|
3
|
-
export declare const createInMemoryBackchannelAuthStore: () => BackchannelAuthStore;
|
|
4
|
-
export declare const createInMemoryClientAssertionJtiStore: () => ClientAssertionJtiStore;
|
|
5
|
-
export declare const createInMemoryClientRegistrationTokenStore: () => ClientRegistrationTokenStore;
|
|
6
|
-
export declare const createInMemoryDeviceAuthorizationStore: () => DeviceAuthorizationStore;
|
|
7
|
-
export declare const createInMemoryInitialAccessTokenStore: (initialHashes?: string[]) => InitialAccessTokenStore;
|
|
8
|
-
export declare const createInMemoryLogoutDeliveryStore: () => LogoutDeliveryStore;
|
|
9
|
-
export declare const createInMemoryOAuthClientStore: (clients: OAuthClient[]) => OAuthClientStore;
|
|
10
|
-
export declare const createInMemoryOidcRefreshTokenStore: () => OidcRefreshTokenStore;
|
|
11
|
-
export declare const createInMemoryPushedAuthorizationRequestStore: () => PushedAuthorizationRequestStore;
|
package/dist/oidc/jar.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { OAuthClient } from './types';
|
|
2
|
-
export type JarParseResult = {
|
|
3
|
-
error: 'invalid_request_object';
|
|
4
|
-
ok: false;
|
|
5
|
-
} | {
|
|
6
|
-
ok: true;
|
|
7
|
-
params: Record<string, string>;
|
|
8
|
-
};
|
|
9
|
-
export declare const parseSignedRequestObject: ({ client, expectedIssuer, jwt, now }: {
|
|
10
|
-
client: OAuthClient;
|
|
11
|
-
expectedIssuer: string;
|
|
12
|
-
jwt: string;
|
|
13
|
-
now?: number;
|
|
14
|
-
}) => Promise<JarParseResult>;
|
package/dist/oidc/keys.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export type SigningKey = {
|
|
2
|
-
kid: string;
|
|
3
|
-
privateJwk: JsonWebKey;
|
|
4
|
-
publicJwk: JsonWebKey;
|
|
5
|
-
};
|
|
6
|
-
export declare const generateSigningKey: () => Promise<SigningKey>;
|
|
7
|
-
export declare const jwkThumbprint: (jwk: JsonWebKey) => Promise<string>;
|
|
8
|
-
export declare const signJwt: (payload: Record<string, unknown>, signing: SigningKey, typ?: string) => Promise<string>;
|
|
9
|
-
export declare const toPublicJwk: (key: SigningKey) => {
|
|
10
|
-
alg: string;
|
|
11
|
-
crv: string | undefined;
|
|
12
|
-
kid: string;
|
|
13
|
-
kty: string | undefined;
|
|
14
|
-
use: string;
|
|
15
|
-
x: string | undefined;
|
|
16
|
-
y: string | undefined;
|
|
17
|
-
};
|
|
18
|
-
export declare const verifyJwt: (token: string, publicJwk: JsonWebKey) => Promise<{
|
|
19
|
-
header: {
|
|
20
|
-
[k: string]: any;
|
|
21
|
-
};
|
|
22
|
-
payload: {
|
|
23
|
-
[k: string]: any;
|
|
24
|
-
};
|
|
25
|
-
} | undefined>;
|
package/dist/oidc/logout.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { OidcProviderConfig } from './config';
|
|
2
|
-
import type { LogoutDelivery, OAuthClient } from './types';
|
|
3
|
-
export declare const resolvePostLogoutRedirect: ({ client, requestedUri }: {
|
|
4
|
-
client: OAuthClient;
|
|
5
|
-
requestedUri: string | undefined;
|
|
6
|
-
}) => string | undefined;
|
|
7
|
-
export declare const verifyIdTokenHint: <UserType>({ config, idTokenHint }: {
|
|
8
|
-
config: OidcProviderConfig<UserType>;
|
|
9
|
-
idTokenHint: string;
|
|
10
|
-
}) => Promise<{
|
|
11
|
-
audClientId: string;
|
|
12
|
-
sub: string;
|
|
13
|
-
} | undefined>;
|
|
14
|
-
type DeliveryFetch = (url: string, init: {
|
|
15
|
-
body: string;
|
|
16
|
-
headers: Record<string, string>;
|
|
17
|
-
method: string;
|
|
18
|
-
signal: AbortSignal;
|
|
19
|
-
}) => Promise<{
|
|
20
|
-
ok: boolean;
|
|
21
|
-
status: number;
|
|
22
|
-
}>;
|
|
23
|
-
export declare const mintLogoutToken: <UserType>({ clientId, config, now, sub }: {
|
|
24
|
-
clientId: string;
|
|
25
|
-
config: OidcProviderConfig<UserType>;
|
|
26
|
-
now?: number;
|
|
27
|
-
sub: string;
|
|
28
|
-
}) => Promise<string>;
|
|
29
|
-
export declare const fanOutBackchannelLogout: <UserType>({ config, fetchImpl, now, onError, skipClientId, timeoutMs, userId }: {
|
|
30
|
-
config: OidcProviderConfig<UserType>;
|
|
31
|
-
fetchImpl?: DeliveryFetch;
|
|
32
|
-
now?: number;
|
|
33
|
-
onError?: (delivery: LogoutDelivery) => void | Promise<void>;
|
|
34
|
-
skipClientId?: string;
|
|
35
|
-
timeoutMs?: number;
|
|
36
|
-
userId: string;
|
|
37
|
-
}) => Promise<string[]>;
|
|
38
|
-
export {};
|
package/dist/oidc/mtls.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const computeCertThumbprint: (derBytes: Uint8Array) => Promise<string>;
|
|
2
|
-
export declare const extractRfc9440ClientCert: (headers: Headers) => Uint8Array<ArrayBuffer> | undefined;
|
|
3
|
-
export declare const resolveClientCert: ({ extract, headers }: {
|
|
4
|
-
extract: ((headers: Headers) => Promise<Uint8Array | undefined> | Uint8Array | undefined) | undefined;
|
|
5
|
-
headers: Headers;
|
|
6
|
-
}) => Promise<Uint8Array<ArrayBufferLike> | undefined>;
|
|
7
|
-
export declare const verifyCertificateBoundToken: ({ cnfThumbprint, extract, headers }: {
|
|
8
|
-
cnfThumbprint: string | undefined;
|
|
9
|
-
extract: ((headers: Headers) => Promise<Uint8Array | undefined> | Uint8Array | undefined) | undefined;
|
|
10
|
-
headers: Headers;
|
|
11
|
-
}) => Promise<boolean>;
|
package/dist/oidc/par.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { OAuthClient, PushedAuthorizationRequestStore } from './types';
|
|
2
|
-
export declare const DEFAULT_PAR_TTL_MS: number;
|
|
3
|
-
export declare const REQUEST_URI_PREFIX = "urn:ietf:params:oauth:request_uri:";
|
|
4
|
-
export type PushAuthorizationResult = {
|
|
5
|
-
body: {
|
|
6
|
-
expires_in: number;
|
|
7
|
-
request_uri: string;
|
|
8
|
-
};
|
|
9
|
-
ok: true;
|
|
10
|
-
} | {
|
|
11
|
-
body: {
|
|
12
|
-
error: string;
|
|
13
|
-
};
|
|
14
|
-
ok: false;
|
|
15
|
-
status: 400 | 401;
|
|
16
|
-
};
|
|
17
|
-
export declare const consumePushedRequest: ({ clientId, requestUri, store }: {
|
|
18
|
-
clientId: string;
|
|
19
|
-
requestUri: string;
|
|
20
|
-
store: PushedAuthorizationRequestStore;
|
|
21
|
-
}) => Promise<Record<string, string> | undefined>;
|
|
22
|
-
export declare const pushAuthorizationRequest: ({ client, now, params, store, ttlMs }: {
|
|
23
|
-
client: OAuthClient;
|
|
24
|
-
now?: number;
|
|
25
|
-
params: Record<string, string>;
|
|
26
|
-
store: PushedAuthorizationRequestStore;
|
|
27
|
-
ttlMs?: number;
|
|
28
|
-
}) => Promise<PushAuthorizationResult>;
|