@absolutejs/auth 0.65.1 → 0.65.3

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.
Files changed (265) hide show
  1. package/dist/abuse/captcha.d.ts +11 -0
  2. package/dist/abuse/config.d.ts +29 -0
  3. package/dist/actions.d.ts +27 -0
  4. package/dist/adaptive/config.d.ts +34 -0
  5. package/dist/adaptive/fingerprint.d.ts +2 -0
  6. package/dist/adaptive/inMemoryStores.d.ts +3 -0
  7. package/dist/adaptive/postgresStores.d.ts +245 -0
  8. package/dist/adaptive/types.d.ts +62 -0
  9. package/dist/agents/config.d.ts +49 -0
  10. package/dist/agents/context.d.ts +46 -0
  11. package/dist/agents/idJag.d.ts +49 -0
  12. package/dist/agents/inMemoryStores.d.ts +4 -0
  13. package/dist/agents/index.d.ts +13 -0
  14. package/dist/agents/oauthGuide.d.ts +18 -0
  15. package/dist/agents/oidcAdapter.d.ts +20 -0
  16. package/dist/agents/postgresStores.d.ts +1176 -0
  17. package/dist/agents/principal.d.ts +4 -0
  18. package/dist/agents/registration.d.ts +162 -0
  19. package/dist/agents/registrationClient.d.ts +50 -0
  20. package/dist/agents/routes.d.ts +256 -0
  21. package/dist/agents/types.d.ts +129 -0
  22. package/dist/apikeys/config.d.ts +64 -0
  23. package/dist/apikeys/inMemoryStores.d.ts +4 -0
  24. package/dist/apikeys/postgresStores.d.ts +359 -0
  25. package/dist/apikeys/routes.d.ts +83 -0
  26. package/dist/apikeys/types.d.ts +53 -0
  27. package/dist/audit/config.d.ts +9 -0
  28. package/dist/audit/export.d.ts +2 -0
  29. package/dist/audit/inMemoryAuditStore.d.ts +2 -0
  30. package/dist/audit/integrity.d.ts +19 -0
  31. package/dist/audit/postgresAuditStore.d.ts +116 -0
  32. package/dist/audit/siem.d.ts +11 -0
  33. package/dist/audit/types.d.ts +21 -0
  34. package/dist/audit/wrap.d.ts +11 -0
  35. package/dist/authContext.d.ts +193 -0
  36. package/dist/authorization/config.d.ts +19 -0
  37. package/dist/authorization/protectPermission.d.ts +52 -0
  38. package/dist/cli/import/auth0.d.ts +2 -0
  39. package/dist/cli/import/clerk.d.ts +2 -0
  40. package/dist/cli/import/index.d.ts +10 -0
  41. package/dist/cli/import/lucia.d.ts +2 -0
  42. package/dist/cli/import/nextauth.d.ts +2 -0
  43. package/dist/cli/import/supabase.d.ts +2 -0
  44. package/dist/cli/import/types.d.ts +27 -0
  45. package/dist/cli/migrate.d.ts +2 -0
  46. package/dist/cli/migrate.js.map +2 -2
  47. package/dist/client/components/react/SignIn.d.ts +32 -0
  48. package/dist/client/components/react/SignUp.d.ts +29 -0
  49. package/dist/client/components/react/UserButton.d.ts +36 -0
  50. package/dist/client/createAuthClient.d.ts +285 -0
  51. package/dist/client/index.d.ts +4 -0
  52. package/dist/client/passkeyHelpers.d.ts +19 -0
  53. package/dist/client/react.d.ts +87 -0
  54. package/dist/client/sessionExpiry.d.ts +37 -0
  55. package/dist/client/solid.d.ts +86 -0
  56. package/dist/client/svelte.d.ts +86 -0
  57. package/dist/client/vue.d.ts +88 -0
  58. package/dist/compliance/cipher.d.ts +11 -0
  59. package/dist/compliance/config.d.ts +18 -0
  60. package/dist/compliance/redaction.d.ts +8 -0
  61. package/dist/compliance/routes.d.ts +89 -0
  62. package/dist/constants.d.ts +10 -0
  63. package/dist/credentials/backgroundOps.d.ts +45 -0
  64. package/dist/credentials/config.d.ts +94 -0
  65. package/dist/credentials/emailValidation.d.ts +9 -0
  66. package/dist/credentials/emailVerification.d.ts +83 -0
  67. package/dist/credentials/import.d.ts +49 -0
  68. package/dist/credentials/inMemoryCredentialStore.d.ts +2 -0
  69. package/dist/credentials/legacyHashers.d.ts +3 -0
  70. package/dist/credentials/login.d.ts +76 -0
  71. package/dist/credentials/passwordPolicy.d.ts +15 -0
  72. package/dist/credentials/passwordReset.d.ts +87 -0
  73. package/dist/credentials/postgresCredentialStore.d.ts +235 -0
  74. package/dist/credentials/register.d.ts +54 -0
  75. package/dist/credentials/routes.d.ts +201 -0
  76. package/dist/credentials/types.d.ts +26 -0
  77. package/dist/crypto.d.ts +32 -0
  78. package/dist/csrf.d.ts +10 -0
  79. package/dist/errors.d.ts +12 -0
  80. package/dist/federation/tokenStore.d.ts +29 -0
  81. package/dist/fga/config.d.ts +53 -0
  82. package/dist/fga/inMemoryStores.d.ts +3 -0
  83. package/dist/fga/postgresStores.d.ts +116 -0
  84. package/dist/fga/redisCheckCache.d.ts +11 -0
  85. package/dist/fga/schema.d.ts +2 -0
  86. package/dist/fga/types.d.ts +28 -0
  87. package/dist/fingerprint-client/index.d.ts +26 -0
  88. package/dist/htmx/configuredRoutes.d.ts +542 -0
  89. package/dist/htmx/index.d.ts +2 -0
  90. package/dist/htmx/renderers.d.ts +8 -0
  91. package/dist/htmx/routes.d.ts +514 -0
  92. package/dist/htmx/types.d.ts +129 -0
  93. package/dist/index.d.ts +3647 -0
  94. package/dist/index.js +34 -4
  95. package/dist/index.js.map +7 -6
  96. package/dist/linkedProviders/inMemoryStores.d.ts +9 -0
  97. package/dist/linkedProviders/index.d.ts +3 -0
  98. package/dist/linkedProviders/neonStores.d.ts +484 -0
  99. package/dist/linkedProviders/oauthAccountResolver.d.ts +28 -0
  100. package/dist/linkedProviders/oauthResolver.d.ts +9 -0
  101. package/dist/linkedProviders/resolver.d.ts +22 -0
  102. package/dist/lockout/config.d.ts +17 -0
  103. package/dist/lockout/inMemoryLockoutStore.d.ts +2 -0
  104. package/dist/lockout/postgresLockoutStore.d.ts +71 -0
  105. package/dist/lockout/redisLockoutStore.d.ts +3 -0
  106. package/dist/lockout/types.d.ts +12 -0
  107. package/dist/manifest.d.ts +18 -0
  108. package/dist/manifest.json +373 -0
  109. package/dist/mfa/backupCodes.d.ts +5 -0
  110. package/dist/mfa/challenge.d.ts +72 -0
  111. package/dist/mfa/config.d.ts +59 -0
  112. package/dist/mfa/gate.d.ts +2 -0
  113. package/dist/mfa/inMemoryMfaStore.d.ts +2 -0
  114. package/dist/mfa/management.d.ts +106 -0
  115. package/dist/mfa/postgresMfaStore.d.ts +266 -0
  116. package/dist/mfa/recentAuth.d.ts +2 -0
  117. package/dist/mfa/rotation.d.ts +17 -0
  118. package/dist/mfa/routes.d.ts +239 -0
  119. package/dist/mfa/secret.d.ts +2 -0
  120. package/dist/mfa/sms.d.ts +143 -0
  121. package/dist/mfa/totp.d.ts +91 -0
  122. package/dist/mfa/types.d.ts +58 -0
  123. package/dist/migrations/generate.d.ts +2 -0
  124. package/dist/migrations/index.d.ts +6 -0
  125. package/dist/migrations/runner.d.ts +22 -0
  126. package/dist/migrations/types.d.ts +14 -0
  127. package/dist/oidc/clientAuth.d.ts +19 -0
  128. package/dist/oidc/clientIdMetadata.d.ts +28 -0
  129. package/dist/oidc/config.d.ts +307 -0
  130. package/dist/oidc/dpop.d.ts +23 -0
  131. package/dist/oidc/inMemoryStores.d.ts +11 -0
  132. package/dist/oidc/inMemoryVciStores.d.ts +3 -0
  133. package/dist/oidc/index.d.ts +12 -0
  134. package/dist/oidc/jar.d.ts +14 -0
  135. package/dist/oidc/keys.d.ts +50 -0
  136. package/dist/oidc/logout.d.ts +38 -0
  137. package/dist/oidc/mtls.d.ts +11 -0
  138. package/dist/oidc/operator.d.ts +14 -0
  139. package/dist/oidc/par.d.ts +28 -0
  140. package/dist/oidc/postgresStores.d.ts +1217 -0
  141. package/dist/oidc/registration.d.ts +138 -0
  142. package/dist/oidc/routes.d.ts +569 -0
  143. package/dist/oidc/types.d.ts +157 -0
  144. package/dist/oidc/userinfo.d.ts +21 -0
  145. package/dist/oidc/vci.d.ts +159 -0
  146. package/dist/oidc/vciRoutes.d.ts +92 -0
  147. package/dist/organizations/config.d.ts +46 -0
  148. package/dist/organizations/inMemoryOrganizationStore.d.ts +2 -0
  149. package/dist/organizations/operations.d.ts +39 -0
  150. package/dist/organizations/postgresOrganizationStore.d.ts +340 -0
  151. package/dist/organizations/routes.d.ts +299 -0
  152. package/dist/organizations/types.d.ts +45 -0
  153. package/dist/passwordless/config.d.ts +43 -0
  154. package/dist/passwordless/inMemoryPasswordlessTokenStore.d.ts +2 -0
  155. package/dist/passwordless/postgresPasswordlessTokenStore.d.ts +56 -0
  156. package/dist/passwordless/routes.d.ts +163 -0
  157. package/dist/passwordless/types.d.ts +9 -0
  158. package/dist/pluginIdentity.d.ts +2 -0
  159. package/dist/plugins/denyDisposableEmail.d.ts +7 -0
  160. package/dist/plugins/discordAlert.d.ts +7 -0
  161. package/dist/plugins/geoBlock.d.ts +8 -0
  162. package/dist/plugins/index.d.ts +12 -0
  163. package/dist/plugins/pagerdutyAlert.d.ts +9 -0
  164. package/dist/plugins/posthogIdentify.d.ts +7 -0
  165. package/dist/plugins/slackAlert.d.ts +7 -0
  166. package/dist/portal/config.d.ts +34 -0
  167. package/dist/portal/inMemorySetupSessionStore.d.ts +2 -0
  168. package/dist/portal/operations.d.ts +10 -0
  169. package/dist/portal/postgresSetupSessionStore.d.ts +116 -0
  170. package/dist/portal/routes.d.ts +160 -0
  171. package/dist/portal/types.d.ts +16 -0
  172. package/dist/providers/clients.d.ts +1831 -0
  173. package/dist/providers/index.d.ts +2 -0
  174. package/dist/providersFromEnv.d.ts +19 -0
  175. package/dist/redirect.d.ts +2 -0
  176. package/dist/roles/config.d.ts +27 -0
  177. package/dist/roles/inMemoryRoleStore.d.ts +2 -0
  178. package/dist/roles/operations.d.ts +8 -0
  179. package/dist/roles/postgresRoleStore.d.ts +86 -0
  180. package/dist/roles/resolver.d.ts +17 -0
  181. package/dist/roles/routes.d.ts +106 -0
  182. package/dist/roles/types.d.ts +14 -0
  183. package/dist/routes/authorize.d.ts +102 -0
  184. package/dist/routes/callback.d.ts +64 -0
  185. package/dist/routes/profile.d.ts +73 -0
  186. package/dist/routes/protectRoute.d.ts +51 -0
  187. package/dist/routes/refresh.d.ts +74 -0
  188. package/dist/routes/requireAuth.d.ts +43 -0
  189. package/dist/routes/revoke.d.ts +73 -0
  190. package/dist/routes/sessions.d.ts +103 -0
  191. package/dist/routes/signout.d.ts +70 -0
  192. package/dist/routes/stepUp.d.ts +48 -0
  193. package/dist/routes/userStatus.d.ts +72 -0
  194. package/dist/saml.d.ts +1 -0
  195. package/dist/scim/config.d.ts +57 -0
  196. package/dist/scim/extensions.d.ts +30 -0
  197. package/dist/scim/inMemoryScimTokenStore.d.ts +2 -0
  198. package/dist/scim/postgresScimTokenStore.d.ts +86 -0
  199. package/dist/scim/routes.d.ts +366 -0
  200. package/dist/scim/serialize.d.ts +83 -0
  201. package/dist/scim/types.d.ts +54 -0
  202. package/dist/server.d.ts +34 -0
  203. package/dist/server.js +32 -4
  204. package/dist/server.js.map +7 -6
  205. package/dist/session/access.d.ts +33 -0
  206. package/dist/session/anonymous.d.ts +12 -0
  207. package/dist/session/cleanup.d.ts +45 -0
  208. package/dist/session/cookieReader.d.ts +10 -0
  209. package/dist/session/impersonation.d.ts +34 -0
  210. package/dist/session/inMemoryStore.d.ts +7 -0
  211. package/dist/session/multiSession.d.ts +27 -0
  212. package/dist/session/neonStore.d.ts +574 -0
  213. package/dist/session/promote.d.ts +23 -0
  214. package/dist/session/redisStore.d.ts +6 -0
  215. package/dist/session/sessionsConfig.d.ts +9 -0
  216. package/dist/session/state.d.ts +33 -0
  217. package/dist/session/types.d.ts +23 -0
  218. package/dist/session/userSessions.d.ts +19 -0
  219. package/dist/sso/config.d.ts +149 -0
  220. package/dist/sso/discoveryRoute.d.ts +63 -0
  221. package/dist/sso/inMemorySamlServiceProviderStore.d.ts +2 -0
  222. package/dist/sso/inMemorySsoConnectionStore.d.ts +2 -0
  223. package/dist/sso/nodeSamlAdapter.d.ts +8 -0
  224. package/dist/sso/oidcRoutes.d.ts +98 -0
  225. package/dist/sso/postgresSamlServiceProviderStore.d.ts +101 -0
  226. package/dist/sso/postgresSsoConnectionStore.d.ts +117 -0
  227. package/dist/sso/samlIdpRoutes.d.ts +139 -0
  228. package/dist/sso/samlRoutes.d.ts +179 -0
  229. package/dist/sso/types.d.ts +53 -0
  230. package/dist/stores/postgres.d.ts +5 -0
  231. package/dist/stores/redis.d.ts +5 -0
  232. package/dist/telemetry/tracing.d.ts +15 -0
  233. package/dist/tenancy.d.ts +9 -0
  234. package/dist/typeGuards.d.ts +6 -0
  235. package/dist/typebox.d.ts +4 -0
  236. package/dist/types.d.ts +438 -0
  237. package/dist/utils.d.ts +45 -0
  238. package/dist/vault/config.d.ts +20 -0
  239. package/dist/vault/inMemoryVaultStore.d.ts +2 -0
  240. package/dist/vault/index.d.ts +5 -0
  241. package/dist/vault/postgresVaultStore.d.ts +86 -0
  242. package/dist/vault/types.d.ts +14 -0
  243. package/dist/vc/inMemoryVpStores.d.ts +2 -0
  244. package/dist/vc/openid4vp.d.ts +82 -0
  245. package/dist/vc/postgresVcStores.d.ts +300 -0
  246. package/dist/vc/sdJwt.d.ts +37 -0
  247. package/dist/vc/statusList.d.ts +29 -0
  248. package/dist/vc/statusListRoutes.d.ts +63 -0
  249. package/dist/vc/vpRoutes.d.ts +120 -0
  250. package/dist/verification/types.d.ts +58 -0
  251. package/dist/webauthn/adapter.d.ts +59 -0
  252. package/dist/webauthn/config.d.ts +36 -0
  253. package/dist/webauthn/inMemoryWebAuthnCredentialStore.d.ts +2 -0
  254. package/dist/webauthn/postgresWebAuthnCredentialStore.d.ts +146 -0
  255. package/dist/webauthn/routes.d.ts +155 -0
  256. package/dist/webauthn/simpleWebAuthnAdapter.d.ts +3 -0
  257. package/dist/webauthn/types.d.ts +17 -0
  258. package/dist/webauthn.d.ts +1 -0
  259. package/dist/webhooks/config.d.ts +34 -0
  260. package/dist/webhooks/dispatcher.d.ts +3 -0
  261. package/dist/webhooks/inMemoryStore.d.ts +2 -0
  262. package/dist/webhooks/postgresStore.d.ts +116 -0
  263. package/dist/webhooks/sign.d.ts +11 -0
  264. package/dist/webhooks/types.d.ts +25 -0
  265. 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
+ };