@absolutejs/auth 0.65.1 → 0.65.2
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/abuse/captcha.d.ts +11 -0
- package/dist/abuse/config.d.ts +29 -0
- package/dist/actions.d.ts +27 -0
- package/dist/adaptive/config.d.ts +34 -0
- package/dist/adaptive/fingerprint.d.ts +2 -0
- package/dist/adaptive/inMemoryStores.d.ts +3 -0
- package/dist/adaptive/postgresStores.d.ts +245 -0
- package/dist/adaptive/types.d.ts +62 -0
- package/dist/agents/config.d.ts +49 -0
- package/dist/agents/context.d.ts +46 -0
- package/dist/agents/idJag.d.ts +49 -0
- package/dist/agents/inMemoryStores.d.ts +4 -0
- package/dist/agents/index.d.ts +13 -0
- package/dist/agents/oauthGuide.d.ts +18 -0
- package/dist/agents/oidcAdapter.d.ts +20 -0
- package/dist/agents/postgresStores.d.ts +1176 -0
- package/dist/agents/principal.d.ts +4 -0
- package/dist/agents/registration.d.ts +162 -0
- package/dist/agents/registrationClient.d.ts +50 -0
- package/dist/agents/routes.d.ts +256 -0
- package/dist/agents/types.d.ts +129 -0
- package/dist/apikeys/config.d.ts +64 -0
- package/dist/apikeys/inMemoryStores.d.ts +4 -0
- package/dist/apikeys/postgresStores.d.ts +359 -0
- package/dist/apikeys/routes.d.ts +83 -0
- package/dist/apikeys/types.d.ts +53 -0
- package/dist/audit/config.d.ts +9 -0
- package/dist/audit/export.d.ts +2 -0
- package/dist/audit/inMemoryAuditStore.d.ts +2 -0
- package/dist/audit/integrity.d.ts +19 -0
- package/dist/audit/postgresAuditStore.d.ts +116 -0
- package/dist/audit/siem.d.ts +11 -0
- package/dist/audit/types.d.ts +21 -0
- package/dist/audit/wrap.d.ts +11 -0
- package/dist/authContext.d.ts +193 -0
- package/dist/authorization/config.d.ts +19 -0
- package/dist/authorization/protectPermission.d.ts +52 -0
- package/dist/cli/import/auth0.d.ts +2 -0
- package/dist/cli/import/clerk.d.ts +2 -0
- package/dist/cli/import/index.d.ts +10 -0
- package/dist/cli/import/lucia.d.ts +2 -0
- package/dist/cli/import/nextauth.d.ts +2 -0
- package/dist/cli/import/supabase.d.ts +2 -0
- package/dist/cli/import/types.d.ts +27 -0
- package/dist/cli/migrate.d.ts +2 -0
- package/dist/client/components/react/SignIn.d.ts +32 -0
- package/dist/client/components/react/SignUp.d.ts +29 -0
- package/dist/client/components/react/UserButton.d.ts +36 -0
- package/dist/client/createAuthClient.d.ts +285 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/passkeyHelpers.d.ts +19 -0
- package/dist/client/react.d.ts +87 -0
- package/dist/client/sessionExpiry.d.ts +37 -0
- package/dist/client/solid.d.ts +86 -0
- package/dist/client/svelte.d.ts +86 -0
- package/dist/client/vue.d.ts +88 -0
- package/dist/compliance/cipher.d.ts +11 -0
- package/dist/compliance/config.d.ts +18 -0
- package/dist/compliance/redaction.d.ts +8 -0
- package/dist/compliance/routes.d.ts +89 -0
- package/dist/constants.d.ts +10 -0
- package/dist/credentials/backgroundOps.d.ts +45 -0
- package/dist/credentials/config.d.ts +94 -0
- package/dist/credentials/emailValidation.d.ts +9 -0
- package/dist/credentials/emailVerification.d.ts +83 -0
- package/dist/credentials/import.d.ts +49 -0
- package/dist/credentials/inMemoryCredentialStore.d.ts +2 -0
- package/dist/credentials/legacyHashers.d.ts +3 -0
- package/dist/credentials/login.d.ts +76 -0
- package/dist/credentials/passwordPolicy.d.ts +15 -0
- package/dist/credentials/passwordReset.d.ts +87 -0
- package/dist/credentials/postgresCredentialStore.d.ts +235 -0
- package/dist/credentials/register.d.ts +54 -0
- package/dist/credentials/routes.d.ts +201 -0
- package/dist/credentials/types.d.ts +26 -0
- package/dist/crypto.d.ts +32 -0
- package/dist/csrf.d.ts +10 -0
- package/dist/errors.d.ts +12 -0
- package/dist/federation/tokenStore.d.ts +29 -0
- package/dist/fga/config.d.ts +53 -0
- package/dist/fga/inMemoryStores.d.ts +3 -0
- package/dist/fga/postgresStores.d.ts +116 -0
- package/dist/fga/redisCheckCache.d.ts +11 -0
- package/dist/fga/schema.d.ts +2 -0
- package/dist/fga/types.d.ts +28 -0
- package/dist/fingerprint-client/index.d.ts +26 -0
- package/dist/htmx/configuredRoutes.d.ts +542 -0
- package/dist/htmx/index.d.ts +2 -0
- package/dist/htmx/renderers.d.ts +8 -0
- package/dist/htmx/routes.d.ts +514 -0
- package/dist/htmx/types.d.ts +129 -0
- package/dist/index.d.ts +3647 -0
- package/dist/linkedProviders/inMemoryStores.d.ts +9 -0
- package/dist/linkedProviders/index.d.ts +3 -0
- package/dist/linkedProviders/neonStores.d.ts +484 -0
- package/dist/linkedProviders/oauthAccountResolver.d.ts +28 -0
- package/dist/linkedProviders/oauthResolver.d.ts +9 -0
- package/dist/linkedProviders/resolver.d.ts +22 -0
- package/dist/lockout/config.d.ts +17 -0
- package/dist/lockout/inMemoryLockoutStore.d.ts +2 -0
- package/dist/lockout/postgresLockoutStore.d.ts +71 -0
- package/dist/lockout/redisLockoutStore.d.ts +3 -0
- package/dist/lockout/types.d.ts +12 -0
- package/dist/manifest.d.ts +18 -0
- package/dist/manifest.json +373 -0
- package/dist/mfa/backupCodes.d.ts +5 -0
- package/dist/mfa/challenge.d.ts +72 -0
- package/dist/mfa/config.d.ts +59 -0
- package/dist/mfa/gate.d.ts +2 -0
- package/dist/mfa/inMemoryMfaStore.d.ts +2 -0
- package/dist/mfa/management.d.ts +106 -0
- package/dist/mfa/postgresMfaStore.d.ts +266 -0
- package/dist/mfa/recentAuth.d.ts +2 -0
- package/dist/mfa/rotation.d.ts +17 -0
- package/dist/mfa/routes.d.ts +239 -0
- package/dist/mfa/secret.d.ts +2 -0
- package/dist/mfa/sms.d.ts +143 -0
- package/dist/mfa/totp.d.ts +91 -0
- package/dist/mfa/types.d.ts +58 -0
- package/dist/migrations/generate.d.ts +2 -0
- package/dist/migrations/index.d.ts +6 -0
- package/dist/migrations/runner.d.ts +22 -0
- package/dist/migrations/types.d.ts +14 -0
- package/dist/oidc/clientAuth.d.ts +19 -0
- package/dist/oidc/clientIdMetadata.d.ts +28 -0
- package/dist/oidc/config.d.ts +307 -0
- package/dist/oidc/dpop.d.ts +23 -0
- package/dist/oidc/inMemoryStores.d.ts +11 -0
- package/dist/oidc/inMemoryVciStores.d.ts +3 -0
- package/dist/oidc/index.d.ts +12 -0
- package/dist/oidc/jar.d.ts +14 -0
- package/dist/oidc/keys.d.ts +50 -0
- package/dist/oidc/logout.d.ts +38 -0
- package/dist/oidc/mtls.d.ts +11 -0
- package/dist/oidc/operator.d.ts +14 -0
- package/dist/oidc/par.d.ts +28 -0
- package/dist/oidc/postgresStores.d.ts +1217 -0
- package/dist/oidc/registration.d.ts +138 -0
- package/dist/oidc/routes.d.ts +569 -0
- package/dist/oidc/types.d.ts +157 -0
- package/dist/oidc/userinfo.d.ts +21 -0
- package/dist/oidc/vci.d.ts +159 -0
- package/dist/oidc/vciRoutes.d.ts +92 -0
- package/dist/organizations/config.d.ts +46 -0
- package/dist/organizations/inMemoryOrganizationStore.d.ts +2 -0
- package/dist/organizations/operations.d.ts +39 -0
- package/dist/organizations/postgresOrganizationStore.d.ts +340 -0
- package/dist/organizations/routes.d.ts +299 -0
- package/dist/organizations/types.d.ts +45 -0
- package/dist/passwordless/config.d.ts +43 -0
- package/dist/passwordless/inMemoryPasswordlessTokenStore.d.ts +2 -0
- package/dist/passwordless/postgresPasswordlessTokenStore.d.ts +56 -0
- package/dist/passwordless/routes.d.ts +163 -0
- package/dist/passwordless/types.d.ts +9 -0
- package/dist/pluginIdentity.d.ts +2 -0
- package/dist/plugins/denyDisposableEmail.d.ts +7 -0
- package/dist/plugins/discordAlert.d.ts +7 -0
- package/dist/plugins/geoBlock.d.ts +8 -0
- package/dist/plugins/index.d.ts +12 -0
- package/dist/plugins/pagerdutyAlert.d.ts +9 -0
- package/dist/plugins/posthogIdentify.d.ts +7 -0
- package/dist/plugins/slackAlert.d.ts +7 -0
- package/dist/portal/config.d.ts +34 -0
- package/dist/portal/inMemorySetupSessionStore.d.ts +2 -0
- package/dist/portal/operations.d.ts +10 -0
- package/dist/portal/postgresSetupSessionStore.d.ts +116 -0
- package/dist/portal/routes.d.ts +160 -0
- package/dist/portal/types.d.ts +16 -0
- package/dist/providers/clients.d.ts +1831 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providersFromEnv.d.ts +19 -0
- package/dist/redirect.d.ts +2 -0
- package/dist/roles/config.d.ts +27 -0
- package/dist/roles/inMemoryRoleStore.d.ts +2 -0
- package/dist/roles/operations.d.ts +8 -0
- package/dist/roles/postgresRoleStore.d.ts +86 -0
- package/dist/roles/resolver.d.ts +17 -0
- package/dist/roles/routes.d.ts +106 -0
- package/dist/roles/types.d.ts +14 -0
- package/dist/routes/authorize.d.ts +102 -0
- package/dist/routes/callback.d.ts +64 -0
- package/dist/routes/profile.d.ts +73 -0
- package/dist/routes/protectRoute.d.ts +51 -0
- package/dist/routes/refresh.d.ts +74 -0
- package/dist/routes/requireAuth.d.ts +43 -0
- package/dist/routes/revoke.d.ts +73 -0
- package/dist/routes/sessions.d.ts +103 -0
- package/dist/routes/signout.d.ts +70 -0
- package/dist/routes/stepUp.d.ts +48 -0
- package/dist/routes/userStatus.d.ts +72 -0
- package/dist/saml.d.ts +1 -0
- package/dist/scim/config.d.ts +57 -0
- package/dist/scim/extensions.d.ts +30 -0
- package/dist/scim/inMemoryScimTokenStore.d.ts +2 -0
- package/dist/scim/postgresScimTokenStore.d.ts +86 -0
- package/dist/scim/routes.d.ts +366 -0
- package/dist/scim/serialize.d.ts +83 -0
- package/dist/scim/types.d.ts +54 -0
- package/dist/server.d.ts +34 -0
- package/dist/session/access.d.ts +33 -0
- package/dist/session/anonymous.d.ts +12 -0
- package/dist/session/cleanup.d.ts +45 -0
- package/dist/session/cookieReader.d.ts +10 -0
- package/dist/session/impersonation.d.ts +34 -0
- package/dist/session/inMemoryStore.d.ts +7 -0
- package/dist/session/multiSession.d.ts +27 -0
- package/dist/session/neonStore.d.ts +573 -0
- package/dist/session/promote.d.ts +23 -0
- package/dist/session/redisStore.d.ts +6 -0
- package/dist/session/sessionsConfig.d.ts +9 -0
- package/dist/session/state.d.ts +33 -0
- package/dist/session/types.d.ts +23 -0
- package/dist/session/userSessions.d.ts +19 -0
- package/dist/sso/config.d.ts +149 -0
- package/dist/sso/discoveryRoute.d.ts +63 -0
- package/dist/sso/inMemorySamlServiceProviderStore.d.ts +2 -0
- package/dist/sso/inMemorySsoConnectionStore.d.ts +2 -0
- package/dist/sso/nodeSamlAdapter.d.ts +8 -0
- package/dist/sso/oidcRoutes.d.ts +98 -0
- package/dist/sso/postgresSamlServiceProviderStore.d.ts +101 -0
- package/dist/sso/postgresSsoConnectionStore.d.ts +117 -0
- package/dist/sso/samlIdpRoutes.d.ts +139 -0
- package/dist/sso/samlRoutes.d.ts +179 -0
- package/dist/sso/types.d.ts +53 -0
- package/dist/stores/postgres.d.ts +5 -0
- package/dist/stores/redis.d.ts +5 -0
- package/dist/telemetry/tracing.d.ts +15 -0
- package/dist/tenancy.d.ts +9 -0
- package/dist/typeGuards.d.ts +6 -0
- package/dist/typebox.d.ts +4 -0
- package/dist/types.d.ts +431 -0
- package/dist/utils.d.ts +45 -0
- package/dist/vault/config.d.ts +20 -0
- package/dist/vault/inMemoryVaultStore.d.ts +2 -0
- package/dist/vault/index.d.ts +5 -0
- package/dist/vault/postgresVaultStore.d.ts +86 -0
- package/dist/vault/types.d.ts +14 -0
- package/dist/vc/inMemoryVpStores.d.ts +2 -0
- package/dist/vc/openid4vp.d.ts +82 -0
- package/dist/vc/postgresVcStores.d.ts +300 -0
- package/dist/vc/sdJwt.d.ts +37 -0
- package/dist/vc/statusList.d.ts +29 -0
- package/dist/vc/statusListRoutes.d.ts +63 -0
- package/dist/vc/vpRoutes.d.ts +120 -0
- package/dist/verification/types.d.ts +58 -0
- package/dist/webauthn/adapter.d.ts +59 -0
- package/dist/webauthn/config.d.ts +36 -0
- package/dist/webauthn/inMemoryWebAuthnCredentialStore.d.ts +2 -0
- package/dist/webauthn/postgresWebAuthnCredentialStore.d.ts +146 -0
- package/dist/webauthn/routes.d.ts +155 -0
- package/dist/webauthn/simpleWebAuthnAdapter.d.ts +3 -0
- package/dist/webauthn/types.d.ts +17 -0
- package/dist/webauthn.d.ts +1 -0
- package/dist/webhooks/config.d.ts +34 -0
- package/dist/webhooks/dispatcher.d.ts +3 -0
- package/dist/webhooks/inMemoryStore.d.ts +2 -0
- package/dist/webhooks/postgresStore.d.ts +116 -0
- package/dist/webhooks/sign.d.ts +11 -0
- package/dist/webhooks/types.d.ts +25 -0
- package/package.json +1 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type SigningKey } from '../oidc/keys';
|
|
2
|
+
export type PresentationResponseInput = {
|
|
3
|
+
requestId: string;
|
|
4
|
+
vpToken: string;
|
|
5
|
+
};
|
|
6
|
+
export type PresentationRequest = {
|
|
7
|
+
clientId: string;
|
|
8
|
+
createdAt: number;
|
|
9
|
+
expectedIssuerPublicJwk: JsonWebKey;
|
|
10
|
+
expiresAt: number;
|
|
11
|
+
nonce: string;
|
|
12
|
+
requestedClaims: string[];
|
|
13
|
+
requestId: string;
|
|
14
|
+
responseUri: string;
|
|
15
|
+
state: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
export type PresentationRequestStore = {
|
|
18
|
+
consumeRequest: (requestId: string) => Promise<PresentationRequest | undefined>;
|
|
19
|
+
getRequest: (requestId: string) => Promise<PresentationRequest | undefined>;
|
|
20
|
+
saveRequest: (request: PresentationRequest) => Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
export type Vp4Config = {
|
|
23
|
+
clientSigningKey: SigningKey;
|
|
24
|
+
defaultExpectedIssuerPublicJwk: JsonWebKey;
|
|
25
|
+
getResponseUri: (requestId: string) => string;
|
|
26
|
+
requestStore: PresentationRequestStore;
|
|
27
|
+
requestTtlMs?: number;
|
|
28
|
+
statusListResolver?: (uri: string) => Promise<string | undefined>;
|
|
29
|
+
statusListPublicJwk?: JsonWebKey;
|
|
30
|
+
};
|
|
31
|
+
export type CreatePresentationRequestInput = {
|
|
32
|
+
clientId: string;
|
|
33
|
+
now?: number;
|
|
34
|
+
requestedClaims: string[];
|
|
35
|
+
state?: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const createPresentationRequest: ({ config, getRequestUri, input, issuer }: {
|
|
38
|
+
config: Vp4Config;
|
|
39
|
+
getRequestUri: (requestId: string) => string;
|
|
40
|
+
input: CreatePresentationRequestInput;
|
|
41
|
+
issuer: string;
|
|
42
|
+
}) => Promise<{
|
|
43
|
+
nonce: string;
|
|
44
|
+
request: PresentationRequest;
|
|
45
|
+
requestObject: string;
|
|
46
|
+
requestUri: string;
|
|
47
|
+
}>;
|
|
48
|
+
export type VerifiedPresentation = {
|
|
49
|
+
disclosedClaims: Record<string, unknown>;
|
|
50
|
+
holderJwk: JsonWebKey | undefined;
|
|
51
|
+
missingClaims: string[];
|
|
52
|
+
protectedClaims: Record<string, unknown>;
|
|
53
|
+
requestId: string;
|
|
54
|
+
statusValid: boolean;
|
|
55
|
+
};
|
|
56
|
+
export type PresentationVerifyError = 'expired_request' | 'invalid_holder_binding' | 'invalid_signature' | 'missing_claims' | 'revoked_credential' | 'unknown_request';
|
|
57
|
+
export type PresentationVerifyResult = {
|
|
58
|
+
error: PresentationVerifyError;
|
|
59
|
+
ok: false;
|
|
60
|
+
} | {
|
|
61
|
+
ok: true;
|
|
62
|
+
verified: VerifiedPresentation;
|
|
63
|
+
};
|
|
64
|
+
export declare const verifyPresentationResponse: ({ config, input, now }: {
|
|
65
|
+
config: Vp4Config;
|
|
66
|
+
input: PresentationResponseInput;
|
|
67
|
+
now?: number;
|
|
68
|
+
}) => Promise<{
|
|
69
|
+
error: PresentationVerifyError;
|
|
70
|
+
ok: false;
|
|
71
|
+
} | {
|
|
72
|
+
ok: true;
|
|
73
|
+
verified: VerifiedPresentation;
|
|
74
|
+
}>;
|
|
75
|
+
export declare const buildHolderKeyBindingJwt: ({ audience, holderKey, nonce, now, sdHash }: {
|
|
76
|
+
audience: string;
|
|
77
|
+
holderKey: SigningKey;
|
|
78
|
+
nonce: string;
|
|
79
|
+
now?: number;
|
|
80
|
+
sdHash?: string;
|
|
81
|
+
}) => Promise<string>;
|
|
82
|
+
export declare const parsePresentationToken: (vpToken: string) => import("./sdJwt").ParsedSdJwtVc;
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { type AnyPgDatabase } from '../stores/postgres';
|
|
2
|
+
import type { CredentialNonceStore, CredentialOfferStore } from '../oidc/vci';
|
|
3
|
+
import type { PresentationRequestStore } from './openid4vp';
|
|
4
|
+
export declare const vcCredentialNoncesTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
5
|
+
name: "auth_vc_credential_nonces";
|
|
6
|
+
schema: undefined;
|
|
7
|
+
columns: {
|
|
8
|
+
expires_at_ms: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_credential_nonces", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBigInt53Builder>, {
|
|
9
|
+
name: string;
|
|
10
|
+
tableName: "auth_vc_credential_nonces";
|
|
11
|
+
dataType: "number int53";
|
|
12
|
+
data: number;
|
|
13
|
+
driverParam: string | number;
|
|
14
|
+
notNull: true;
|
|
15
|
+
hasDefault: false;
|
|
16
|
+
isPrimaryKey: false;
|
|
17
|
+
isAutoincrement: false;
|
|
18
|
+
hasRuntimeDefault: false;
|
|
19
|
+
enumValues: undefined;
|
|
20
|
+
identity: undefined;
|
|
21
|
+
generated: undefined;
|
|
22
|
+
}>;
|
|
23
|
+
nonce_hash: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_credential_nonces", import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
24
|
+
name: string;
|
|
25
|
+
tableName: "auth_vc_credential_nonces";
|
|
26
|
+
dataType: "string";
|
|
27
|
+
data: string;
|
|
28
|
+
driverParam: string;
|
|
29
|
+
notNull: true;
|
|
30
|
+
hasDefault: false;
|
|
31
|
+
isPrimaryKey: false;
|
|
32
|
+
isAutoincrement: false;
|
|
33
|
+
hasRuntimeDefault: false;
|
|
34
|
+
enumValues: undefined;
|
|
35
|
+
identity: undefined;
|
|
36
|
+
generated: undefined;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
dialect: "pg";
|
|
40
|
+
}>;
|
|
41
|
+
export declare const vcCredentialOffersTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
42
|
+
name: "auth_vc_credential_offers";
|
|
43
|
+
schema: undefined;
|
|
44
|
+
columns: {
|
|
45
|
+
client_id: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_credential_offers", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
46
|
+
name: string;
|
|
47
|
+
tableName: "auth_vc_credential_offers";
|
|
48
|
+
dataType: "string";
|
|
49
|
+
data: string;
|
|
50
|
+
driverParam: string;
|
|
51
|
+
notNull: true;
|
|
52
|
+
hasDefault: false;
|
|
53
|
+
isPrimaryKey: false;
|
|
54
|
+
isAutoincrement: false;
|
|
55
|
+
hasRuntimeDefault: false;
|
|
56
|
+
enumValues: undefined;
|
|
57
|
+
identity: undefined;
|
|
58
|
+
generated: undefined;
|
|
59
|
+
}>;
|
|
60
|
+
configuration_id: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_credential_offers", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
61
|
+
name: string;
|
|
62
|
+
tableName: "auth_vc_credential_offers";
|
|
63
|
+
dataType: "string";
|
|
64
|
+
data: string;
|
|
65
|
+
driverParam: string;
|
|
66
|
+
notNull: true;
|
|
67
|
+
hasDefault: false;
|
|
68
|
+
isPrimaryKey: false;
|
|
69
|
+
isAutoincrement: false;
|
|
70
|
+
hasRuntimeDefault: false;
|
|
71
|
+
enumValues: undefined;
|
|
72
|
+
identity: undefined;
|
|
73
|
+
generated: undefined;
|
|
74
|
+
}>;
|
|
75
|
+
created_at_ms: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_credential_offers", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBigInt53Builder>, {
|
|
76
|
+
name: string;
|
|
77
|
+
tableName: "auth_vc_credential_offers";
|
|
78
|
+
dataType: "number int53";
|
|
79
|
+
data: number;
|
|
80
|
+
driverParam: string | number;
|
|
81
|
+
notNull: true;
|
|
82
|
+
hasDefault: false;
|
|
83
|
+
isPrimaryKey: false;
|
|
84
|
+
isAutoincrement: false;
|
|
85
|
+
hasRuntimeDefault: false;
|
|
86
|
+
enumValues: undefined;
|
|
87
|
+
identity: undefined;
|
|
88
|
+
generated: undefined;
|
|
89
|
+
}>;
|
|
90
|
+
expires_at_ms: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_credential_offers", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBigInt53Builder>, {
|
|
91
|
+
name: string;
|
|
92
|
+
tableName: "auth_vc_credential_offers";
|
|
93
|
+
dataType: "number int53";
|
|
94
|
+
data: number;
|
|
95
|
+
driverParam: string | number;
|
|
96
|
+
notNull: true;
|
|
97
|
+
hasDefault: false;
|
|
98
|
+
isPrimaryKey: false;
|
|
99
|
+
isAutoincrement: false;
|
|
100
|
+
hasRuntimeDefault: false;
|
|
101
|
+
enumValues: undefined;
|
|
102
|
+
identity: undefined;
|
|
103
|
+
generated: undefined;
|
|
104
|
+
}>;
|
|
105
|
+
pre_authorized_code_hash: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_credential_offers", import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
106
|
+
name: string;
|
|
107
|
+
tableName: "auth_vc_credential_offers";
|
|
108
|
+
dataType: "string";
|
|
109
|
+
data: string;
|
|
110
|
+
driverParam: string;
|
|
111
|
+
notNull: true;
|
|
112
|
+
hasDefault: false;
|
|
113
|
+
isPrimaryKey: false;
|
|
114
|
+
isAutoincrement: false;
|
|
115
|
+
hasRuntimeDefault: false;
|
|
116
|
+
enumValues: undefined;
|
|
117
|
+
identity: undefined;
|
|
118
|
+
generated: undefined;
|
|
119
|
+
}>;
|
|
120
|
+
redeemed: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_credential_offers", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBooleanBuilder>, {
|
|
121
|
+
name: string;
|
|
122
|
+
tableName: "auth_vc_credential_offers";
|
|
123
|
+
dataType: "boolean";
|
|
124
|
+
data: boolean;
|
|
125
|
+
driverParam: boolean;
|
|
126
|
+
notNull: true;
|
|
127
|
+
hasDefault: false;
|
|
128
|
+
isPrimaryKey: false;
|
|
129
|
+
isAutoincrement: false;
|
|
130
|
+
hasRuntimeDefault: false;
|
|
131
|
+
enumValues: undefined;
|
|
132
|
+
identity: undefined;
|
|
133
|
+
generated: undefined;
|
|
134
|
+
}>;
|
|
135
|
+
user_id: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_credential_offers", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
136
|
+
name: string;
|
|
137
|
+
tableName: "auth_vc_credential_offers";
|
|
138
|
+
dataType: "string";
|
|
139
|
+
data: string;
|
|
140
|
+
driverParam: string;
|
|
141
|
+
notNull: true;
|
|
142
|
+
hasDefault: false;
|
|
143
|
+
isPrimaryKey: false;
|
|
144
|
+
isAutoincrement: false;
|
|
145
|
+
hasRuntimeDefault: false;
|
|
146
|
+
enumValues: undefined;
|
|
147
|
+
identity: undefined;
|
|
148
|
+
generated: undefined;
|
|
149
|
+
}>;
|
|
150
|
+
};
|
|
151
|
+
dialect: "pg";
|
|
152
|
+
}>;
|
|
153
|
+
export declare const vcPresentationRequestsTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
154
|
+
name: "auth_vc_presentation_requests";
|
|
155
|
+
schema: undefined;
|
|
156
|
+
columns: {
|
|
157
|
+
client_id: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_presentation_requests", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
158
|
+
name: string;
|
|
159
|
+
tableName: "auth_vc_presentation_requests";
|
|
160
|
+
dataType: "string";
|
|
161
|
+
data: string;
|
|
162
|
+
driverParam: string;
|
|
163
|
+
notNull: true;
|
|
164
|
+
hasDefault: false;
|
|
165
|
+
isPrimaryKey: false;
|
|
166
|
+
isAutoincrement: false;
|
|
167
|
+
hasRuntimeDefault: false;
|
|
168
|
+
enumValues: undefined;
|
|
169
|
+
identity: undefined;
|
|
170
|
+
generated: undefined;
|
|
171
|
+
}>;
|
|
172
|
+
created_at_ms: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_presentation_requests", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBigInt53Builder>, {
|
|
173
|
+
name: string;
|
|
174
|
+
tableName: "auth_vc_presentation_requests";
|
|
175
|
+
dataType: "number int53";
|
|
176
|
+
data: number;
|
|
177
|
+
driverParam: string | number;
|
|
178
|
+
notNull: true;
|
|
179
|
+
hasDefault: false;
|
|
180
|
+
isPrimaryKey: false;
|
|
181
|
+
isAutoincrement: false;
|
|
182
|
+
hasRuntimeDefault: false;
|
|
183
|
+
enumValues: undefined;
|
|
184
|
+
identity: undefined;
|
|
185
|
+
generated: undefined;
|
|
186
|
+
}>;
|
|
187
|
+
expected_issuer_jwk_json: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_presentation_requests", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, JsonWebKey>>, {
|
|
188
|
+
name: string;
|
|
189
|
+
tableName: "auth_vc_presentation_requests";
|
|
190
|
+
dataType: "object json";
|
|
191
|
+
data: JsonWebKey;
|
|
192
|
+
driverParam: unknown;
|
|
193
|
+
notNull: true;
|
|
194
|
+
hasDefault: false;
|
|
195
|
+
isPrimaryKey: false;
|
|
196
|
+
isAutoincrement: false;
|
|
197
|
+
hasRuntimeDefault: false;
|
|
198
|
+
enumValues: undefined;
|
|
199
|
+
identity: undefined;
|
|
200
|
+
generated: undefined;
|
|
201
|
+
}>;
|
|
202
|
+
expires_at_ms: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_presentation_requests", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBigInt53Builder>, {
|
|
203
|
+
name: string;
|
|
204
|
+
tableName: "auth_vc_presentation_requests";
|
|
205
|
+
dataType: "number int53";
|
|
206
|
+
data: number;
|
|
207
|
+
driverParam: string | number;
|
|
208
|
+
notNull: true;
|
|
209
|
+
hasDefault: false;
|
|
210
|
+
isPrimaryKey: false;
|
|
211
|
+
isAutoincrement: false;
|
|
212
|
+
hasRuntimeDefault: false;
|
|
213
|
+
enumValues: undefined;
|
|
214
|
+
identity: undefined;
|
|
215
|
+
generated: undefined;
|
|
216
|
+
}>;
|
|
217
|
+
nonce: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_presentation_requests", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
218
|
+
name: string;
|
|
219
|
+
tableName: "auth_vc_presentation_requests";
|
|
220
|
+
dataType: "string";
|
|
221
|
+
data: string;
|
|
222
|
+
driverParam: string;
|
|
223
|
+
notNull: true;
|
|
224
|
+
hasDefault: false;
|
|
225
|
+
isPrimaryKey: false;
|
|
226
|
+
isAutoincrement: false;
|
|
227
|
+
hasRuntimeDefault: false;
|
|
228
|
+
enumValues: undefined;
|
|
229
|
+
identity: undefined;
|
|
230
|
+
generated: undefined;
|
|
231
|
+
}>;
|
|
232
|
+
request_id: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_presentation_requests", import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
233
|
+
name: string;
|
|
234
|
+
tableName: "auth_vc_presentation_requests";
|
|
235
|
+
dataType: "string";
|
|
236
|
+
data: string;
|
|
237
|
+
driverParam: string;
|
|
238
|
+
notNull: true;
|
|
239
|
+
hasDefault: false;
|
|
240
|
+
isPrimaryKey: false;
|
|
241
|
+
isAutoincrement: false;
|
|
242
|
+
hasRuntimeDefault: false;
|
|
243
|
+
enumValues: undefined;
|
|
244
|
+
identity: undefined;
|
|
245
|
+
generated: undefined;
|
|
246
|
+
}>;
|
|
247
|
+
requested_claims: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_presentation_requests", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, string[]>>, {
|
|
248
|
+
name: string;
|
|
249
|
+
tableName: "auth_vc_presentation_requests";
|
|
250
|
+
dataType: "object json";
|
|
251
|
+
data: string[];
|
|
252
|
+
driverParam: unknown;
|
|
253
|
+
notNull: true;
|
|
254
|
+
hasDefault: false;
|
|
255
|
+
isPrimaryKey: false;
|
|
256
|
+
isAutoincrement: false;
|
|
257
|
+
hasRuntimeDefault: false;
|
|
258
|
+
enumValues: undefined;
|
|
259
|
+
identity: undefined;
|
|
260
|
+
generated: undefined;
|
|
261
|
+
}>;
|
|
262
|
+
response_uri: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_presentation_requests", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
263
|
+
name: string;
|
|
264
|
+
tableName: "auth_vc_presentation_requests";
|
|
265
|
+
dataType: "string";
|
|
266
|
+
data: string;
|
|
267
|
+
driverParam: string;
|
|
268
|
+
notNull: true;
|
|
269
|
+
hasDefault: false;
|
|
270
|
+
isPrimaryKey: false;
|
|
271
|
+
isAutoincrement: false;
|
|
272
|
+
hasRuntimeDefault: false;
|
|
273
|
+
enumValues: undefined;
|
|
274
|
+
identity: undefined;
|
|
275
|
+
generated: undefined;
|
|
276
|
+
}>;
|
|
277
|
+
state: import("drizzle-orm/pg-core").PgBuildColumn<"auth_vc_presentation_requests", import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>, {
|
|
278
|
+
name: string;
|
|
279
|
+
tableName: "auth_vc_presentation_requests";
|
|
280
|
+
dataType: "string";
|
|
281
|
+
data: string;
|
|
282
|
+
driverParam: string;
|
|
283
|
+
notNull: false;
|
|
284
|
+
hasDefault: false;
|
|
285
|
+
isPrimaryKey: false;
|
|
286
|
+
isAutoincrement: false;
|
|
287
|
+
hasRuntimeDefault: false;
|
|
288
|
+
enumValues: undefined;
|
|
289
|
+
identity: undefined;
|
|
290
|
+
generated: undefined;
|
|
291
|
+
}>;
|
|
292
|
+
};
|
|
293
|
+
dialect: "pg";
|
|
294
|
+
}>;
|
|
295
|
+
export declare const createNeonCredentialNonceStore: (databaseUrl: string) => CredentialNonceStore;
|
|
296
|
+
export declare const createNeonCredentialOfferStore: (databaseUrl: string) => CredentialOfferStore;
|
|
297
|
+
export declare const createNeonPresentationRequestStore: (databaseUrl: string) => PresentationRequestStore;
|
|
298
|
+
export declare const createPostgresCredentialNonceStore: <DB extends AnyPgDatabase>(database: DB) => CredentialNonceStore;
|
|
299
|
+
export declare const createPostgresCredentialOfferStore: <DB extends AnyPgDatabase>(database: DB) => CredentialOfferStore;
|
|
300
|
+
export declare const createPostgresPresentationRequestStore: <DB extends AnyPgDatabase>(database: DB) => PresentationRequestStore;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type SigningKey } from '../oidc/keys';
|
|
2
|
+
declare const toBase64Url: (bytes: ArrayBuffer | Uint8Array) => string;
|
|
3
|
+
declare const fromBase64Url: (value: string) => Uint8Array<ArrayBuffer>;
|
|
4
|
+
export type SdDisclosure = {
|
|
5
|
+
claimName: string;
|
|
6
|
+
claimValue: unknown;
|
|
7
|
+
encoded: string;
|
|
8
|
+
salt: string;
|
|
9
|
+
};
|
|
10
|
+
export type SdJwtVcIssueInput = {
|
|
11
|
+
base: Record<string, unknown>;
|
|
12
|
+
holderJwk?: JsonWebKey;
|
|
13
|
+
selective: Record<string, unknown>;
|
|
14
|
+
signingKey: SigningKey;
|
|
15
|
+
};
|
|
16
|
+
export declare const issueSdJwtVc: (input: SdJwtVcIssueInput) => Promise<string>;
|
|
17
|
+
export type ParsedSdJwtVc = {
|
|
18
|
+
disclosures: string[];
|
|
19
|
+
jwt: string;
|
|
20
|
+
keyBindingJwt: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
export declare const parseSdJwtVc: (token: string) => ParsedSdJwtVc;
|
|
23
|
+
export declare const presentSdJwtVc: (parsed: ParsedSdJwtVc, selectedClaims: string[], keyBindingJwt?: string) => string;
|
|
24
|
+
export type VerifiedSdJwtVc = {
|
|
25
|
+
cnf: {
|
|
26
|
+
jwk: JsonWebKey;
|
|
27
|
+
} | undefined;
|
|
28
|
+
disclosedClaims: Record<string, unknown>;
|
|
29
|
+
keyBindingJwt: string | undefined;
|
|
30
|
+
protectedClaims: Record<string, unknown>;
|
|
31
|
+
};
|
|
32
|
+
export type SdJwtVcVerifyInput = {
|
|
33
|
+
issuerPublicJwk: JsonWebKey;
|
|
34
|
+
token: string;
|
|
35
|
+
};
|
|
36
|
+
export declare const verifySdJwtVc: (input: SdJwtVcVerifyInput) => Promise<VerifiedSdJwtVc | undefined>;
|
|
37
|
+
export { fromBase64Url, toBase64Url };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type SigningKey } from '../oidc/keys';
|
|
2
|
+
declare const STATUS_LIST_TYP = "statuslist+jwt";
|
|
3
|
+
declare const STATUS_LIST_SUB_TYP = "application/statuslist+jwt";
|
|
4
|
+
export type StatusListBits = Uint8Array;
|
|
5
|
+
export declare const createStatusList: (size?: number) => Uint8Array<ArrayBuffer>;
|
|
6
|
+
export declare const getCredentialStatus: (bits: StatusListBits, idx: number) => 1 | 0 | undefined;
|
|
7
|
+
export declare const setCredentialStatus: (bits: StatusListBits, idx: number, value: 0 | 1) => StatusListBits;
|
|
8
|
+
export declare const buildStatusClaim: (idx: number, uri: string) => {
|
|
9
|
+
status_list: {
|
|
10
|
+
idx: number;
|
|
11
|
+
uri: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const signStatusList: ({ bits, issuer, listUri, now, signingKey, ttlSeconds }: {
|
|
15
|
+
bits: StatusListBits;
|
|
16
|
+
issuer: string;
|
|
17
|
+
listUri: string;
|
|
18
|
+
now?: number;
|
|
19
|
+
signingKey: SigningKey;
|
|
20
|
+
ttlSeconds?: number;
|
|
21
|
+
}) => Promise<string>;
|
|
22
|
+
export declare const verifyStatusListJwt: ({ issuerPublicJwk, token }: {
|
|
23
|
+
issuerPublicJwk: JsonWebKey;
|
|
24
|
+
token: string;
|
|
25
|
+
}) => Promise<{
|
|
26
|
+
bits: Uint8Array<ArrayBuffer>;
|
|
27
|
+
sub: string | undefined;
|
|
28
|
+
} | undefined>;
|
|
29
|
+
export { STATUS_LIST_SUB_TYP, STATUS_LIST_TYP };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import type { SigningKey } from '../oidc/keys';
|
|
3
|
+
import { type StatusListBits } from './statusList';
|
|
4
|
+
export declare const DEFAULT_STATUS_ROUTE = "/vc/status";
|
|
5
|
+
export declare const statusListRoutes: ({ getStatusList, issuerUrl, signingKey, statusRoute, ttlSeconds }: {
|
|
6
|
+
getStatusList: (listId: string) => Promise<StatusListBits | undefined> | StatusListBits | undefined;
|
|
7
|
+
issuerUrl: string;
|
|
8
|
+
signingKey: SigningKey;
|
|
9
|
+
statusRoute?: string;
|
|
10
|
+
ttlSeconds?: number;
|
|
11
|
+
}) => Elysia<"", {
|
|
12
|
+
decorator: {};
|
|
13
|
+
store: {};
|
|
14
|
+
derive: {};
|
|
15
|
+
resolve: {};
|
|
16
|
+
}, {
|
|
17
|
+
typebox: {};
|
|
18
|
+
error: {};
|
|
19
|
+
}, {
|
|
20
|
+
schema: {};
|
|
21
|
+
standaloneSchema: {};
|
|
22
|
+
macro: {};
|
|
23
|
+
macroFn: {};
|
|
24
|
+
parser: {};
|
|
25
|
+
response: {};
|
|
26
|
+
}, {
|
|
27
|
+
[x: string]: {
|
|
28
|
+
":listId": {
|
|
29
|
+
get: {
|
|
30
|
+
body: unknown;
|
|
31
|
+
params: {
|
|
32
|
+
listId: string;
|
|
33
|
+
};
|
|
34
|
+
query: unknown;
|
|
35
|
+
headers: unknown;
|
|
36
|
+
response: {
|
|
37
|
+
200: Response;
|
|
38
|
+
422: {
|
|
39
|
+
type: "validation";
|
|
40
|
+
on: string;
|
|
41
|
+
summary?: string;
|
|
42
|
+
message?: string;
|
|
43
|
+
found?: unknown;
|
|
44
|
+
property?: string;
|
|
45
|
+
expected?: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}, {
|
|
52
|
+
derive: {};
|
|
53
|
+
resolve: {};
|
|
54
|
+
schema: {};
|
|
55
|
+
standaloneSchema: {};
|
|
56
|
+
response: {};
|
|
57
|
+
}, {
|
|
58
|
+
derive: {};
|
|
59
|
+
resolve: {};
|
|
60
|
+
schema: {};
|
|
61
|
+
standaloneSchema: {};
|
|
62
|
+
response: {};
|
|
63
|
+
}>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import { type VerifiedPresentation, type Vp4Config } from './openid4vp';
|
|
3
|
+
export declare const DEFAULT_VP_ROUTE = "/vp";
|
|
4
|
+
export declare const vpRoutes: ({ defaultClientId, issuerUrl, onVerifiedPresentation, vpConfig, vpRoute }: {
|
|
5
|
+
defaultClientId: string;
|
|
6
|
+
issuerUrl: string;
|
|
7
|
+
onVerifiedPresentation?: (context: {
|
|
8
|
+
verified: VerifiedPresentation;
|
|
9
|
+
}) => Promise<void> | void;
|
|
10
|
+
vpConfig: Vp4Config;
|
|
11
|
+
vpRoute?: string;
|
|
12
|
+
}) => Elysia<"", {
|
|
13
|
+
decorator: {};
|
|
14
|
+
store: {};
|
|
15
|
+
derive: {};
|
|
16
|
+
resolve: {};
|
|
17
|
+
}, {
|
|
18
|
+
typebox: {};
|
|
19
|
+
error: {};
|
|
20
|
+
}, {
|
|
21
|
+
schema: {};
|
|
22
|
+
standaloneSchema: {};
|
|
23
|
+
macro: {};
|
|
24
|
+
macroFn: {};
|
|
25
|
+
parser: {};
|
|
26
|
+
response: {};
|
|
27
|
+
}, {
|
|
28
|
+
[x: string]: {
|
|
29
|
+
authorize: {
|
|
30
|
+
post: {
|
|
31
|
+
body: {
|
|
32
|
+
client_id?: string | undefined;
|
|
33
|
+
state?: string | undefined;
|
|
34
|
+
requested_claims: string[];
|
|
35
|
+
};
|
|
36
|
+
params: {};
|
|
37
|
+
query: unknown;
|
|
38
|
+
headers: unknown;
|
|
39
|
+
response: {
|
|
40
|
+
200: Response;
|
|
41
|
+
422: {
|
|
42
|
+
type: "validation";
|
|
43
|
+
on: string;
|
|
44
|
+
summary?: string;
|
|
45
|
+
message?: string;
|
|
46
|
+
found?: unknown;
|
|
47
|
+
property?: string;
|
|
48
|
+
expected?: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
} & {
|
|
55
|
+
[x: string]: {
|
|
56
|
+
request: {
|
|
57
|
+
":id": {
|
|
58
|
+
get: {
|
|
59
|
+
body: unknown;
|
|
60
|
+
params: {
|
|
61
|
+
id: string;
|
|
62
|
+
};
|
|
63
|
+
query: unknown;
|
|
64
|
+
headers: unknown;
|
|
65
|
+
response: {
|
|
66
|
+
200: Response;
|
|
67
|
+
422: {
|
|
68
|
+
type: "validation";
|
|
69
|
+
on: string;
|
|
70
|
+
summary?: string;
|
|
71
|
+
message?: string;
|
|
72
|
+
found?: unknown;
|
|
73
|
+
property?: string;
|
|
74
|
+
expected?: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
} & {
|
|
82
|
+
[x: string]: {
|
|
83
|
+
response: {
|
|
84
|
+
post: {
|
|
85
|
+
body: {
|
|
86
|
+
state?: string | undefined;
|
|
87
|
+
presentation_submission?: unknown;
|
|
88
|
+
vp_token: string;
|
|
89
|
+
};
|
|
90
|
+
params: {};
|
|
91
|
+
query: unknown;
|
|
92
|
+
headers: unknown;
|
|
93
|
+
response: {
|
|
94
|
+
200: Response;
|
|
95
|
+
422: {
|
|
96
|
+
type: "validation";
|
|
97
|
+
on: string;
|
|
98
|
+
summary?: string;
|
|
99
|
+
message?: string;
|
|
100
|
+
found?: unknown;
|
|
101
|
+
property?: string;
|
|
102
|
+
expected?: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
}, {
|
|
109
|
+
derive: {};
|
|
110
|
+
resolve: {};
|
|
111
|
+
schema: {};
|
|
112
|
+
standaloneSchema: {};
|
|
113
|
+
response: {};
|
|
114
|
+
}, {
|
|
115
|
+
derive: {};
|
|
116
|
+
resolve: {};
|
|
117
|
+
schema: {};
|
|
118
|
+
standaloneSchema: {};
|
|
119
|
+
response: {};
|
|
120
|
+
}>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Stable purposes let providers apply separate templates, limits, and audit policy. */
|
|
2
|
+
export type VerificationPurpose = 'account_recovery' | 'mfa_challenge' | 'mfa_enrollment' | 'phone_change' | 'phone_signup' | 'step_up';
|
|
3
|
+
export type VerificationChannel = 'call' | 'sms' | 'whatsapp';
|
|
4
|
+
export type VerificationStartInput = {
|
|
5
|
+
channel: VerificationChannel;
|
|
6
|
+
/** Optional BCP-47 locale used for provider-managed message copy. */
|
|
7
|
+
locale?: string;
|
|
8
|
+
purpose: VerificationPurpose;
|
|
9
|
+
/** Provider-specific, non-secret rate-limit buckets (for example an IP hash). */
|
|
10
|
+
rateLimits?: Readonly<Record<string, string>>;
|
|
11
|
+
/** Stable application subject. Providers must not include it in message text. */
|
|
12
|
+
subject: string;
|
|
13
|
+
/** E.164 destination. */
|
|
14
|
+
to: string;
|
|
15
|
+
/** Stable tenant key used only for provider/service routing. */
|
|
16
|
+
tenant?: string;
|
|
17
|
+
};
|
|
18
|
+
export type VerificationStartResult = {
|
|
19
|
+
/** Provider reference safe for audit correlation (for example, a Twilio VE SID). */
|
|
20
|
+
reference: string;
|
|
21
|
+
/** Provider-authoritative expiry. Auth rejects checks after this time. */
|
|
22
|
+
expiresAt: number;
|
|
23
|
+
};
|
|
24
|
+
export type VerificationCheckStatus = 'approved' | 'canceled' | 'expired' | 'failed' | 'max_attempts_reached' | 'pending';
|
|
25
|
+
export type VerificationCheckInput = VerificationStartInput & {
|
|
26
|
+
code: string;
|
|
27
|
+
/** Exact challenge reference returned by start(). */
|
|
28
|
+
reference: string;
|
|
29
|
+
};
|
|
30
|
+
export type VerificationCancelInput = VerificationStartInput & {
|
|
31
|
+
reference: string;
|
|
32
|
+
};
|
|
33
|
+
export type VerificationCheckResult = {
|
|
34
|
+
reference?: string;
|
|
35
|
+
status: VerificationCheckStatus;
|
|
36
|
+
};
|
|
37
|
+
export type VerificationProviderErrorKind = 'invalid_destination' | 'rate_limited' | 'unavailable';
|
|
38
|
+
/** Normalized operational failures that auth routes can map safely to HTTP. */
|
|
39
|
+
export declare class VerificationProviderError extends Error {
|
|
40
|
+
readonly kind: VerificationProviderErrorKind;
|
|
41
|
+
readonly provider: string;
|
|
42
|
+
constructor(input: {
|
|
43
|
+
cause?: unknown;
|
|
44
|
+
kind: VerificationProviderErrorKind;
|
|
45
|
+
message: string;
|
|
46
|
+
provider: string;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Provider-owned out-of-band challenge lifecycle. Implementations generate,
|
|
51
|
+
* deliver, rate-limit, and check codes; auth owns enrollment and session policy.
|
|
52
|
+
*/
|
|
53
|
+
export type VerificationProvider = {
|
|
54
|
+
readonly name: string;
|
|
55
|
+
cancel: (input: VerificationCancelInput) => Promise<void>;
|
|
56
|
+
check: (input: VerificationCheckInput) => Promise<VerificationCheckResult>;
|
|
57
|
+
start: (input: VerificationStartInput) => Promise<VerificationStartResult>;
|
|
58
|
+
};
|