@learncard/lca-api-service 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +73 -0
- package/AGENTS.md +106 -10
- package/CHANGELOG.md +43 -0
- package/bootstrapLambda.test.ts +76 -0
- package/config/config.dev.json +23 -0
- package/config/config.example.json +22 -0
- package/config/config.json +1 -0
- package/config/config.production.json +12 -0
- package/config/config.scouts.dev.json +11 -0
- package/config/config.scouts.production.json +11 -0
- package/dist/app.d.ts +67 -3
- package/dist/cache/getDel.d.ts +2 -0
- package/dist/cache/getDel.test.d.ts +1 -0
- package/dist/cache/login-tickets.d.ts +12 -0
- package/dist/config/applyDockerStageConfig.d.ts +1 -0
- package/dist/config/cacheEnvironment.d.ts +16 -0
- package/dist/config/environment.d.ts +101 -0
- package/dist/config/escrowBundleMode.test.d.ts +1 -0
- package/dist/config/escrowDeployment.test.d.ts +1 -0
- package/dist/config/oidcEnvironment.d.ts +74 -0
- package/dist/config/serverlessFunctionEnv.test.d.ts +1 -0
- package/dist/config/stageConfig.d.ts +62 -0
- package/dist/config/stageConfig.test.d.ts +1 -0
- package/dist/didkit_wasm_bg.wasm +0 -0
- package/dist/docker-entry.d.ts +1 -1
- package/dist/helpers/auth.helpers.d.ts +1 -1
- package/dist/helpers/escrowCancelLink.d.ts +7 -0
- package/dist/helpers/escrowCancelLink.test.d.ts +1 -0
- package/dist/helpers/escrowCancelToken.d.ts +4 -0
- package/dist/helpers/escrowCancelToken.test.d.ts +1 -0
- package/dist/helpers/keycloak.helpers.d.ts +23 -0
- package/dist/helpers/login-ticket.helpers.d.ts +31 -0
- package/dist/helpers/login-ticket.helpers.test.d.ts +1 -0
- package/dist/helpers/oidc.helpers.d.ts +47 -0
- package/dist/helpers/rate-limit.helpers.d.ts +6 -0
- package/dist/helpers/rate-limit.helpers.test.d.ts +1 -0
- package/dist/helpers/social-token.helpers.d.ts +19 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/jobs/escrowBlobRewrap.d.ts +9 -0
- package/dist/jobs/escrowHoldReminders.d.ts +12 -0
- package/dist/models/AuthSubject.d.ts +20 -0
- package/dist/models/EscrowHold.d.ts +79 -1
- package/dist/models/Notification.d.ts +5 -0
- package/dist/models/UserKey.d.ts +11 -1
- package/dist/models/index.d.ts +1 -0
- package/dist/oidc.d.ts +5 -0
- package/dist/routes/auth.d.ts +31 -0
- package/dist/routes/escrow.d.ts +18 -4
- package/dist/routes/keys.d.ts +1 -0
- package/dist/routes/notifications.d.ts +5 -0
- package/dist/routes/signing-authority.d.ts +14 -0
- package/dist/services/escrow-enclave/blobIdentity.d.ts +10 -0
- package/dist/services/escrow-enclave/blobIdentity.test.d.ts +1 -0
- package/dist/services/escrow-enclave/cancellation.d.ts +3 -0
- package/dist/services/escrow-enclave/enclaveTrustAnchors.d.ts +1 -0
- package/dist/services/escrow-enclave/index.d.ts +16 -0
- package/dist/services/escrow-enclave/notifications.d.ts +19 -4
- package/dist/services/escrow-enclave/notifications.test.d.ts +1 -0
- package/dist/services/escrow-enclave/production.test.d.ts +1 -0
- package/dist/services/escrow-enclave/remoteEnclave.contract.test.d.ts +1 -0
- package/dist/services/escrow-enclave/remoteEnclave.d.ts +20 -0
- package/dist/services/escrow-enclave/remoteEnclave.test.d.ts +1 -0
- package/dist/services/escrow-enclave/remoteEnclave.tls.test.d.ts +1 -0
- package/dist/services/escrow-enclave/softwareEnclave.d.ts +12 -2
- package/dist/services/escrow-enclave/types.d.ts +52 -8
- package/dist/types/notifications.d.ts +5 -0
- package/esbuildPlugins.cjs +1 -0
- package/lambda.ts +27 -117
- package/lambdaApp.ts +146 -0
- package/oidcLambda.test.ts +38 -0
- package/oidcLambda.ts +18 -0
- package/oidcLambdaApp.ts +11 -0
- package/package.json +23 -13
- package/scripts/README.md +88 -0
- package/scripts/check-seed-encryption-infrastructure.mjs +18 -2
- package/scripts/escrow-blob-mode-report.test.ts +227 -0
- package/scripts/escrow-blob-mode-report.ts +465 -0
- package/scripts/keycloak-admin.ts +108 -0
- package/scripts/keycloak-provider-links.ts +147 -0
- package/scripts/print-seed-rollout-flags.ts +21 -0
- package/scripts/provision-keycloak-users.ts +419 -0
- package/seedMigrationApp.test.ts +145 -0
- package/seedMigrationApp.ts +50 -0
- package/seedMigrationLambda.test.ts +30 -135
- package/seedMigrationLambda.ts +15 -46
- package/serverless-local.yml +25 -1
- package/serverless.function-env.cjs +58 -0
- package/serverless.yml +172 -37
- package/src/accesslayer/notifications/index.ts +9 -2
- package/src/accesslayer/signing-authority/index.ts +4 -1
- package/src/app.ts +2 -0
- package/src/cache/getDel.test.ts +34 -0
- package/src/cache/getDel.ts +32 -0
- package/src/cache/index.ts +1 -1
- package/src/cache/login-tickets.ts +26 -0
- package/src/config/applyDockerStageConfig.ts +6 -0
- package/src/config/cacheEnvironment.ts +34 -0
- package/src/config/environment.test.ts +45 -2
- package/src/config/environment.ts +90 -23
- package/src/config/escrowBundleMode.test.ts +52 -0
- package/src/config/escrowDeployment.test.ts +114 -0
- package/src/config/oidcEnvironment.ts +59 -0
- package/src/config/serverlessFunctionEnv.test.ts +98 -0
- package/src/config/stageConfig.test.ts +26 -0
- package/src/config/stageConfig.ts +24 -0
- package/src/docker-entry.ts +9 -0
- package/src/helpers/auth.helpers.ts +68 -30
- package/src/helpers/escrowCancelLink.test.ts +60 -0
- package/src/helpers/escrowCancelLink.ts +38 -0
- package/src/helpers/escrowCancelToken.test.ts +105 -0
- package/src/helpers/escrowCancelToken.ts +47 -0
- package/src/helpers/keycloak.helpers.ts +120 -0
- package/src/helpers/login-ticket.helpers.test.ts +45 -0
- package/src/helpers/login-ticket.helpers.ts +91 -0
- package/src/helpers/oidc.helpers.ts +354 -0
- package/src/helpers/rate-limit.helpers.test.ts +61 -0
- package/src/helpers/rate-limit.helpers.ts +73 -0
- package/src/helpers/social-token.helpers.ts +144 -0
- package/src/index.ts +1 -0
- package/src/jobs/escrowBlobRewrap.ts +121 -0
- package/src/jobs/escrowHoldReminders.ts +177 -0
- package/src/models/AuthSubject.ts +147 -0
- package/src/models/EscrowHold.ts +321 -5
- package/src/models/UserKey.ts +91 -6
- package/src/models/index.ts +1 -0
- package/src/oidc.ts +371 -0
- package/src/routes/auth.ts +173 -0
- package/src/routes/escrow.ts +281 -34
- package/src/routes/keys.ts +5 -0
- package/src/routes/signing-authority.ts +39 -1
- package/src/services/delivery/adapters/postmark.adapter.ts +43 -1
- package/src/services/escrow-enclave/README.md +81 -10
- package/src/services/escrow-enclave/__fixtures__/tls/pinned-ca.pem +11 -0
- package/src/services/escrow-enclave/__fixtures__/tls/pinned-leaf.key +5 -0
- package/src/services/escrow-enclave/__fixtures__/tls/pinned-leaf.pem +12 -0
- package/src/services/escrow-enclave/__fixtures__/tls/rogue-ca.pem +11 -0
- package/src/services/escrow-enclave/__fixtures__/tls/rogue-leaf.key +5 -0
- package/src/services/escrow-enclave/__fixtures__/tls/rogue-leaf.pem +12 -0
- package/src/services/escrow-enclave/blobIdentity.test.ts +42 -0
- package/src/services/escrow-enclave/blobIdentity.ts +55 -0
- package/src/services/escrow-enclave/cancellation.ts +59 -0
- package/src/services/escrow-enclave/enclaveTrustAnchors.ts +34 -0
- package/src/services/escrow-enclave/index.ts +145 -7
- package/src/services/escrow-enclave/notifications.test.ts +377 -0
- package/src/services/escrow-enclave/notifications.ts +340 -6
- package/src/services/escrow-enclave/production.test.ts +34 -0
- package/src/services/escrow-enclave/remoteEnclave.contract.test.ts +344 -0
- package/src/services/escrow-enclave/remoteEnclave.test.ts +490 -0
- package/src/services/escrow-enclave/remoteEnclave.tls.test.ts +62 -0
- package/src/services/escrow-enclave/remoteEnclave.ts +263 -0
- package/src/services/escrow-enclave/softwareEnclave.test.ts +231 -30
- package/src/services/escrow-enclave/softwareEnclave.ts +97 -11
- package/src/services/escrow-enclave/types.ts +63 -17
- package/test/auth-tickets.spec.ts +480 -0
- package/test/helpers/keycloak-broker.ts +181 -0
- package/test/helpers/live-mongo.ts +9 -0
- package/test/jobs/escrowBlobRewrap.spec.ts +262 -0
- package/test/jobs/escrowHoldReminders.spec.ts +319 -0
- package/test/keycloak-admin.spec.ts +58 -0
- package/test/keycloak-broker-roundtrip.integration.spec.ts +40 -0
- package/test/keycloak-migration.integration.spec.ts +266 -0
- package/test/keycloak-provider-links.spec.ts +201 -0
- package/test/keycloak-social-broker.integration.spec.ts +228 -0
- package/test/keycloak-verify.integration.spec.ts +100 -0
- package/test/keycloak-verify.spec.ts +307 -0
- package/test/keys-escrow.spec.ts +963 -24
- package/test/models/authSubjectIndexes.spec.ts +132 -0
- package/test/models/escrow.spec.ts +375 -13
- package/test/notifications.spec.ts +4 -0
- package/test/oidc-e2e/broker.spec.ts +116 -0
- package/test/oidc-e2e/compose.yaml +33 -0
- package/test/oidc-e2e/fixtures.ts +245 -0
- package/test/oidc-e2e/lock.test.mjs +73 -0
- package/test/oidc-e2e/playwright.config.ts +21 -0
- package/test/oidc-e2e/run.mjs +312 -0
- package/test/oidc-e2e/tsconfig.json +10 -0
- package/test/oidc-e2e/types.ts +21 -0
- package/test/oidc.integration.spec.ts +54 -0
- package/test/oidc.spec.ts +697 -0
- package/test/oidcLambdaApp.boot.spec.ts +105 -0
- package/test/provision-keycloak-users.spec.ts +299 -0
- package/test/signing-authority.spec.ts +50 -0
- package/tsconfig.build.json +1 -1
- package/tsconfig.json +1 -0
- package/vitest.config.ts +24 -1
- package/vitest.integration.config.ts +20 -3
- package/serverless.escrow-env.cjs +0 -20
|
@@ -6,6 +6,9 @@ export declare const lcaApiEnvironmentShape: {
|
|
|
6
6
|
test: "test";
|
|
7
7
|
production: "production";
|
|
8
8
|
}>>;
|
|
9
|
+
LAMBDA_STAGE: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
10
|
+
CONFIG_STAGE: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
11
|
+
RUNTIME_SECRETS_ID: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
9
12
|
PORT: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
10
13
|
SEED: z.ZodString;
|
|
11
14
|
SA_SEED_KMS_KEY_ARN: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
@@ -32,6 +35,17 @@ export declare const lcaApiEnvironmentShape: {
|
|
|
32
35
|
OPENAI_API_KEY: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
33
36
|
METABASE_SECRET_KEY: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
34
37
|
SCOUTS_SSO_CLIENT_SECRET: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
38
|
+
KEYCLOAK_ISSUERS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
39
|
+
KEYCLOAK_AUDIENCES: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
40
|
+
KEYCLOAK_JWKS_URL_OVERRIDES: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
41
|
+
OIDC_ISSUER: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
42
|
+
OIDC_SIGNING_KEY_JWK: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
43
|
+
OIDC_SIGNING_KEY_SECRET_ID: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
44
|
+
OIDC_CLIENT_ID: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
45
|
+
OIDC_CLIENT_SECRET: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
46
|
+
OIDC_REDIRECT_URIS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
47
|
+
GOOGLE_OAUTH_CLIENT_IDS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
48
|
+
APPLE_OAUTH_CLIENT_IDS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
35
49
|
POSTMARK_SERVER_TOKEN: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
36
50
|
POSTMARK_FROM_EMAIL: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
37
51
|
POSTMARK_BRAND_NAME: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
@@ -47,6 +61,15 @@ export declare const lcaApiEnvironmentShape: {
|
|
|
47
61
|
}>>>;
|
|
48
62
|
ESCROW_ENCLAVE_SOFTWARE_PRIVATE_KEYS_JSON: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
49
63
|
ESCROW_ENCLAVE_ACTIVE_KEY_ID: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
64
|
+
ESCROW_ENCLAVE_REMOTE_URL: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
65
|
+
ESCROW_ENCLAVE_REMOTE_TOKEN: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
66
|
+
ESCROW_RELEASE_KILL_SWITCH: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
67
|
+
0: "0";
|
|
68
|
+
1: "1";
|
|
69
|
+
true: "true";
|
|
70
|
+
false: "false";
|
|
71
|
+
}>, z.ZodTransform<boolean, "0" | "1" | "true" | "false">>>>;
|
|
72
|
+
ESCROW_ENCLAVE_REMOTE_TIMEOUT_MS: z.ZodPipe<z.ZodPipe<z.ZodPreprocess<z.ZodOptional<z.ZodString>>, z.ZodTransform<number, string | undefined>>, z.ZodNumber>;
|
|
50
73
|
ESCROW_HOLD_DURATION_MS: z.ZodPipe<z.ZodPipe<z.ZodPreprocess<z.ZodOptional<z.ZodString>>, z.ZodTransform<number, string | undefined>>, z.ZodNumber>;
|
|
51
74
|
ESCROW_HOLD_RESTART_MIN_AGE_MS: z.ZodPipe<z.ZodPipe<z.ZodPreprocess<z.ZodOptional<z.ZodString>>, z.ZodTransform<number, string | undefined>>, z.ZodNumber>;
|
|
52
75
|
ANDROID_PUSH_ICON: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
@@ -94,6 +117,9 @@ export declare const lcaApiEnvironmentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
94
117
|
test: "test";
|
|
95
118
|
production: "production";
|
|
96
119
|
}>>;
|
|
120
|
+
LAMBDA_STAGE: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
121
|
+
CONFIG_STAGE: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
122
|
+
RUNTIME_SECRETS_ID: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
97
123
|
PORT: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
98
124
|
SEED: z.ZodString;
|
|
99
125
|
SA_SEED_KMS_KEY_ARN: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
@@ -120,6 +146,17 @@ export declare const lcaApiEnvironmentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
120
146
|
OPENAI_API_KEY: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
121
147
|
METABASE_SECRET_KEY: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
122
148
|
SCOUTS_SSO_CLIENT_SECRET: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
149
|
+
KEYCLOAK_ISSUERS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
150
|
+
KEYCLOAK_AUDIENCES: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
151
|
+
KEYCLOAK_JWKS_URL_OVERRIDES: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
152
|
+
OIDC_ISSUER: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
153
|
+
OIDC_SIGNING_KEY_JWK: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
154
|
+
OIDC_SIGNING_KEY_SECRET_ID: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
155
|
+
OIDC_CLIENT_ID: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
156
|
+
OIDC_CLIENT_SECRET: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
157
|
+
OIDC_REDIRECT_URIS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
158
|
+
GOOGLE_OAUTH_CLIENT_IDS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
159
|
+
APPLE_OAUTH_CLIENT_IDS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
123
160
|
POSTMARK_SERVER_TOKEN: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
124
161
|
POSTMARK_FROM_EMAIL: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
125
162
|
POSTMARK_BRAND_NAME: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
@@ -135,6 +172,15 @@ export declare const lcaApiEnvironmentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
135
172
|
}>>>;
|
|
136
173
|
ESCROW_ENCLAVE_SOFTWARE_PRIVATE_KEYS_JSON: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
137
174
|
ESCROW_ENCLAVE_ACTIVE_KEY_ID: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
175
|
+
ESCROW_ENCLAVE_REMOTE_URL: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
176
|
+
ESCROW_ENCLAVE_REMOTE_TOKEN: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
177
|
+
ESCROW_RELEASE_KILL_SWITCH: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
178
|
+
0: "0";
|
|
179
|
+
1: "1";
|
|
180
|
+
true: "true";
|
|
181
|
+
false: "false";
|
|
182
|
+
}>, z.ZodTransform<boolean, "0" | "1" | "true" | "false">>>>;
|
|
183
|
+
ESCROW_ENCLAVE_REMOTE_TIMEOUT_MS: z.ZodPipe<z.ZodPipe<z.ZodPreprocess<z.ZodOptional<z.ZodString>>, z.ZodTransform<number, string | undefined>>, z.ZodNumber>;
|
|
138
184
|
ESCROW_HOLD_DURATION_MS: z.ZodPipe<z.ZodPipe<z.ZodPreprocess<z.ZodOptional<z.ZodString>>, z.ZodTransform<number, string | undefined>>, z.ZodNumber>;
|
|
139
185
|
ESCROW_HOLD_RESTART_MIN_AGE_MS: z.ZodPipe<z.ZodPipe<z.ZodPreprocess<z.ZodOptional<z.ZodString>>, z.ZodTransform<number, string | undefined>>, z.ZodNumber>;
|
|
140
186
|
ANDROID_PUSH_ICON: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
@@ -183,6 +229,7 @@ export declare const lcaApiEnvironmentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
183
229
|
SEED: string;
|
|
184
230
|
MONGO_URI: string;
|
|
185
231
|
MONGO_DB_NAME: string;
|
|
232
|
+
ESCROW_ENCLAVE_REMOTE_TIMEOUT_MS: number;
|
|
186
233
|
ESCROW_HOLD_DURATION_MS: number;
|
|
187
234
|
ESCROW_HOLD_RESTART_MIN_AGE_MS: number;
|
|
188
235
|
IS_OFFLINE: boolean;
|
|
@@ -190,6 +237,9 @@ export declare const lcaApiEnvironmentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
190
237
|
IS_E2E_TEST: boolean;
|
|
191
238
|
SKIP_DIDKIT_NAPI: boolean;
|
|
192
239
|
CI: boolean;
|
|
240
|
+
LAMBDA_STAGE?: string | undefined;
|
|
241
|
+
CONFIG_STAGE?: string | undefined;
|
|
242
|
+
RUNTIME_SECRETS_ID?: string | undefined;
|
|
193
243
|
SA_SEED_KMS_KEY_ARN?: string | undefined;
|
|
194
244
|
SA_SEED_LOCAL_KEK?: string | undefined;
|
|
195
245
|
DOMAIN_NAME?: string | undefined;
|
|
@@ -200,6 +250,17 @@ export declare const lcaApiEnvironmentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
200
250
|
OPENAI_API_KEY?: string | undefined;
|
|
201
251
|
METABASE_SECRET_KEY?: string | undefined;
|
|
202
252
|
SCOUTS_SSO_CLIENT_SECRET?: string | undefined;
|
|
253
|
+
KEYCLOAK_ISSUERS?: string | undefined;
|
|
254
|
+
KEYCLOAK_AUDIENCES?: string | undefined;
|
|
255
|
+
KEYCLOAK_JWKS_URL_OVERRIDES?: string | undefined;
|
|
256
|
+
OIDC_ISSUER?: string | undefined;
|
|
257
|
+
OIDC_SIGNING_KEY_JWK?: string | undefined;
|
|
258
|
+
OIDC_SIGNING_KEY_SECRET_ID?: string | undefined;
|
|
259
|
+
OIDC_CLIENT_ID?: string | undefined;
|
|
260
|
+
OIDC_CLIENT_SECRET?: string | undefined;
|
|
261
|
+
OIDC_REDIRECT_URIS?: string | undefined;
|
|
262
|
+
GOOGLE_OAUTH_CLIENT_IDS?: string | undefined;
|
|
263
|
+
APPLE_OAUTH_CLIENT_IDS?: string | undefined;
|
|
203
264
|
POSTMARK_SERVER_TOKEN?: string | undefined;
|
|
204
265
|
POSTMARK_FROM_EMAIL?: string | undefined;
|
|
205
266
|
POSTMARK_BRAND_NAME?: string | undefined;
|
|
@@ -212,6 +273,9 @@ export declare const lcaApiEnvironmentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
212
273
|
ESCROW_ENCLAVE_MODE?: "software" | "remote" | undefined;
|
|
213
274
|
ESCROW_ENCLAVE_SOFTWARE_PRIVATE_KEYS_JSON?: string | undefined;
|
|
214
275
|
ESCROW_ENCLAVE_ACTIVE_KEY_ID?: string | undefined;
|
|
276
|
+
ESCROW_ENCLAVE_REMOTE_URL?: string | undefined;
|
|
277
|
+
ESCROW_ENCLAVE_REMOTE_TOKEN?: string | undefined;
|
|
278
|
+
ESCROW_RELEASE_KILL_SWITCH?: boolean | undefined;
|
|
215
279
|
ANDROID_PUSH_ICON?: string | undefined;
|
|
216
280
|
REDIS_HOST?: string | undefined;
|
|
217
281
|
REDIS_PORT?: number | undefined;
|
|
@@ -226,6 +290,7 @@ export declare const lcaApiEnvironmentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
226
290
|
SEED: string;
|
|
227
291
|
MONGO_URI: string;
|
|
228
292
|
MONGO_DB_NAME: string;
|
|
293
|
+
ESCROW_ENCLAVE_REMOTE_TIMEOUT_MS: number;
|
|
229
294
|
ESCROW_HOLD_DURATION_MS: number;
|
|
230
295
|
ESCROW_HOLD_RESTART_MIN_AGE_MS: number;
|
|
231
296
|
IS_OFFLINE: boolean;
|
|
@@ -233,6 +298,9 @@ export declare const lcaApiEnvironmentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
233
298
|
IS_E2E_TEST: boolean;
|
|
234
299
|
SKIP_DIDKIT_NAPI: boolean;
|
|
235
300
|
CI: boolean;
|
|
301
|
+
LAMBDA_STAGE?: string | undefined;
|
|
302
|
+
CONFIG_STAGE?: string | undefined;
|
|
303
|
+
RUNTIME_SECRETS_ID?: string | undefined;
|
|
236
304
|
SA_SEED_KMS_KEY_ARN?: string | undefined;
|
|
237
305
|
SA_SEED_LOCAL_KEK?: string | undefined;
|
|
238
306
|
SA_SEED_ENCRYPT_WRITES?: boolean | undefined;
|
|
@@ -245,6 +313,17 @@ export declare const lcaApiEnvironmentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
245
313
|
OPENAI_API_KEY?: string | undefined;
|
|
246
314
|
METABASE_SECRET_KEY?: string | undefined;
|
|
247
315
|
SCOUTS_SSO_CLIENT_SECRET?: string | undefined;
|
|
316
|
+
KEYCLOAK_ISSUERS?: string | undefined;
|
|
317
|
+
KEYCLOAK_AUDIENCES?: string | undefined;
|
|
318
|
+
KEYCLOAK_JWKS_URL_OVERRIDES?: string | undefined;
|
|
319
|
+
OIDC_ISSUER?: string | undefined;
|
|
320
|
+
OIDC_SIGNING_KEY_JWK?: string | undefined;
|
|
321
|
+
OIDC_SIGNING_KEY_SECRET_ID?: string | undefined;
|
|
322
|
+
OIDC_CLIENT_ID?: string | undefined;
|
|
323
|
+
OIDC_CLIENT_SECRET?: string | undefined;
|
|
324
|
+
OIDC_REDIRECT_URIS?: string | undefined;
|
|
325
|
+
GOOGLE_OAUTH_CLIENT_IDS?: string | undefined;
|
|
326
|
+
APPLE_OAUTH_CLIENT_IDS?: string | undefined;
|
|
248
327
|
POSTMARK_SERVER_TOKEN?: string | undefined;
|
|
249
328
|
POSTMARK_FROM_EMAIL?: string | undefined;
|
|
250
329
|
POSTMARK_BRAND_NAME?: string | undefined;
|
|
@@ -257,6 +336,9 @@ export declare const lcaApiEnvironmentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
257
336
|
ESCROW_ENCLAVE_MODE?: "software" | "remote" | undefined;
|
|
258
337
|
ESCROW_ENCLAVE_SOFTWARE_PRIVATE_KEYS_JSON?: string | undefined;
|
|
259
338
|
ESCROW_ENCLAVE_ACTIVE_KEY_ID?: string | undefined;
|
|
339
|
+
ESCROW_ENCLAVE_REMOTE_URL?: string | undefined;
|
|
340
|
+
ESCROW_ENCLAVE_REMOTE_TOKEN?: string | undefined;
|
|
341
|
+
ESCROW_RELEASE_KILL_SWITCH?: boolean | undefined;
|
|
260
342
|
ANDROID_PUSH_ICON?: string | undefined;
|
|
261
343
|
REDIS_HOST?: string | undefined;
|
|
262
344
|
REDIS_PORT?: number | undefined;
|
|
@@ -268,6 +350,7 @@ export declare const lcaApiEnvironmentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
268
350
|
}>>;
|
|
269
351
|
export type LcaApiEnvironment = z.output<typeof lcaApiEnvironmentSchema>;
|
|
270
352
|
export declare const parseLcaApiEnvironment: (raw: Record<string, unknown>, source?: string) => LcaApiEnvironment;
|
|
353
|
+
export declare const isEscrowReleaseKillSwitchEnabled: () => boolean;
|
|
271
354
|
export declare const parseEscrowPrivateKeys: (serialized: string) => Record<string, string>;
|
|
272
355
|
export declare const environment: {
|
|
273
356
|
SA_SEED_ENCRYPT_WRITES: boolean;
|
|
@@ -277,6 +360,7 @@ export declare const environment: {
|
|
|
277
360
|
SEED: string;
|
|
278
361
|
MONGO_URI: string;
|
|
279
362
|
MONGO_DB_NAME: string;
|
|
363
|
+
ESCROW_ENCLAVE_REMOTE_TIMEOUT_MS: number;
|
|
280
364
|
ESCROW_HOLD_DURATION_MS: number;
|
|
281
365
|
ESCROW_HOLD_RESTART_MIN_AGE_MS: number;
|
|
282
366
|
IS_OFFLINE: boolean;
|
|
@@ -284,6 +368,9 @@ export declare const environment: {
|
|
|
284
368
|
IS_E2E_TEST: boolean;
|
|
285
369
|
SKIP_DIDKIT_NAPI: boolean;
|
|
286
370
|
CI: boolean;
|
|
371
|
+
LAMBDA_STAGE?: string | undefined;
|
|
372
|
+
CONFIG_STAGE?: string | undefined;
|
|
373
|
+
RUNTIME_SECRETS_ID?: string | undefined;
|
|
287
374
|
SA_SEED_KMS_KEY_ARN?: string | undefined;
|
|
288
375
|
SA_SEED_LOCAL_KEK?: string | undefined;
|
|
289
376
|
DOMAIN_NAME?: string | undefined;
|
|
@@ -294,6 +381,17 @@ export declare const environment: {
|
|
|
294
381
|
OPENAI_API_KEY?: string | undefined;
|
|
295
382
|
METABASE_SECRET_KEY?: string | undefined;
|
|
296
383
|
SCOUTS_SSO_CLIENT_SECRET?: string | undefined;
|
|
384
|
+
KEYCLOAK_ISSUERS?: string | undefined;
|
|
385
|
+
KEYCLOAK_AUDIENCES?: string | undefined;
|
|
386
|
+
KEYCLOAK_JWKS_URL_OVERRIDES?: string | undefined;
|
|
387
|
+
OIDC_ISSUER?: string | undefined;
|
|
388
|
+
OIDC_SIGNING_KEY_JWK?: string | undefined;
|
|
389
|
+
OIDC_SIGNING_KEY_SECRET_ID?: string | undefined;
|
|
390
|
+
OIDC_CLIENT_ID?: string | undefined;
|
|
391
|
+
OIDC_CLIENT_SECRET?: string | undefined;
|
|
392
|
+
OIDC_REDIRECT_URIS?: string | undefined;
|
|
393
|
+
GOOGLE_OAUTH_CLIENT_IDS?: string | undefined;
|
|
394
|
+
APPLE_OAUTH_CLIENT_IDS?: string | undefined;
|
|
297
395
|
POSTMARK_SERVER_TOKEN?: string | undefined;
|
|
298
396
|
POSTMARK_FROM_EMAIL?: string | undefined;
|
|
299
397
|
POSTMARK_BRAND_NAME?: string | undefined;
|
|
@@ -306,6 +404,9 @@ export declare const environment: {
|
|
|
306
404
|
ESCROW_ENCLAVE_MODE?: "software" | "remote" | undefined;
|
|
307
405
|
ESCROW_ENCLAVE_SOFTWARE_PRIVATE_KEYS_JSON?: string | undefined;
|
|
308
406
|
ESCROW_ENCLAVE_ACTIVE_KEY_ID?: string | undefined;
|
|
407
|
+
ESCROW_ENCLAVE_REMOTE_URL?: string | undefined;
|
|
408
|
+
ESCROW_ENCLAVE_REMOTE_TOKEN?: string | undefined;
|
|
409
|
+
ESCROW_RELEASE_KILL_SWITCH?: boolean | undefined;
|
|
309
410
|
ANDROID_PUSH_ICON?: string | undefined;
|
|
310
411
|
REDIS_HOST?: string | undefined;
|
|
311
412
|
REDIS_PORT?: number | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import 'dotenv/config';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const oidcEnvironmentShape: {
|
|
4
|
+
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
5
|
+
development: "development";
|
|
6
|
+
test: "test";
|
|
7
|
+
production: "production";
|
|
8
|
+
}>>;
|
|
9
|
+
LAMBDA_STAGE: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
10
|
+
IS_OFFLINE: z.ZodDefault<z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
11
|
+
0: "0";
|
|
12
|
+
1: "1";
|
|
13
|
+
true: "true";
|
|
14
|
+
false: "false";
|
|
15
|
+
}>, z.ZodTransform<boolean, "0" | "1" | "true" | "false">>>>>;
|
|
16
|
+
IS_E2E_TEST: z.ZodDefault<z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
17
|
+
0: "0";
|
|
18
|
+
1: "1";
|
|
19
|
+
true: "true";
|
|
20
|
+
false: "false";
|
|
21
|
+
}>, z.ZodTransform<boolean, "0" | "1" | "true" | "false">>>>>;
|
|
22
|
+
KEYCLOAK_ISSUERS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
23
|
+
KEYCLOAK_AUDIENCES: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
24
|
+
OIDC_ISSUER: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
25
|
+
OIDC_SIGNING_KEY_JWK: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
26
|
+
OIDC_SIGNING_KEY_SECRET_ID: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
27
|
+
OIDC_CLIENT_ID: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
28
|
+
OIDC_CLIENT_SECRET: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
29
|
+
OIDC_REDIRECT_URIS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
30
|
+
};
|
|
31
|
+
export declare const oidcEnvironmentSchema: z.ZodObject<{
|
|
32
|
+
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
33
|
+
development: "development";
|
|
34
|
+
test: "test";
|
|
35
|
+
production: "production";
|
|
36
|
+
}>>;
|
|
37
|
+
LAMBDA_STAGE: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
38
|
+
IS_OFFLINE: z.ZodDefault<z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
39
|
+
0: "0";
|
|
40
|
+
1: "1";
|
|
41
|
+
true: "true";
|
|
42
|
+
false: "false";
|
|
43
|
+
}>, z.ZodTransform<boolean, "0" | "1" | "true" | "false">>>>>;
|
|
44
|
+
IS_E2E_TEST: z.ZodDefault<z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
45
|
+
0: "0";
|
|
46
|
+
1: "1";
|
|
47
|
+
true: "true";
|
|
48
|
+
false: "false";
|
|
49
|
+
}>, z.ZodTransform<boolean, "0" | "1" | "true" | "false">>>>>;
|
|
50
|
+
KEYCLOAK_ISSUERS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
51
|
+
KEYCLOAK_AUDIENCES: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
52
|
+
OIDC_ISSUER: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
53
|
+
OIDC_SIGNING_KEY_JWK: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
54
|
+
OIDC_SIGNING_KEY_SECRET_ID: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
55
|
+
OIDC_CLIENT_ID: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
56
|
+
OIDC_CLIENT_SECRET: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
57
|
+
OIDC_REDIRECT_URIS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
export type OidcEnvironment = z.output<typeof oidcEnvironmentSchema>;
|
|
60
|
+
export declare const parseOidcEnvironment: (raw: Record<string, unknown>, source?: string) => OidcEnvironment;
|
|
61
|
+
export declare const environment: {
|
|
62
|
+
NODE_ENV: "development" | "test" | "production";
|
|
63
|
+
IS_OFFLINE: boolean;
|
|
64
|
+
IS_E2E_TEST: boolean;
|
|
65
|
+
LAMBDA_STAGE?: string | undefined;
|
|
66
|
+
KEYCLOAK_ISSUERS?: string | undefined;
|
|
67
|
+
KEYCLOAK_AUDIENCES?: string | undefined;
|
|
68
|
+
OIDC_ISSUER?: string | undefined;
|
|
69
|
+
OIDC_SIGNING_KEY_JWK?: string | undefined;
|
|
70
|
+
OIDC_SIGNING_KEY_SECRET_ID?: string | undefined;
|
|
71
|
+
OIDC_CLIENT_ID?: string | undefined;
|
|
72
|
+
OIDC_CLIENT_SECRET?: string | undefined;
|
|
73
|
+
OIDC_REDIRECT_URIS?: string | undefined;
|
|
74
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import 'dotenv/config';
|
|
2
|
+
export declare const base: Record<string, string>;
|
|
3
|
+
export declare const stages: {
|
|
4
|
+
dev: {
|
|
5
|
+
APPLE_OAUTH_CLIENT_IDS: string;
|
|
6
|
+
DOMAIN_NAME: string;
|
|
7
|
+
ESCROW_ENCLAVE_ACTIVE_KEY_ID: string;
|
|
8
|
+
ESCROW_ENCLAVE_REMOTE_TIMEOUT_MS: string;
|
|
9
|
+
ESCROW_HOLD_DURATION_MS: string;
|
|
10
|
+
ESCROW_HOLD_RESTART_MIN_AGE_MS: string;
|
|
11
|
+
GOOGLE_OAUTH_CLIENT_IDS: string;
|
|
12
|
+
KEYCLOAK_AUDIENCES: string;
|
|
13
|
+
KEYCLOAK_ISSUERS: string;
|
|
14
|
+
OIDC_CLIENT_ID: string;
|
|
15
|
+
OIDC_ISSUER: string;
|
|
16
|
+
OIDC_SIGNING_KEY_SECRET_ID: string;
|
|
17
|
+
POSTMARK_BRAND_NAME: string;
|
|
18
|
+
POSTMARK_ENDORSEMENT_REQUEST_TEMPLATE_ALIAS: string;
|
|
19
|
+
POSTMARK_FROM_EMAIL: string;
|
|
20
|
+
POSTMARK_LOGIN_CODE_TEMPLATE_ALIAS: string;
|
|
21
|
+
POSTMARK_RECOVERY_EMAIL_CODE_TEMPLATE_ALIAS: string;
|
|
22
|
+
POSTMARK_RECOVERY_KEY_TEMPLATE_ALIAS: string;
|
|
23
|
+
SA_SEED_ALLOW_LEGACY_READ: string;
|
|
24
|
+
SA_SEED_ENCRYPT_WRITES: string;
|
|
25
|
+
SENTRY_ENV: string;
|
|
26
|
+
};
|
|
27
|
+
production: {
|
|
28
|
+
DOMAIN_NAME: string;
|
|
29
|
+
POSTMARK_BRAND_NAME: string;
|
|
30
|
+
POSTMARK_ENDORSEMENT_REQUEST_TEMPLATE_ALIAS: string;
|
|
31
|
+
POSTMARK_FROM_EMAIL: string;
|
|
32
|
+
POSTMARK_LOGIN_CODE_TEMPLATE_ALIAS: string;
|
|
33
|
+
POSTMARK_RECOVERY_EMAIL_CODE_TEMPLATE_ALIAS: string;
|
|
34
|
+
POSTMARK_RECOVERY_KEY_TEMPLATE_ALIAS: string;
|
|
35
|
+
SA_SEED_ALLOW_LEGACY_READ: string;
|
|
36
|
+
SA_SEED_ENCRYPT_WRITES: string;
|
|
37
|
+
SENTRY_ENV: string;
|
|
38
|
+
};
|
|
39
|
+
'scouts.dev': {
|
|
40
|
+
DOMAIN_NAME: string;
|
|
41
|
+
POSTMARK_BRAND_NAME: string;
|
|
42
|
+
POSTMARK_FROM_EMAIL: string;
|
|
43
|
+
POSTMARK_LOGIN_CODE_TEMPLATE_ALIAS: string;
|
|
44
|
+
POSTMARK_RECOVERY_EMAIL_CODE_TEMPLATE_ALIAS: string;
|
|
45
|
+
POSTMARK_RECOVERY_KEY_TEMPLATE_ALIAS: string;
|
|
46
|
+
SA_SEED_ALLOW_LEGACY_READ: string;
|
|
47
|
+
SA_SEED_ENCRYPT_WRITES: string;
|
|
48
|
+
SENTRY_ENV: string;
|
|
49
|
+
};
|
|
50
|
+
'scouts.production': {
|
|
51
|
+
DOMAIN_NAME: string;
|
|
52
|
+
POSTMARK_BRAND_NAME: string;
|
|
53
|
+
POSTMARK_FROM_EMAIL: string;
|
|
54
|
+
POSTMARK_LOGIN_CODE_TEMPLATE_ALIAS: string;
|
|
55
|
+
POSTMARK_RECOVERY_EMAIL_CODE_TEMPLATE_ALIAS: string;
|
|
56
|
+
POSTMARK_RECOVERY_KEY_TEMPLATE_ALIAS: string;
|
|
57
|
+
SA_SEED_ALLOW_LEGACY_READ: string;
|
|
58
|
+
SA_SEED_ENCRYPT_WRITES: string;
|
|
59
|
+
SENTRY_ENV: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export declare const applyLcaApiStageConfig: (stage: string | undefined) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/didkit_wasm_bg.wasm
CHANGED
|
Binary file
|
package/dist/docker-entry.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import './config/applyDockerStageConfig';
|
|
@@ -7,7 +7,7 @@ export interface VerifiedUser {
|
|
|
7
7
|
export type AuthProviderType = 'firebase' | 'supertokens' | 'keycloak' | 'oidc';
|
|
8
8
|
export declare function verifyFirebaseToken(token: string): Promise<VerifiedUser>;
|
|
9
9
|
export declare function verifySuperTokensToken(_token: string): Promise<VerifiedUser>;
|
|
10
|
-
export declare function verifyKeycloakToken(
|
|
10
|
+
export declare function verifyKeycloakToken(token: string): Promise<VerifiedUser>;
|
|
11
11
|
export declare function verifyOidcToken(_token: string): Promise<VerifiedUser>;
|
|
12
12
|
export declare function verifyAuthToken(token: string, providerType: AuthProviderType): Promise<VerifiedUser>;
|
|
13
13
|
export declare function getContactMethodFromUser(user: VerifiedUser): {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Context } from '@routes';
|
|
2
|
+
export declare const resolveEscrowAppBaseUrl: (ctx: Pick<Context, "tenant">) => string;
|
|
3
|
+
export declare const buildEscrowCancelUrl: ({ baseUrl, holdId, token, }: {
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
holdId: string;
|
|
6
|
+
token: string;
|
|
7
|
+
}) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EscrowHold } from '@models';
|
|
2
|
+
export declare const generateEscrowCancelToken: () => string;
|
|
3
|
+
export declare const hashEscrowCancelToken: (token: string) => string;
|
|
4
|
+
export declare const escrowCancelTokenMatches: (hold: EscrowHold, token: string) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { JWTVerifyGetKey } from 'jose';
|
|
2
|
+
export interface KeycloakVerifyOptions {
|
|
3
|
+
issuers: string[];
|
|
4
|
+
audiences: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface KeycloakClaims {
|
|
7
|
+
sub: string;
|
|
8
|
+
iss: string;
|
|
9
|
+
typ?: string;
|
|
10
|
+
azp?: string;
|
|
11
|
+
aud?: string | string[];
|
|
12
|
+
email?: string;
|
|
13
|
+
email_verified?: boolean;
|
|
14
|
+
phone_number?: string;
|
|
15
|
+
phone_number_verified?: boolean;
|
|
16
|
+
name?: string;
|
|
17
|
+
picture?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const setKeycloakJwksResolverForTests: (resolver: ((issuer: string) => JWTVerifyGetKey) | undefined) => void;
|
|
20
|
+
export declare const getKeycloakIssuerJwksUrl: (issuer: string) => string;
|
|
21
|
+
export declare const getKeycloakJwks: (issuer: string) => JWTVerifyGetKey;
|
|
22
|
+
export declare const verifyKeycloakJwt: (token: string, opts: KeycloakVerifyOptions) => Promise<KeycloakClaims>;
|
|
23
|
+
export declare const getKeycloakVerifyOptionsFromEnv: () => KeycloakVerifyOptions | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const AUTH_CODE_PREFIX = "oidc-code:";
|
|
2
|
+
export declare const ACCESS_TOKEN_PREFIX = "oidc:access:";
|
|
3
|
+
export declare const AUTH_CODE_TTL_SECONDS = 60;
|
|
4
|
+
export declare const ACCESS_TOKEN_TTL_SECONDS = 300;
|
|
5
|
+
export interface SubjectClaims {
|
|
6
|
+
subject: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
emailVerified?: boolean;
|
|
9
|
+
phoneNumber?: string;
|
|
10
|
+
phoneNumberVerified?: boolean;
|
|
11
|
+
name?: string;
|
|
12
|
+
picture?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface AuthorizationCodeData extends SubjectClaims {
|
|
15
|
+
scope: string;
|
|
16
|
+
code: string;
|
|
17
|
+
clientId: string;
|
|
18
|
+
redirectUri: string;
|
|
19
|
+
nonce?: string;
|
|
20
|
+
state?: string;
|
|
21
|
+
createdAt: number;
|
|
22
|
+
}
|
|
23
|
+
export interface AccessTokenData extends SubjectClaims {
|
|
24
|
+
createdAt: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const generateAuthorizationCode: () => string;
|
|
27
|
+
export declare const generateAccessToken: () => string;
|
|
28
|
+
export declare const storeAuthorizationCode: (data: AuthorizationCodeData, ttl?: number) => Promise<void>;
|
|
29
|
+
export declare const consumeAuthorizationCode: (code: string) => Promise<AuthorizationCodeData | null>;
|
|
30
|
+
export declare const storeAccessToken: (accessToken: string, data: AccessTokenData, ttl?: number) => Promise<void>;
|
|
31
|
+
export declare const getAccessToken: (accessToken: string) => Promise<AccessTokenData | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { CryptoKey, JWK, JWTPayload } from 'jose';
|
|
2
|
+
export declare const OIDC_SIGNING_ALG: "RS256";
|
|
3
|
+
export declare const DEFAULT_ID_TOKEN_TTL_SECONDS = 300;
|
|
4
|
+
export declare const DEFAULT_OIDC_CLIENT_ID = "keycloak-broker";
|
|
5
|
+
export interface OidcIdTokenClaims extends JWTPayload {
|
|
6
|
+
sub: string;
|
|
7
|
+
iss: string;
|
|
8
|
+
aud: string | string[];
|
|
9
|
+
email?: string;
|
|
10
|
+
email_verified?: boolean;
|
|
11
|
+
phone_number?: string;
|
|
12
|
+
phone_number_verified?: boolean;
|
|
13
|
+
name?: string;
|
|
14
|
+
picture?: string;
|
|
15
|
+
}
|
|
16
|
+
interface OidcSigningKey {
|
|
17
|
+
privateKey: CryptoKey;
|
|
18
|
+
publicKey: CryptoKey;
|
|
19
|
+
publicJwk: JWK;
|
|
20
|
+
kid: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const getOidcSigningKey: () => Promise<OidcSigningKey>;
|
|
23
|
+
export declare const resetOidcSigningKeyForTests: () => void;
|
|
24
|
+
export declare const getOidcIssuer: () => string;
|
|
25
|
+
export declare const getOidcClientId: () => string;
|
|
26
|
+
export declare const getOidcRedirectUris: () => string[];
|
|
27
|
+
export declare const verifyOidcClientCredentials: (clientId: string, clientSecret: string) => boolean;
|
|
28
|
+
export declare const isAllowedRedirectUri: (redirectUri: string) => boolean;
|
|
29
|
+
export declare const getOidcJwks: () => Promise<{
|
|
30
|
+
keys: JWK[];
|
|
31
|
+
}>;
|
|
32
|
+
export declare const getOidcDiscoveryDocument: () => Record<string, unknown>;
|
|
33
|
+
export declare const mintIdToken: (params: {
|
|
34
|
+
subject: string;
|
|
35
|
+
nonce?: string;
|
|
36
|
+
ttlSeconds?: number;
|
|
37
|
+
email?: string;
|
|
38
|
+
emailVerified?: boolean;
|
|
39
|
+
phoneNumber?: string;
|
|
40
|
+
phoneNumberVerified?: boolean;
|
|
41
|
+
name?: string;
|
|
42
|
+
picture?: string;
|
|
43
|
+
}) => Promise<{
|
|
44
|
+
token: string;
|
|
45
|
+
expiresAt: number;
|
|
46
|
+
}>;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FastifyRequest } from 'fastify';
|
|
2
|
+
export declare const DEFAULT_MAX_FAILED_ATTEMPTS = 50;
|
|
3
|
+
export declare const DEFAULT_RATE_LIMIT_WINDOW_SECONDS: number;
|
|
4
|
+
export declare const isRateLimited: (key: string, max?: number) => Promise<boolean>;
|
|
5
|
+
export declare const recordFailure: (key: string, windowSeconds?: number) => Promise<void>;
|
|
6
|
+
export declare const getRequestClientIp: (request: Pick<FastifyRequest, "ip">) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { JWTVerifyGetKey } from 'jose';
|
|
2
|
+
export type SocialProviderId = 'google' | 'apple';
|
|
3
|
+
export interface SocialProviderConfig {
|
|
4
|
+
issuers: string[];
|
|
5
|
+
audiences: string[];
|
|
6
|
+
jwksUri: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SocialClaims {
|
|
9
|
+
sub: string;
|
|
10
|
+
iss: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
email_verified?: boolean;
|
|
13
|
+
name?: string;
|
|
14
|
+
picture?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const getSocialProviderConfig: (provider: SocialProviderId) => SocialProviderConfig | null;
|
|
17
|
+
export declare const setSocialJwksResolverForTests: (resolver: ((jwksUri: string) => JWTVerifyGetKey) | undefined) => void;
|
|
18
|
+
export declare const getSocialJwks: (jwksUri: string) => JWTVerifyGetKey;
|
|
19
|
+
export declare const verifySocialIdToken: (provider: SocialProviderId, token: string) => Promise<SocialClaims>;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/dist/index.js
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 137933050 bytes
|
|
4
|
+
sha256: 5d64b82c788a32e703cbe115ccb7dead043201ff159475b76d09fab29fade6ac
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface EscrowBlobRewrapResult {
|
|
2
|
+
rewrapped: number;
|
|
3
|
+
skippedPendingHold: number;
|
|
4
|
+
failed: number;
|
|
5
|
+
}
|
|
6
|
+
export interface RunEscrowBlobRewrapOptions {
|
|
7
|
+
limit?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const runEscrowBlobRewrap: (options?: RunEscrowBlobRewrapOptions) => Promise<EscrowBlobRewrapResult>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { notifyEscrowHoldEvent } from '../services/escrow-enclave';
|
|
2
|
+
export interface EscrowHoldReminderResult {
|
|
3
|
+
reminded: number;
|
|
4
|
+
expired: number;
|
|
5
|
+
failed: number;
|
|
6
|
+
}
|
|
7
|
+
export interface RunEscrowHoldRemindersOptions {
|
|
8
|
+
now?: Date;
|
|
9
|
+
limit?: number;
|
|
10
|
+
notify?: typeof notifyEscrowHoldEvent;
|
|
11
|
+
}
|
|
12
|
+
export declare const runEscrowHoldReminders: (options?: RunEscrowHoldRemindersOptions) => Promise<EscrowHoldReminderResult>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Collection } from 'mongodb';
|
|
2
|
+
export declare const AUTH_SUBJECTS_COLLECTION = "authsubjects";
|
|
3
|
+
export interface AuthSubjectAttributes {
|
|
4
|
+
email?: string;
|
|
5
|
+
emailVerified: boolean;
|
|
6
|
+
displayName?: string;
|
|
7
|
+
pictureUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface MongoAuthSubjectType extends AuthSubjectAttributes {
|
|
10
|
+
subject: string;
|
|
11
|
+
identityKey: string;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
lastLoginAt: Date;
|
|
14
|
+
}
|
|
15
|
+
export declare const getAuthSubjectsCollection: () => Collection<MongoAuthSubjectType>;
|
|
16
|
+
export declare const createAuthSubjectIndexes: () => Promise<void>;
|
|
17
|
+
export declare const ensureAuthSubjectIndexes: () => Promise<void>;
|
|
18
|
+
export declare const getOrCreateAuthSubject: (identityKey: string, attrs: AuthSubjectAttributes) => Promise<MongoAuthSubjectType>;
|
|
19
|
+
export declare const getOrCreateAuthSubjectLinkedTo: (identityKey: string, subject: string, attrs: AuthSubjectAttributes) => Promise<MongoAuthSubjectType>;
|
|
20
|
+
export declare const findAuthSubjectByIdentityKey: (identityKey: string) => Promise<MongoAuthSubjectType | null>;
|