@learncard/lca-api-service 1.3.2 → 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 +99 -2
- package/AGENTS.md +155 -44
- package/CHANGELOG.md +84 -0
- package/bootstrapLambda.test.ts +76 -0
- package/compose.env +5 -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/accesslayer/signing-authority/index.d.ts +8 -2
- package/dist/app.d.ts +361 -8
- package/dist/cache/challenges.d.ts +2 -0
- 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/cache/recoverySessions.d.ts +42 -0
- package/dist/config/applyDockerStageConfig.d.ts +1 -0
- package/dist/config/cacheEnvironment.d.ts +16 -0
- package/dist/config/environment.d.ts +253 -2
- package/dist/config/environment.test.d.ts +1 -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/learnCard.signingAuthority.test.d.ts +1 -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/rateLimit.helpers.d.ts +4 -0
- package/dist/helpers/seedEncryption.helpers.d.ts +23 -0
- package/dist/helpers/seedEncryption.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/migrations/signingAuthoritySeeds.d.ts +13 -0
- package/dist/migrations/signingAuthoritySeedsCli.test.d.ts +1 -0
- package/dist/models/AuthSubject.d.ts +20 -0
- package/dist/models/EscrowHold.d.ts +153 -0
- package/dist/models/Notification.d.ts +5 -0
- package/dist/models/SigningAuthority.d.ts +7 -1
- package/dist/models/UserKey.d.ts +326 -3
- package/dist/models/UserKey.escrowPin.test.d.ts +1 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/oidc.d.ts +5 -0
- package/dist/routes/auth.d.ts +31 -0
- package/dist/routes/escrow.d.ts +164 -0
- package/dist/routes/index.d.ts +6 -0
- package/dist/routes/keys.d.ts +182 -7
- package/dist/routes/notifications.d.ts +5 -0
- package/dist/routes/qr-login.d.ts +1 -1
- 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 +25 -0
- package/dist/services/escrow-enclave/notifications.d.ts +24 -0
- 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 +27 -0
- package/dist/services/escrow-enclave/softwareEnclave.test.d.ts +1 -0
- package/dist/services/escrow-enclave/types.d.ts +111 -0
- package/dist/types/notifications.d.ts +5 -0
- package/dist/types/seed-encryption.d.ts +31 -0
- package/dist/types/seed-migration.d.ts +49 -0
- package/esbuildPlugins.cjs +1 -0
- package/lambda.ts +27 -112
- package/lambdaApp.ts +146 -0
- package/oidcLambda.test.ts +38 -0
- package/oidcLambda.ts +18 -0
- package/oidcLambdaApp.ts +11 -0
- package/package.json +30 -14
- package/scripts/README.md +88 -0
- package/scripts/check-seed-encryption-infrastructure.mjs +139 -0
- package/scripts/check-signing-authority-redis.mjs +93 -0
- 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/migrate-signing-authority-seeds-local.sh +51 -0
- package/scripts/migrate-signing-authority-seeds.mjs +105 -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 +40 -0
- package/seedMigrationLambda.ts +19 -0
- package/serverless-local.yml +28 -1
- package/serverless.function-env.cjs +58 -0
- package/serverless.yml +294 -26
- package/src/accesslayer/notifications/index.ts +9 -2
- package/src/accesslayer/signing-authority/create.ts +11 -7
- package/src/accesslayer/signing-authority/index.ts +4 -1
- package/src/app.ts +4 -0
- package/src/cache/challenges.ts +12 -2
- package/src/cache/getDel.test.ts +34 -0
- package/src/cache/getDel.ts +32 -0
- package/src/cache/in-memory-lru.ts +1 -0
- package/src/cache/index.ts +1 -1
- package/src/cache/login-tickets.ts +26 -0
- package/src/cache/recoverySessions.ts +252 -0
- package/src/config/applyDockerStageConfig.ts +6 -0
- package/src/config/cacheEnvironment.ts +34 -0
- package/src/config/environment.test.ts +159 -0
- package/src/config/environment.ts +164 -0
- 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 +13 -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/learnCard.helpers.test.ts +11 -1
- package/src/helpers/learnCard.helpers.ts +57 -45
- package/src/helpers/learnCard.signingAuthority.test.ts +194 -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/rateLimit.helpers.ts +112 -0
- package/src/helpers/seedEncryption.helpers.test.ts +427 -0
- package/src/helpers/seedEncryption.helpers.ts +372 -0
- package/src/helpers/signingAuthority.helpers.ts +4 -1
- 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/migrations/signingAuthoritySeeds.ts +430 -0
- package/src/migrations/signingAuthoritySeedsCli.test.ts +70 -0
- package/src/models/AuthSubject.ts +147 -0
- package/src/models/EscrowHold.ts +541 -0
- package/src/models/SigningAuthority.ts +14 -3
- package/src/models/UserKey.escrowPin.test.ts +49 -0
- package/src/models/UserKey.ts +1109 -40
- package/src/models/index.ts +2 -0
- package/src/models/pruneOrphanedRecoveryMethods.ts +3 -1
- package/src/oidc.ts +371 -0
- package/src/routes/auth.ts +173 -0
- package/src/routes/credentials.ts +8 -0
- package/src/routes/escrow.ts +1073 -0
- package/src/routes/firebase.ts +90 -48
- package/src/routes/index.ts +98 -5
- package/src/routes/keys.ts +1022 -174
- package/src/routes/qr-login.ts +51 -53
- package/src/routes/signing-authority.ts +39 -1
- package/src/services/delivery/adapters/postmark.adapter.ts +48 -1
- package/src/services/escrow-enclave/README.md +122 -0
- 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 +174 -0
- package/src/services/escrow-enclave/notifications.test.ts +377 -0
- package/src/services/escrow-enclave/notifications.ts +348 -0
- 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 +450 -0
- package/src/services/escrow-enclave/softwareEnclave.ts +254 -0
- package/src/services/escrow-enclave/types.ts +122 -0
- package/src/types/seed-encryption.ts +51 -0
- package/src/types/seed-migration.ts +61 -0
- package/test/auth-tickets.spec.ts +480 -0
- package/test/credentials.spec.ts +2 -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 +2328 -0
- package/test/keys-identity-rebind.spec.ts +456 -0
- package/test/keys-lifecycle-invariants.spec.ts +785 -0
- package/test/keys-recovery-confirmation.spec.ts +586 -0
- package/test/keys-recovery-rate-limit.spec.ts +123 -0
- package/test/keys-secret-leakage.spec.ts +265 -0
- package/test/models/authSubjectIndexes.spec.ts +132 -0
- package/test/models/escrow.spec.ts +572 -0
- 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-http.spec.ts +161 -0
- package/test/signing-authority-seed-migration.spec.ts +414 -0
- package/test/signing-authority.spec.ts +90 -0
- package/tsconfig.build.json +1 -1
- package/tsconfig.json +1 -0
- package/vitest.config.ts +24 -1
- package/vitest.integration.config.ts +25 -3
- package/dist/cache/signing-authority.d.ts +0 -6
- package/src/cache/signing-authority.ts +0 -37
|
@@ -6,8 +6,25 @@ 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;
|
|
14
|
+
SA_SEED_KMS_KEY_ARN: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
15
|
+
SA_SEED_LOCAL_KEK: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
16
|
+
SA_SEED_ENCRYPT_WRITES: 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
|
+
SA_SEED_ALLOW_LEGACY_READ: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
23
|
+
0: "0";
|
|
24
|
+
1: "1";
|
|
25
|
+
true: "true";
|
|
26
|
+
false: "false";
|
|
27
|
+
}>, z.ZodTransform<boolean, "0" | "1" | "true" | "false">>>>;
|
|
11
28
|
MONGO_URI: z.ZodString;
|
|
12
29
|
MONGO_DB_NAME: z.ZodString;
|
|
13
30
|
DOMAIN_NAME: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
@@ -18,6 +35,17 @@ export declare const lcaApiEnvironmentShape: {
|
|
|
18
35
|
OPENAI_API_KEY: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
19
36
|
METABASE_SECRET_KEY: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
20
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>>;
|
|
21
49
|
POSTMARK_SERVER_TOKEN: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
22
50
|
POSTMARK_FROM_EMAIL: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
23
51
|
POSTMARK_BRAND_NAME: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
@@ -25,6 +53,25 @@ export declare const lcaApiEnvironmentShape: {
|
|
|
25
53
|
POSTMARK_ENDORSEMENT_REQUEST_TEMPLATE_ALIAS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
26
54
|
POSTMARK_RECOVERY_EMAIL_CODE_TEMPLATE_ALIAS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
27
55
|
POSTMARK_RECOVERY_KEY_TEMPLATE_ALIAS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
56
|
+
ESCROW_RELAY_URL: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
57
|
+
ESCROW_RELAY_AUTH_TOKEN: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
58
|
+
ESCROW_ENCLAVE_MODE: z.ZodPipe<z.ZodPreprocess<z.ZodOptional<z.ZodString>>, z.ZodOptional<z.ZodEnum<{
|
|
59
|
+
software: "software";
|
|
60
|
+
remote: "remote";
|
|
61
|
+
}>>>;
|
|
62
|
+
ESCROW_ENCLAVE_SOFTWARE_PRIVATE_KEYS_JSON: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
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>;
|
|
73
|
+
ESCROW_HOLD_DURATION_MS: z.ZodPipe<z.ZodPipe<z.ZodPreprocess<z.ZodOptional<z.ZodString>>, z.ZodTransform<number, string | undefined>>, z.ZodNumber>;
|
|
74
|
+
ESCROW_HOLD_RESTART_MIN_AGE_MS: z.ZodPipe<z.ZodPipe<z.ZodPreprocess<z.ZodOptional<z.ZodString>>, z.ZodTransform<number, string | undefined>>, z.ZodNumber>;
|
|
28
75
|
ANDROID_PUSH_ICON: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
29
76
|
REDIS_HOST: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
30
77
|
REDIS_PORT: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
@@ -64,14 +111,31 @@ export declare const lcaApiEnvironmentShape: {
|
|
|
64
111
|
false: "false";
|
|
65
112
|
}>, z.ZodTransform<boolean, "0" | "1" | "true" | "false">>>>>;
|
|
66
113
|
};
|
|
67
|
-
export declare const lcaApiEnvironmentSchema: z.ZodObject<{
|
|
114
|
+
export declare const lcaApiEnvironmentSchema: z.ZodPipe<z.ZodObject<{
|
|
68
115
|
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
69
116
|
development: "development";
|
|
70
117
|
test: "test";
|
|
71
118
|
production: "production";
|
|
72
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>>;
|
|
73
123
|
PORT: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
74
124
|
SEED: z.ZodString;
|
|
125
|
+
SA_SEED_KMS_KEY_ARN: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
126
|
+
SA_SEED_LOCAL_KEK: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
127
|
+
SA_SEED_ENCRYPT_WRITES: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
128
|
+
0: "0";
|
|
129
|
+
1: "1";
|
|
130
|
+
true: "true";
|
|
131
|
+
false: "false";
|
|
132
|
+
}>, z.ZodTransform<boolean, "0" | "1" | "true" | "false">>>>;
|
|
133
|
+
SA_SEED_ALLOW_LEGACY_READ: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
134
|
+
0: "0";
|
|
135
|
+
1: "1";
|
|
136
|
+
true: "true";
|
|
137
|
+
false: "false";
|
|
138
|
+
}>, z.ZodTransform<boolean, "0" | "1" | "true" | "false">>>>;
|
|
75
139
|
MONGO_URI: z.ZodString;
|
|
76
140
|
MONGO_DB_NAME: z.ZodString;
|
|
77
141
|
DOMAIN_NAME: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
@@ -82,6 +146,17 @@ export declare const lcaApiEnvironmentSchema: z.ZodObject<{
|
|
|
82
146
|
OPENAI_API_KEY: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
83
147
|
METABASE_SECRET_KEY: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
84
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>>;
|
|
85
160
|
POSTMARK_SERVER_TOKEN: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
86
161
|
POSTMARK_FROM_EMAIL: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
87
162
|
POSTMARK_BRAND_NAME: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
@@ -89,6 +164,25 @@ export declare const lcaApiEnvironmentSchema: z.ZodObject<{
|
|
|
89
164
|
POSTMARK_ENDORSEMENT_REQUEST_TEMPLATE_ALIAS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
90
165
|
POSTMARK_RECOVERY_EMAIL_CODE_TEMPLATE_ALIAS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
91
166
|
POSTMARK_RECOVERY_KEY_TEMPLATE_ALIAS: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
167
|
+
ESCROW_RELAY_URL: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
168
|
+
ESCROW_RELAY_AUTH_TOKEN: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
169
|
+
ESCROW_ENCLAVE_MODE: z.ZodPipe<z.ZodPreprocess<z.ZodOptional<z.ZodString>>, z.ZodOptional<z.ZodEnum<{
|
|
170
|
+
software: "software";
|
|
171
|
+
remote: "remote";
|
|
172
|
+
}>>>;
|
|
173
|
+
ESCROW_ENCLAVE_SOFTWARE_PRIVATE_KEYS_JSON: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
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>;
|
|
184
|
+
ESCROW_HOLD_DURATION_MS: z.ZodPipe<z.ZodPipe<z.ZodPreprocess<z.ZodOptional<z.ZodString>>, z.ZodTransform<number, string | undefined>>, z.ZodNumber>;
|
|
185
|
+
ESCROW_HOLD_RESTART_MIN_AGE_MS: z.ZodPipe<z.ZodPipe<z.ZodPreprocess<z.ZodOptional<z.ZodString>>, z.ZodTransform<number, string | undefined>>, z.ZodNumber>;
|
|
92
186
|
ANDROID_PUSH_ICON: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
93
187
|
REDIS_HOST: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
94
188
|
REDIS_PORT: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
@@ -127,20 +221,158 @@ export declare const lcaApiEnvironmentSchema: z.ZodObject<{
|
|
|
127
221
|
true: "true";
|
|
128
222
|
false: "false";
|
|
129
223
|
}>, z.ZodTransform<boolean, "0" | "1" | "true" | "false">>>>>;
|
|
130
|
-
}, z.core.$strip
|
|
224
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
225
|
+
SA_SEED_ENCRYPT_WRITES: boolean;
|
|
226
|
+
SA_SEED_ALLOW_LEGACY_READ: boolean;
|
|
227
|
+
NODE_ENV: "development" | "test" | "production";
|
|
228
|
+
PORT: number;
|
|
229
|
+
SEED: string;
|
|
230
|
+
MONGO_URI: string;
|
|
231
|
+
MONGO_DB_NAME: string;
|
|
232
|
+
ESCROW_ENCLAVE_REMOTE_TIMEOUT_MS: number;
|
|
233
|
+
ESCROW_HOLD_DURATION_MS: number;
|
|
234
|
+
ESCROW_HOLD_RESTART_MIN_AGE_MS: number;
|
|
235
|
+
IS_OFFLINE: boolean;
|
|
236
|
+
IS_CI: boolean;
|
|
237
|
+
IS_E2E_TEST: boolean;
|
|
238
|
+
SKIP_DIDKIT_NAPI: boolean;
|
|
239
|
+
CI: boolean;
|
|
240
|
+
LAMBDA_STAGE?: string | undefined;
|
|
241
|
+
CONFIG_STAGE?: string | undefined;
|
|
242
|
+
RUNTIME_SECRETS_ID?: string | undefined;
|
|
243
|
+
SA_SEED_KMS_KEY_ARN?: string | undefined;
|
|
244
|
+
SA_SEED_LOCAL_KEK?: string | undefined;
|
|
245
|
+
DOMAIN_NAME?: string | undefined;
|
|
246
|
+
AUTHORIZED_DIDS?: string | undefined;
|
|
247
|
+
LEARN_CLOUD_URL?: string | undefined;
|
|
248
|
+
NETWORK_BRAIN_SERVICE_URL?: string | undefined;
|
|
249
|
+
GOOGLE_APPLICATION_CREDENTIAL?: string | undefined;
|
|
250
|
+
OPENAI_API_KEY?: string | undefined;
|
|
251
|
+
METABASE_SECRET_KEY?: string | undefined;
|
|
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;
|
|
264
|
+
POSTMARK_SERVER_TOKEN?: string | undefined;
|
|
265
|
+
POSTMARK_FROM_EMAIL?: string | undefined;
|
|
266
|
+
POSTMARK_BRAND_NAME?: string | undefined;
|
|
267
|
+
POSTMARK_LOGIN_CODE_TEMPLATE_ALIAS?: string | undefined;
|
|
268
|
+
POSTMARK_ENDORSEMENT_REQUEST_TEMPLATE_ALIAS?: string | undefined;
|
|
269
|
+
POSTMARK_RECOVERY_EMAIL_CODE_TEMPLATE_ALIAS?: string | undefined;
|
|
270
|
+
POSTMARK_RECOVERY_KEY_TEMPLATE_ALIAS?: string | undefined;
|
|
271
|
+
ESCROW_RELAY_URL?: string | undefined;
|
|
272
|
+
ESCROW_RELAY_AUTH_TOKEN?: string | undefined;
|
|
273
|
+
ESCROW_ENCLAVE_MODE?: "software" | "remote" | undefined;
|
|
274
|
+
ESCROW_ENCLAVE_SOFTWARE_PRIVATE_KEYS_JSON?: string | undefined;
|
|
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;
|
|
279
|
+
ANDROID_PUSH_ICON?: string | undefined;
|
|
280
|
+
REDIS_HOST?: string | undefined;
|
|
281
|
+
REDIS_PORT?: number | undefined;
|
|
282
|
+
NSO_DASHBOARD_ID?: number | undefined;
|
|
283
|
+
GLOBAL_DASHBOARD_ID?: number | undefined;
|
|
284
|
+
TROOP_DASHBOARD_ID?: number | undefined;
|
|
285
|
+
SENTRY_DSN?: string | undefined;
|
|
286
|
+
SENTRY_ENV?: string | undefined;
|
|
287
|
+
}, {
|
|
288
|
+
NODE_ENV: "development" | "test" | "production";
|
|
289
|
+
PORT: number;
|
|
290
|
+
SEED: string;
|
|
291
|
+
MONGO_URI: string;
|
|
292
|
+
MONGO_DB_NAME: string;
|
|
293
|
+
ESCROW_ENCLAVE_REMOTE_TIMEOUT_MS: number;
|
|
294
|
+
ESCROW_HOLD_DURATION_MS: number;
|
|
295
|
+
ESCROW_HOLD_RESTART_MIN_AGE_MS: number;
|
|
296
|
+
IS_OFFLINE: boolean;
|
|
297
|
+
IS_CI: boolean;
|
|
298
|
+
IS_E2E_TEST: boolean;
|
|
299
|
+
SKIP_DIDKIT_NAPI: boolean;
|
|
300
|
+
CI: boolean;
|
|
301
|
+
LAMBDA_STAGE?: string | undefined;
|
|
302
|
+
CONFIG_STAGE?: string | undefined;
|
|
303
|
+
RUNTIME_SECRETS_ID?: string | undefined;
|
|
304
|
+
SA_SEED_KMS_KEY_ARN?: string | undefined;
|
|
305
|
+
SA_SEED_LOCAL_KEK?: string | undefined;
|
|
306
|
+
SA_SEED_ENCRYPT_WRITES?: boolean | undefined;
|
|
307
|
+
SA_SEED_ALLOW_LEGACY_READ?: boolean | undefined;
|
|
308
|
+
DOMAIN_NAME?: string | undefined;
|
|
309
|
+
AUTHORIZED_DIDS?: string | undefined;
|
|
310
|
+
LEARN_CLOUD_URL?: string | undefined;
|
|
311
|
+
NETWORK_BRAIN_SERVICE_URL?: string | undefined;
|
|
312
|
+
GOOGLE_APPLICATION_CREDENTIAL?: string | undefined;
|
|
313
|
+
OPENAI_API_KEY?: string | undefined;
|
|
314
|
+
METABASE_SECRET_KEY?: string | undefined;
|
|
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;
|
|
327
|
+
POSTMARK_SERVER_TOKEN?: string | undefined;
|
|
328
|
+
POSTMARK_FROM_EMAIL?: string | undefined;
|
|
329
|
+
POSTMARK_BRAND_NAME?: string | undefined;
|
|
330
|
+
POSTMARK_LOGIN_CODE_TEMPLATE_ALIAS?: string | undefined;
|
|
331
|
+
POSTMARK_ENDORSEMENT_REQUEST_TEMPLATE_ALIAS?: string | undefined;
|
|
332
|
+
POSTMARK_RECOVERY_EMAIL_CODE_TEMPLATE_ALIAS?: string | undefined;
|
|
333
|
+
POSTMARK_RECOVERY_KEY_TEMPLATE_ALIAS?: string | undefined;
|
|
334
|
+
ESCROW_RELAY_URL?: string | undefined;
|
|
335
|
+
ESCROW_RELAY_AUTH_TOKEN?: string | undefined;
|
|
336
|
+
ESCROW_ENCLAVE_MODE?: "software" | "remote" | undefined;
|
|
337
|
+
ESCROW_ENCLAVE_SOFTWARE_PRIVATE_KEYS_JSON?: string | undefined;
|
|
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;
|
|
342
|
+
ANDROID_PUSH_ICON?: string | undefined;
|
|
343
|
+
REDIS_HOST?: string | undefined;
|
|
344
|
+
REDIS_PORT?: number | undefined;
|
|
345
|
+
NSO_DASHBOARD_ID?: number | undefined;
|
|
346
|
+
GLOBAL_DASHBOARD_ID?: number | undefined;
|
|
347
|
+
TROOP_DASHBOARD_ID?: number | undefined;
|
|
348
|
+
SENTRY_DSN?: string | undefined;
|
|
349
|
+
SENTRY_ENV?: string | undefined;
|
|
350
|
+
}>>;
|
|
131
351
|
export type LcaApiEnvironment = z.output<typeof lcaApiEnvironmentSchema>;
|
|
132
352
|
export declare const parseLcaApiEnvironment: (raw: Record<string, unknown>, source?: string) => LcaApiEnvironment;
|
|
353
|
+
export declare const isEscrowReleaseKillSwitchEnabled: () => boolean;
|
|
354
|
+
export declare const parseEscrowPrivateKeys: (serialized: string) => Record<string, string>;
|
|
133
355
|
export declare const environment: {
|
|
356
|
+
SA_SEED_ENCRYPT_WRITES: boolean;
|
|
357
|
+
SA_SEED_ALLOW_LEGACY_READ: boolean;
|
|
134
358
|
NODE_ENV: "development" | "test" | "production";
|
|
135
359
|
PORT: number;
|
|
136
360
|
SEED: string;
|
|
137
361
|
MONGO_URI: string;
|
|
138
362
|
MONGO_DB_NAME: string;
|
|
363
|
+
ESCROW_ENCLAVE_REMOTE_TIMEOUT_MS: number;
|
|
364
|
+
ESCROW_HOLD_DURATION_MS: number;
|
|
365
|
+
ESCROW_HOLD_RESTART_MIN_AGE_MS: number;
|
|
139
366
|
IS_OFFLINE: boolean;
|
|
140
367
|
IS_CI: boolean;
|
|
141
368
|
IS_E2E_TEST: boolean;
|
|
142
369
|
SKIP_DIDKIT_NAPI: boolean;
|
|
143
370
|
CI: boolean;
|
|
371
|
+
LAMBDA_STAGE?: string | undefined;
|
|
372
|
+
CONFIG_STAGE?: string | undefined;
|
|
373
|
+
RUNTIME_SECRETS_ID?: string | undefined;
|
|
374
|
+
SA_SEED_KMS_KEY_ARN?: string | undefined;
|
|
375
|
+
SA_SEED_LOCAL_KEK?: string | undefined;
|
|
144
376
|
DOMAIN_NAME?: string | undefined;
|
|
145
377
|
AUTHORIZED_DIDS?: string | undefined;
|
|
146
378
|
LEARN_CLOUD_URL?: string | undefined;
|
|
@@ -149,6 +381,17 @@ export declare const environment: {
|
|
|
149
381
|
OPENAI_API_KEY?: string | undefined;
|
|
150
382
|
METABASE_SECRET_KEY?: string | undefined;
|
|
151
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;
|
|
152
395
|
POSTMARK_SERVER_TOKEN?: string | undefined;
|
|
153
396
|
POSTMARK_FROM_EMAIL?: string | undefined;
|
|
154
397
|
POSTMARK_BRAND_NAME?: string | undefined;
|
|
@@ -156,6 +399,14 @@ export declare const environment: {
|
|
|
156
399
|
POSTMARK_ENDORSEMENT_REQUEST_TEMPLATE_ALIAS?: string | undefined;
|
|
157
400
|
POSTMARK_RECOVERY_EMAIL_CODE_TEMPLATE_ALIAS?: string | undefined;
|
|
158
401
|
POSTMARK_RECOVERY_KEY_TEMPLATE_ALIAS?: string | undefined;
|
|
402
|
+
ESCROW_RELAY_URL?: string | undefined;
|
|
403
|
+
ESCROW_RELAY_AUTH_TOKEN?: string | undefined;
|
|
404
|
+
ESCROW_ENCLAVE_MODE?: "software" | "remote" | undefined;
|
|
405
|
+
ESCROW_ENCLAVE_SOFTWARE_PRIVATE_KEYS_JSON?: string | undefined;
|
|
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;
|
|
159
410
|
ANDROID_PUSH_ICON?: string | undefined;
|
|
160
411
|
REDIS_HOST?: string | undefined;
|
|
161
412
|
REDIS_PORT?: number | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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,4 @@
|
|
|
1
|
+
export declare const checkRateLimit: (key: string, maxAttempts: number, windowSeconds: number, prefix?: string) => Promise<boolean>;
|
|
2
|
+
export declare const getRateLimitCount: (key: string, prefix?: string) => Promise<number>;
|
|
3
|
+
export declare const clearRateLimit: (key: string, prefix?: string) => Promise<void>;
|
|
4
|
+
export declare const decrementRateLimit: (key: string, prefix?: string) => Promise<void>;
|