@opendatalabs/personal-server-ts-core 0.0.1-canary.00328bf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.d.ts +408 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +1257 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/raw-envelope.d.ts +3 -0
- package/dist/api/raw-envelope.d.ts.map +1 -0
- package/dist/api/raw-envelope.js +215 -0
- package/dist/api/raw-envelope.js.map +1 -0
- package/dist/auth/index.d.ts +2 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +2 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/request.d.ts +28 -0
- package/dist/auth/request.d.ts.map +1 -0
- package/dist/auth/request.js +106 -0
- package/dist/auth/request.js.map +1 -0
- package/dist/client.d.ts +233 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +243 -0
- package/dist/client.js.map +1 -0
- package/dist/config/defaults.d.ts +12 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +12 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +3 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/paths.d.ts +9 -0
- package/dist/config/paths.d.ts.map +1 -0
- package/dist/config/paths.js +14 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/contracts/access-logs.d.ts +8 -0
- package/dist/contracts/access-logs.d.ts.map +1 -0
- package/dist/contracts/access-logs.js +7 -0
- package/dist/contracts/access-logs.js.map +1 -0
- package/dist/contracts/auth-device.d.ts +70 -0
- package/dist/contracts/auth-device.d.ts.map +1 -0
- package/dist/contracts/auth-device.js +163 -0
- package/dist/contracts/auth-device.js.map +1 -0
- package/dist/contracts/binary.d.ts +66 -0
- package/dist/contracts/binary.d.ts.map +1 -0
- package/dist/contracts/binary.js +123 -0
- package/dist/contracts/binary.js.map +1 -0
- package/dist/contracts/config.d.ts +5 -0
- package/dist/contracts/config.d.ts.map +1 -0
- package/dist/contracts/config.js +30 -0
- package/dist/contracts/config.js.map +1 -0
- package/dist/contracts/data.d.ts +165 -0
- package/dist/contracts/data.d.ts.map +1 -0
- package/dist/contracts/data.js +371 -0
- package/dist/contracts/data.js.map +1 -0
- package/dist/contracts/grants.d.ts +45 -0
- package/dist/contracts/grants.d.ts.map +1 -0
- package/dist/contracts/grants.js +177 -0
- package/dist/contracts/grants.js.map +1 -0
- package/dist/contracts/http.d.ts +21 -0
- package/dist/contracts/http.d.ts.map +1 -0
- package/dist/contracts/http.js +49 -0
- package/dist/contracts/http.js.map +1 -0
- package/dist/contracts/index.d.ts +16 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +10 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/oauth.d.ts +38 -0
- package/dist/contracts/oauth.d.ts.map +1 -0
- package/dist/contracts/oauth.js +130 -0
- package/dist/contracts/oauth.js.map +1 -0
- package/dist/contracts/sync.d.ts +10 -0
- package/dist/contracts/sync.d.ts.map +1 -0
- package/dist/contracts/sync.js +35 -0
- package/dist/contracts/sync.js.map +1 -0
- package/dist/derivatives/answer-shape.d.ts +83 -0
- package/dist/derivatives/answer-shape.d.ts.map +1 -0
- package/dist/derivatives/answer-shape.js +320 -0
- package/dist/derivatives/answer-shape.js.map +1 -0
- package/dist/derivatives/api.d.ts +48 -0
- package/dist/derivatives/api.d.ts.map +1 -0
- package/dist/derivatives/api.js +374 -0
- package/dist/derivatives/api.js.map +1 -0
- package/dist/derivatives/compute.d.ts +112 -0
- package/dist/derivatives/compute.d.ts.map +1 -0
- package/dist/derivatives/compute.js +476 -0
- package/dist/derivatives/compute.js.map +1 -0
- package/dist/derivatives/e2ee/aad.d.ts +22 -0
- package/dist/derivatives/e2ee/aad.d.ts.map +1 -0
- package/dist/derivatives/e2ee/aad.js +32 -0
- package/dist/derivatives/e2ee/aad.js.map +1 -0
- package/dist/derivatives/e2ee/attestation.d.ts +134 -0
- package/dist/derivatives/e2ee/attestation.d.ts.map +1 -0
- package/dist/derivatives/e2ee/attestation.js +248 -0
- package/dist/derivatives/e2ee/attestation.js.map +1 -0
- package/dist/derivatives/e2ee/index.d.ts +6 -0
- package/dist/derivatives/e2ee/index.d.ts.map +1 -0
- package/dist/derivatives/e2ee/index.js +6 -0
- package/dist/derivatives/e2ee/index.js.map +1 -0
- package/dist/derivatives/e2ee/jcs.d.ts +17 -0
- package/dist/derivatives/e2ee/jcs.d.ts.map +1 -0
- package/dist/derivatives/e2ee/jcs.js +55 -0
- package/dist/derivatives/e2ee/jcs.js.map +1 -0
- package/dist/derivatives/e2ee/phala.d.ts +62 -0
- package/dist/derivatives/e2ee/phala.d.ts.map +1 -0
- package/dist/derivatives/e2ee/phala.js +168 -0
- package/dist/derivatives/e2ee/phala.js.map +1 -0
- package/dist/derivatives/e2ee/suite.d.ts +56 -0
- package/dist/derivatives/e2ee/suite.d.ts.map +1 -0
- package/dist/derivatives/e2ee/suite.js +164 -0
- package/dist/derivatives/e2ee/suite.js.map +1 -0
- package/dist/derivatives/index.d.ts +11 -0
- package/dist/derivatives/index.d.ts.map +1 -0
- package/dist/derivatives/index.js +11 -0
- package/dist/derivatives/index.js.map +1 -0
- package/dist/derivatives/inference.d.ts +151 -0
- package/dist/derivatives/inference.d.ts.map +1 -0
- package/dist/derivatives/inference.js +262 -0
- package/dist/derivatives/inference.js.map +1 -0
- package/dist/derivatives/prompt.d.ts +99 -0
- package/dist/derivatives/prompt.d.ts.map +1 -0
- package/dist/derivatives/prompt.js +281 -0
- package/dist/derivatives/prompt.js.map +1 -0
- package/dist/derivatives/registration.d.ts +56 -0
- package/dist/derivatives/registration.d.ts.map +1 -0
- package/dist/derivatives/registration.js +187 -0
- package/dist/derivatives/registration.js.map +1 -0
- package/dist/derivatives/scheduler.d.ts +114 -0
- package/dist/derivatives/scheduler.d.ts.map +1 -0
- package/dist/derivatives/scheduler.js +331 -0
- package/dist/derivatives/scheduler.js.map +1 -0
- package/dist/derivatives/store.d.ts +14 -0
- package/dist/derivatives/store.d.ts.map +1 -0
- package/dist/derivatives/store.js +79 -0
- package/dist/derivatives/store.js.map +1 -0
- package/dist/derivatives/types.d.ts +102 -0
- package/dist/derivatives/types.d.ts.map +1 -0
- package/dist/derivatives/types.js +29 -0
- package/dist/derivatives/types.js.map +1 -0
- package/dist/errors/catalog.d.ts +125 -0
- package/dist/errors/catalog.d.ts.map +1 -0
- package/dist/errors/catalog.js +198 -0
- package/dist/errors/catalog.js.map +1 -0
- package/dist/errors/pdpp-catalog.d.ts +36 -0
- package/dist/errors/pdpp-catalog.d.ts.map +1 -0
- package/dist/errors/pdpp-catalog.js +82 -0
- package/dist/errors/pdpp-catalog.js.map +1 -0
- package/dist/grants/index.d.ts +5 -0
- package/dist/grants/index.d.ts.map +1 -0
- package/dist/grants/index.js +6 -0
- package/dist/grants/index.js.map +1 -0
- package/dist/grants/pdpp-binding-store.d.ts +58 -0
- package/dist/grants/pdpp-binding-store.d.ts.map +1 -0
- package/dist/grants/pdpp-binding-store.js +97 -0
- package/dist/grants/pdpp-binding-store.js.map +1 -0
- package/dist/grants/pdpp-binding.d.ts +179 -0
- package/dist/grants/pdpp-binding.d.ts.map +1 -0
- package/dist/grants/pdpp-binding.js +214 -0
- package/dist/grants/pdpp-binding.js.map +1 -0
- package/dist/keys/index.d.ts +3 -0
- package/dist/keys/index.d.ts.map +1 -0
- package/dist/keys/index.js +2 -0
- package/dist/keys/index.js.map +1 -0
- package/dist/keys/public-only-account.d.ts +8 -0
- package/dist/keys/public-only-account.d.ts.map +1 -0
- package/dist/keys/public-only-account.js +21 -0
- package/dist/keys/public-only-account.js.map +1 -0
- package/dist/keys/server-account.d.ts +24 -0
- package/dist/keys/server-account.d.ts.map +1 -0
- package/dist/keys/server-account.js +2 -0
- package/dist/keys/server-account.js.map +1 -0
- package/dist/lineage/attestation.d.ts +42 -0
- package/dist/lineage/attestation.d.ts.map +1 -0
- package/dist/lineage/attestation.js +25 -0
- package/dist/lineage/attestation.js.map +1 -0
- package/dist/lineage/gateway.d.ts +105 -0
- package/dist/lineage/gateway.d.ts.map +1 -0
- package/dist/lineage/gateway.js +242 -0
- package/dist/lineage/gateway.js.map +1 -0
- package/dist/lineage/index.d.ts +5 -0
- package/dist/lineage/index.d.ts.map +1 -0
- package/dist/lineage/index.js +5 -0
- package/dist/lineage/index.js.map +1 -0
- package/dist/lineage/lineage.d.ts +141 -0
- package/dist/lineage/lineage.d.ts.map +1 -0
- package/dist/lineage/lineage.js +255 -0
- package/dist/lineage/lineage.js.map +1 -0
- package/dist/logger/index.d.ts +9 -0
- package/dist/logger/index.d.ts.map +1 -0
- package/dist/logger/index.js +5 -0
- package/dist/logger/index.js.map +1 -0
- package/dist/logging/access-log.d.ts +23 -0
- package/dist/logging/access-log.d.ts.map +1 -0
- package/dist/logging/access-log.js +2 -0
- package/dist/logging/access-log.js.map +1 -0
- package/dist/logging/access-reader.d.ts +14 -0
- package/dist/logging/access-reader.d.ts.map +1 -0
- package/dist/logging/access-reader.js +2 -0
- package/dist/logging/access-reader.js.map +1 -0
- package/dist/mcp/activity.d.ts +68 -0
- package/dist/mcp/activity.d.ts.map +1 -0
- package/dist/mcp/activity.js +111 -0
- package/dist/mcp/activity.js.map +1 -0
- package/dist/mcp/builder-registration.d.ts +24 -0
- package/dist/mcp/builder-registration.d.ts.map +1 -0
- package/dist/mcp/builder-registration.js +89 -0
- package/dist/mcp/builder-registration.js.map +1 -0
- package/dist/mcp/connection-api.d.ts +201 -0
- package/dist/mcp/connection-api.d.ts.map +1 -0
- package/dist/mcp/connection-api.js +506 -0
- package/dist/mcp/connection-api.js.map +1 -0
- package/dist/mcp/grantee.d.ts +52 -0
- package/dist/mcp/grantee.d.ts.map +1 -0
- package/dist/mcp/grantee.js +91 -0
- package/dist/mcp/grantee.js.map +1 -0
- package/dist/mcp/index.d.ts +12 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +12 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/read-client.d.ts +176 -0
- package/dist/mcp/read-client.d.ts.map +1 -0
- package/dist/mcp/read-client.js +579 -0
- package/dist/mcp/read-client.js.map +1 -0
- package/dist/mcp/resources.d.ts +37 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +114 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/search/index.d.ts +34 -0
- package/dist/mcp/search/index.d.ts.map +1 -0
- package/dist/mcp/search/index.js +156 -0
- package/dist/mcp/search/index.js.map +1 -0
- package/dist/mcp/server.d.ts +72 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +447 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/session.d.ts +160 -0
- package/dist/mcp/session.d.ts.map +1 -0
- package/dist/mcp/session.js +243 -0
- package/dist/mcp/session.js.map +1 -0
- package/dist/mcp/store.d.ts +13 -0
- package/dist/mcp/store.d.ts.map +1 -0
- package/dist/mcp/store.js +119 -0
- package/dist/mcp/store.js.map +1 -0
- package/dist/mcp/token-expiry.d.ts +38 -0
- package/dist/mcp/token-expiry.d.ts.map +1 -0
- package/dist/mcp/token-expiry.js +55 -0
- package/dist/mcp/token-expiry.js.map +1 -0
- package/dist/mcp/tools.d.ts +95 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +1381 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/types.d.ts +135 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +24 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/payment/index.d.ts +2 -0
- package/dist/payment/index.d.ts.map +1 -0
- package/dist/payment/index.js +2 -0
- package/dist/payment/index.js.map +1 -0
- package/dist/payment/x402.d.ts +155 -0
- package/dist/payment/x402.d.ts.map +1 -0
- package/dist/payment/x402.js +402 -0
- package/dist/payment/x402.js.map +1 -0
- package/dist/pdpp/approval.d.ts +182 -0
- package/dist/pdpp/approval.d.ts.map +1 -0
- package/dist/pdpp/approval.js +337 -0
- package/dist/pdpp/approval.js.map +1 -0
- package/dist/pdpp/client-identity.d.ts +88 -0
- package/dist/pdpp/client-identity.d.ts.map +1 -0
- package/dist/pdpp/client-identity.js +183 -0
- package/dist/pdpp/client-identity.js.map +1 -0
- package/dist/pdpp/client-metadata.d.ts +95 -0
- package/dist/pdpp/client-metadata.d.ts.map +1 -0
- package/dist/pdpp/client-metadata.js +96 -0
- package/dist/pdpp/client-metadata.js.map +1 -0
- package/dist/pdpp/declaration.d.ts +118 -0
- package/dist/pdpp/declaration.d.ts.map +1 -0
- package/dist/pdpp/declaration.js +549 -0
- package/dist/pdpp/declaration.js.map +1 -0
- package/dist/pdpp/index.d.ts +35 -0
- package/dist/pdpp/index.d.ts.map +1 -0
- package/dist/pdpp/index.js +22 -0
- package/dist/pdpp/index.js.map +1 -0
- package/dist/pdpp/issuance.d.ts +91 -0
- package/dist/pdpp/issuance.d.ts.map +1 -0
- package/dist/pdpp/issuance.js +124 -0
- package/dist/pdpp/issuance.js.map +1 -0
- package/dist/pdpp/pkce.d.ts +53 -0
- package/dist/pdpp/pkce.d.ts.map +1 -0
- package/dist/pdpp/pkce.js +109 -0
- package/dist/pdpp/pkce.js.map +1 -0
- package/dist/pdpp/redirect.d.ts +60 -0
- package/dist/pdpp/redirect.d.ts.map +1 -0
- package/dist/pdpp/redirect.js +125 -0
- package/dist/pdpp/redirect.js.map +1 -0
- package/dist/pdpp/resolve.d.ts +53 -0
- package/dist/pdpp/resolve.d.ts.map +1 -0
- package/dist/pdpp/resolve.js +218 -0
- package/dist/pdpp/resolve.js.map +1 -0
- package/dist/pdpp/review.d.ts +155 -0
- package/dist/pdpp/review.d.ts.map +1 -0
- package/dist/pdpp/review.js +142 -0
- package/dist/pdpp/review.js.map +1 -0
- package/dist/pdpp/selection.d.ts +43 -0
- package/dist/pdpp/selection.d.ts.map +1 -0
- package/dist/pdpp/selection.js +211 -0
- package/dist/pdpp/selection.js.map +1 -0
- package/dist/pdpp/store.d.ts +204 -0
- package/dist/pdpp/store.d.ts.map +1 -0
- package/dist/pdpp/store.js +501 -0
- package/dist/pdpp/store.js.map +1 -0
- package/dist/pdpp/tokens.d.ts +149 -0
- package/dist/pdpp/tokens.d.ts.map +1 -0
- package/dist/pdpp/tokens.js +387 -0
- package/dist/pdpp/tokens.js.map +1 -0
- package/dist/pdpp/types.d.ts +258 -0
- package/dist/pdpp/types.d.ts.map +1 -0
- package/dist/pdpp/types.js +40 -0
- package/dist/pdpp/types.js.map +1 -0
- package/dist/pdpp-version.d.ts +28 -0
- package/dist/pdpp-version.d.ts.map +1 -0
- package/dist/pdpp-version.js +28 -0
- package/dist/pdpp-version.js.map +1 -0
- package/dist/policy/data-read.d.ts +56 -0
- package/dist/policy/data-read.d.ts.map +1 -0
- package/dist/policy/data-read.js +176 -0
- package/dist/policy/data-read.js.map +1 -0
- package/dist/policy/data-write.d.ts +69 -0
- package/dist/policy/data-write.d.ts.map +1 -0
- package/dist/policy/data-write.js +131 -0
- package/dist/policy/data-write.js.map +1 -0
- package/dist/policy/index.d.ts +4 -0
- package/dist/policy/index.d.ts.map +1 -0
- package/dist/policy/index.js +4 -0
- package/dist/policy/index.js.map +1 -0
- package/dist/policy/signed-artifacts.d.ts +17 -0
- package/dist/policy/signed-artifacts.d.ts.map +1 -0
- package/dist/policy/signed-artifacts.js +110 -0
- package/dist/policy/signed-artifacts.js.map +1 -0
- package/dist/ports/index.d.ts +243 -0
- package/dist/ports/index.d.ts.map +1 -0
- package/dist/ports/index.js +7 -0
- package/dist/ports/index.js.map +1 -0
- package/dist/ports/pdpp-auth.d.ts +103 -0
- package/dist/ports/pdpp-auth.d.ts.map +1 -0
- package/dist/ports/pdpp-auth.js +37 -0
- package/dist/ports/pdpp-auth.js.map +1 -0
- package/dist/ports/pdpp-auth.test-utils.d.ts +9 -0
- package/dist/ports/pdpp-auth.test-utils.d.ts.map +1 -0
- package/dist/ports/pdpp-auth.test-utils.js +18 -0
- package/dist/ports/pdpp-auth.test-utils.js.map +1 -0
- package/dist/schemas/server-config.d.ts +190 -0
- package/dist/schemas/server-config.d.ts.map +1 -0
- package/dist/schemas/server-config.js +282 -0
- package/dist/schemas/server-config.js.map +1 -0
- package/dist/signing/index.d.ts +3 -0
- package/dist/signing/index.d.ts.map +1 -0
- package/dist/signing/index.js +3 -0
- package/dist/signing/index.js.map +1 -0
- package/dist/signing/request-signer.d.ts +20 -0
- package/dist/signing/request-signer.d.ts.map +1 -0
- package/dist/signing/request-signer.js +23 -0
- package/dist/signing/request-signer.js.map +1 -0
- package/dist/signing/signer.d.ts +40 -0
- package/dist/signing/signer.d.ts.map +1 -0
- package/dist/signing/signer.js +56 -0
- package/dist/signing/signer.js.map +1 -0
- package/dist/storage/adapters/index.d.ts +4 -0
- package/dist/storage/adapters/index.d.ts.map +1 -0
- package/dist/storage/adapters/index.js +3 -0
- package/dist/storage/adapters/index.js.map +1 -0
- package/dist/storage/adapters/interface.d.ts +57 -0
- package/dist/storage/adapters/interface.d.ts.map +1 -0
- package/dist/storage/adapters/interface.js +2 -0
- package/dist/storage/adapters/interface.js.map +1 -0
- package/dist/storage/adapters/sdk.d.ts +23 -0
- package/dist/storage/adapters/sdk.d.ts.map +1 -0
- package/dist/storage/adapters/sdk.js +73 -0
- package/dist/storage/adapters/sdk.js.map +1 -0
- package/dist/storage/adapters/vana.d.ts +12 -0
- package/dist/storage/adapters/vana.d.ts.map +1 -0
- package/dist/storage/adapters/vana.js +111 -0
- package/dist/storage/adapters/vana.js.map +1 -0
- package/dist/storage/blocks/build.d.ts +20 -0
- package/dist/storage/blocks/build.d.ts.map +1 -0
- package/dist/storage/blocks/build.js +378 -0
- package/dist/storage/blocks/build.js.map +1 -0
- package/dist/storage/blocks/cursor.d.ts +33 -0
- package/dist/storage/blocks/cursor.d.ts.map +1 -0
- package/dist/storage/blocks/cursor.js +142 -0
- package/dist/storage/blocks/cursor.js.map +1 -0
- package/dist/storage/blocks/errors.d.ts +6 -0
- package/dist/storage/blocks/errors.d.ts.map +1 -0
- package/dist/storage/blocks/errors.js +9 -0
- package/dist/storage/blocks/errors.js.map +1 -0
- package/dist/storage/blocks/index.d.ts +6 -0
- package/dist/storage/blocks/index.d.ts.map +1 -0
- package/dist/storage/blocks/index.js +5 -0
- package/dist/storage/blocks/index.js.map +1 -0
- package/dist/storage/blocks/select.d.ts +29 -0
- package/dist/storage/blocks/select.d.ts.map +1 -0
- package/dist/storage/blocks/select.js +120 -0
- package/dist/storage/blocks/select.js.map +1 -0
- package/dist/storage/blocks/types.d.ts +56 -0
- package/dist/storage/blocks/types.d.ts.map +1 -0
- package/dist/storage/blocks/types.js +2 -0
- package/dist/storage/blocks/types.js.map +1 -0
- package/dist/storage/hierarchy/index.d.ts +3 -0
- package/dist/storage/hierarchy/index.d.ts.map +1 -0
- package/dist/storage/hierarchy/index.js +2 -0
- package/dist/storage/hierarchy/index.js.map +1 -0
- package/dist/storage/hierarchy/manager.d.ts +9 -0
- package/dist/storage/hierarchy/manager.d.ts.map +1 -0
- package/dist/storage/hierarchy/manager.js +2 -0
- package/dist/storage/hierarchy/manager.js.map +1 -0
- package/dist/storage/hierarchy/paths.d.ts +11 -0
- package/dist/storage/hierarchy/paths.d.ts.map +1 -0
- package/dist/storage/hierarchy/paths.js +43 -0
- package/dist/storage/hierarchy/paths.js.map +1 -0
- package/dist/storage/index/index.d.ts +3 -0
- package/dist/storage/index/index.d.ts.map +1 -0
- package/dist/storage/index/index.js +2 -0
- package/dist/storage/index/index.js.map +1 -0
- package/dist/storage/index/manager.d.ts +63 -0
- package/dist/storage/index/manager.d.ts.map +1 -0
- package/dist/storage/index/manager.js +2 -0
- package/dist/storage/index/manager.js.map +1 -0
- package/dist/storage/index/schema.d.ts +2 -0
- package/dist/storage/index/schema.d.ts.map +1 -0
- package/dist/storage/index/schema.js +2 -0
- package/dist/storage/index/schema.js.map +1 -0
- package/dist/storage/index/types.d.ts +37 -0
- package/dist/storage/index/types.d.ts.map +1 -0
- package/dist/storage/index/types.js +2 -0
- package/dist/storage/index/types.js.map +1 -0
- package/dist/storage/pdpp-records/cursor.d.ts +27 -0
- package/dist/storage/pdpp-records/cursor.d.ts.map +1 -0
- package/dist/storage/pdpp-records/cursor.js +49 -0
- package/dist/storage/pdpp-records/cursor.js.map +1 -0
- package/dist/storage/pdpp-records/enforcement.d.ts +37 -0
- package/dist/storage/pdpp-records/enforcement.d.ts.map +1 -0
- package/dist/storage/pdpp-records/enforcement.js +79 -0
- package/dist/storage/pdpp-records/enforcement.js.map +1 -0
- package/dist/storage/pdpp-records/index.d.ts +8 -0
- package/dist/storage/pdpp-records/index.d.ts.map +1 -0
- package/dist/storage/pdpp-records/index.js +8 -0
- package/dist/storage/pdpp-records/index.js.map +1 -0
- package/dist/storage/pdpp-records/interface.d.ts +49 -0
- package/dist/storage/pdpp-records/interface.d.ts.map +1 -0
- package/dist/storage/pdpp-records/interface.js +2 -0
- package/dist/storage/pdpp-records/interface.js.map +1 -0
- package/dist/storage/pdpp-records/memory-store.d.ts +9 -0
- package/dist/storage/pdpp-records/memory-store.d.ts.map +1 -0
- package/dist/storage/pdpp-records/memory-store.js +0 -0
- package/dist/storage/pdpp-records/memory-store.js.map +1 -0
- package/dist/storage/pdpp-records/record-key.d.ts +52 -0
- package/dist/storage/pdpp-records/record-key.d.ts.map +1 -0
- package/dist/storage/pdpp-records/record-key.js +97 -0
- package/dist/storage/pdpp-records/record-key.js.map +1 -0
- package/dist/storage/pdpp-records/stream-declaration.d.ts +43 -0
- package/dist/storage/pdpp-records/stream-declaration.d.ts.map +1 -0
- package/dist/storage/pdpp-records/stream-declaration.js +17 -0
- package/dist/storage/pdpp-records/stream-declaration.js.map +1 -0
- package/dist/storage/pdpp-records/types.d.ts +93 -0
- package/dist/storage/pdpp-records/types.d.ts.map +1 -0
- package/dist/storage/pdpp-records/types.js +17 -0
- package/dist/storage/pdpp-records/types.js.map +1 -0
- package/dist/storage/preview.d.ts +12 -0
- package/dist/storage/preview.d.ts.map +1 -0
- package/dist/storage/preview.js +239 -0
- package/dist/storage/preview.js.map +1 -0
- package/dist/sync/cursor.d.ts +10 -0
- package/dist/sync/cursor.d.ts.map +1 -0
- package/dist/sync/cursor.js +2 -0
- package/dist/sync/cursor.js.map +1 -0
- package/dist/sync/data-point-feed.d.ts +35 -0
- package/dist/sync/data-point-feed.d.ts.map +1 -0
- package/dist/sync/data-point-feed.js +122 -0
- package/dist/sync/data-point-feed.js.map +1 -0
- package/dist/sync/data-point-id.d.ts +7 -0
- package/dist/sync/data-point-id.d.ts.map +1 -0
- package/dist/sync/data-point-id.js +16 -0
- package/dist/sync/data-point-id.js.map +1 -0
- package/dist/sync/delete-data-port.d.ts +50 -0
- package/dist/sync/delete-data-port.d.ts.map +1 -0
- package/dist/sync/delete-data-port.js +244 -0
- package/dist/sync/delete-data-port.js.map +1 -0
- package/dist/sync/engine/sync-manager.d.ts +58 -0
- package/dist/sync/engine/sync-manager.d.ts.map +1 -0
- package/dist/sync/engine/sync-manager.js +285 -0
- package/dist/sync/engine/sync-manager.js.map +1 -0
- package/dist/sync/index.d.ts +15 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +14 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/issues.d.ts +55 -0
- package/dist/sync/issues.d.ts.map +1 -0
- package/dist/sync/issues.js +168 -0
- package/dist/sync/issues.js.map +1 -0
- package/dist/sync/pdpp-import.d.ts +192 -0
- package/dist/sync/pdpp-import.d.ts.map +1 -0
- package/dist/sync/pdpp-import.js +422 -0
- package/dist/sync/pdpp-import.js.map +1 -0
- package/dist/sync/pending-blob-deletions.d.ts +29 -0
- package/dist/sync/pending-blob-deletions.d.ts.map +1 -0
- package/dist/sync/pending-blob-deletions.js +116 -0
- package/dist/sync/pending-blob-deletions.js.map +1 -0
- package/dist/sync/retry-memory.d.ts +33 -0
- package/dist/sync/retry-memory.d.ts.map +1 -0
- package/dist/sync/retry-memory.js +68 -0
- package/dist/sync/retry-memory.js.map +1 -0
- package/dist/sync/scope-deletions.d.ts +155 -0
- package/dist/sync/scope-deletions.d.ts.map +1 -0
- package/dist/sync/scope-deletions.js +225 -0
- package/dist/sync/scope-deletions.js.map +1 -0
- package/dist/sync/tombstone.d.ts +27 -0
- package/dist/sync/tombstone.d.ts.map +1 -0
- package/dist/sync/tombstone.js +28 -0
- package/dist/sync/tombstone.js.map +1 -0
- package/dist/sync/types.d.ts +27 -0
- package/dist/sync/types.d.ts.map +1 -0
- package/dist/sync/types.js +2 -0
- package/dist/sync/types.js.map +1 -0
- package/dist/sync/workers/delete.d.ts +163 -0
- package/dist/sync/workers/delete.d.ts.map +1 -0
- package/dist/sync/workers/delete.js +474 -0
- package/dist/sync/workers/delete.js.map +1 -0
- package/dist/sync/workers/download.d.ts +159 -0
- package/dist/sync/workers/download.d.ts.map +1 -0
- package/dist/sync/workers/download.js +731 -0
- package/dist/sync/workers/download.js.map +1 -0
- package/dist/sync/workers/upload.d.ts +98 -0
- package/dist/sync/workers/upload.d.ts.map +1 -0
- package/dist/sync/workers/upload.js +412 -0
- package/dist/sync/workers/upload.js.map +1 -0
- package/dist/test-utils/e2ee-fixtures.d.ts +94 -0
- package/dist/test-utils/e2ee-fixtures.d.ts.map +1 -0
- package/dist/test-utils/e2ee-fixtures.js +116 -0
- package/dist/test-utils/e2ee-fixtures.js.map +1 -0
- package/dist/test-utils/e2ee-gateway.d.ts +61 -0
- package/dist/test-utils/e2ee-gateway.d.ts.map +1 -0
- package/dist/test-utils/e2ee-gateway.js +248 -0
- package/dist/test-utils/e2ee-gateway.js.map +1 -0
- package/dist/test-utils/index.d.ts +5 -0
- package/dist/test-utils/index.d.ts.map +1 -0
- package/dist/test-utils/index.js +5 -0
- package/dist/test-utils/index.js.map +1 -0
- package/dist/test-utils/memory-storage.d.ts +12 -0
- package/dist/test-utils/memory-storage.d.ts.map +1 -0
- package/dist/test-utils/memory-storage.js +146 -0
- package/dist/test-utils/memory-storage.js.map +1 -0
- package/dist/test-utils/wallet.d.ts +47 -0
- package/dist/test-utils/wallet.d.ts.map +1 -0
- package/dist/test-utils/wallet.js +98 -0
- package/dist/test-utils/wallet.js.map +1 -0
- package/dist/write/attribution.d.ts +185 -0
- package/dist/write/attribution.d.ts.map +1 -0
- package/dist/write/attribution.js +450 -0
- package/dist/write/attribution.js.map +1 -0
- package/dist/write/authorize.d.ts +77 -0
- package/dist/write/authorize.d.ts.map +1 -0
- package/dist/write/authorize.js +109 -0
- package/dist/write/authorize.js.map +1 -0
- package/dist/write/index.d.ts +5 -0
- package/dist/write/index.d.ts.map +1 -0
- package/dist/write/index.js +5 -0
- package/dist/write/index.js.map +1 -0
- package/dist/write/route.d.ts +61 -0
- package/dist/write/route.d.ts.map +1 -0
- package/dist/write/route.js +132 -0
- package/dist/write/route.js.map +1 -0
- package/dist/write/session.d.ts +96 -0
- package/dist/write/session.d.ts.map +1 -0
- package/dist/write/session.js +136 -0
- package/dist/write/session.js.map +1 -0
- package/package.json +175 -0
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persisted PDPP authorization state: declarations, grants, authorization
|
|
3
|
+
* codes, and the token/refresh-family graph.
|
|
4
|
+
*
|
|
5
|
+
* SQLite via better-sqlite3, matching `../storage/index/schema.ts`. The choice
|
|
6
|
+
* is not incidental: three requirements in §7/§9 are atomicity requirements,
|
|
7
|
+
* and a JSON file (the pattern `server/src/token-store.ts` uses for session
|
|
8
|
+
* tokens) cannot express them without a lock of its own.
|
|
9
|
+
*
|
|
10
|
+
* - §9 AS item 10: a `single_use` grant is consumed *atomically* with first
|
|
11
|
+
* client-token issuance.
|
|
12
|
+
* - §9 AS item 19: an authorization code is consumed *atomically* on first
|
|
13
|
+
* successful redemption; every later redemption fails.
|
|
14
|
+
* - §9 AS item 20: refresh reuse revokes the family and all linked tokens.
|
|
15
|
+
*
|
|
16
|
+
* Each is implemented as a conditional UPDATE inside a transaction, where the
|
|
17
|
+
* WHERE clause carries the precondition. `changes === 0` then means "someone
|
|
18
|
+
* else won the race", which is the only correct answer — checking state and
|
|
19
|
+
* then writing it would be exactly the TOCTOU bug these items exist to close.
|
|
20
|
+
*
|
|
21
|
+
* Tokens are stored as SHA-256 hashes, never plaintext, so a store dump does
|
|
22
|
+
* not yield usable credentials (§10 "Token security").
|
|
23
|
+
*/
|
|
24
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
25
|
+
import Database from "better-sqlite3";
|
|
26
|
+
/**
|
|
27
|
+
* Persisted-state contract version. §7 "Version layering" and §9 AS item 21
|
|
28
|
+
* require the reader to reject state it cannot validate against a supported
|
|
29
|
+
* contract, and forbid reconstructing missing facts from current config.
|
|
30
|
+
*/
|
|
31
|
+
export const PDPP_AUTH_STATE_VERSION = 1;
|
|
32
|
+
export class UnsupportedAuthStateError extends Error {
|
|
33
|
+
foundVersion;
|
|
34
|
+
supportedVersion;
|
|
35
|
+
constructor(foundVersion, supportedVersion = PDPP_AUTH_STATE_VERSION) {
|
|
36
|
+
super(`Persisted PDPP authorization state is version ${foundVersion}, which this build cannot validate ` +
|
|
37
|
+
`(supports ${supportedVersion}). Migrate from retained facts or require fresh consent; ` +
|
|
38
|
+
`authorization facts must not be reconstructed from current configuration.`);
|
|
39
|
+
this.foundVersion = foundVersion;
|
|
40
|
+
this.supportedVersion = supportedVersion;
|
|
41
|
+
this.name = "UnsupportedAuthStateError";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const SCHEMA_SQL = `
|
|
45
|
+
CREATE TABLE IF NOT EXISTS pdpp_state_meta (
|
|
46
|
+
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
47
|
+
version INTEGER NOT NULL
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
-- The exact retained declaration snapshot. Keyed by (source_id, version) so a
|
|
51
|
+
-- later revision is a new row and never overwrites the snapshot an issued
|
|
52
|
+
-- grant was resolved against (§9 AS item 16).
|
|
53
|
+
CREATE TABLE IF NOT EXISTS pdpp_declarations (
|
|
54
|
+
source_id TEXT NOT NULL,
|
|
55
|
+
version TEXT NOT NULL,
|
|
56
|
+
digest TEXT NOT NULL,
|
|
57
|
+
snapshot_json TEXT NOT NULL,
|
|
58
|
+
-- The exact retrieved bytes. snapshot_json is the parsed snapshot, so
|
|
59
|
+
-- re-digesting it does not reproduce digest. Without the original document
|
|
60
|
+
-- the retained digest is unverifiable from the store alone, which is the
|
|
61
|
+
-- gap this column closes. Nullable because rows retained before this
|
|
62
|
+
-- column existed have no document to recover; readers must treat NULL as
|
|
63
|
+
-- cannot-verify, never as verified.
|
|
64
|
+
document TEXT,
|
|
65
|
+
retrieved_at TEXT NOT NULL,
|
|
66
|
+
PRIMARY KEY (source_id, version)
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
CREATE TABLE IF NOT EXISTS pdpp_grants (
|
|
70
|
+
grant_id TEXT PRIMARY KEY,
|
|
71
|
+
subject_id TEXT NOT NULL,
|
|
72
|
+
client_id TEXT NOT NULL,
|
|
73
|
+
source_id TEXT NOT NULL,
|
|
74
|
+
declaration_version TEXT NOT NULL,
|
|
75
|
+
access_mode TEXT NOT NULL CHECK (access_mode IN ('single_use','continuous')),
|
|
76
|
+
grant_json TEXT NOT NULL,
|
|
77
|
+
issued_at TEXT NOT NULL,
|
|
78
|
+
expires_at TEXT,
|
|
79
|
+
revoked_at TEXT,
|
|
80
|
+
-- Set atomically with first client-token issuance for single_use grants.
|
|
81
|
+
consumed_at TEXT,
|
|
82
|
+
review_digest TEXT NOT NULL,
|
|
83
|
+
-- Consent evidence: the normalized bound claims, kept out of grant_json so
|
|
84
|
+
-- they cannot leak into introspection or RS enforcement (§6 client claims).
|
|
85
|
+
consent_evidence_json TEXT
|
|
86
|
+
);
|
|
87
|
+
CREATE INDEX IF NOT EXISTS idx_pdpp_grants_subject ON pdpp_grants (subject_id);
|
|
88
|
+
|
|
89
|
+
CREATE TABLE IF NOT EXISTS pdpp_auth_codes (
|
|
90
|
+
code_hash TEXT PRIMARY KEY,
|
|
91
|
+
grant_id TEXT NOT NULL,
|
|
92
|
+
client_id TEXT NOT NULL,
|
|
93
|
+
redirect_uri TEXT NOT NULL,
|
|
94
|
+
code_challenge TEXT,
|
|
95
|
+
code_challenge_method TEXT,
|
|
96
|
+
expires_at TEXT NOT NULL,
|
|
97
|
+
redeemed_at TEXT,
|
|
98
|
+
FOREIGN KEY (grant_id) REFERENCES pdpp_grants (grant_id)
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
-- One row per refresh-token family. Rotation supersedes a token within the
|
|
102
|
+
-- family; reuse of a superseded token kills the whole family (§9 AS item 20).
|
|
103
|
+
CREATE TABLE IF NOT EXISTS pdpp_refresh_families (
|
|
104
|
+
family_id TEXT PRIMARY KEY,
|
|
105
|
+
grant_id TEXT NOT NULL,
|
|
106
|
+
revoked_at TEXT,
|
|
107
|
+
FOREIGN KEY (grant_id) REFERENCES pdpp_grants (grant_id)
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
CREATE TABLE IF NOT EXISTS pdpp_refresh_tokens (
|
|
111
|
+
token_hash TEXT PRIMARY KEY,
|
|
112
|
+
family_id TEXT NOT NULL,
|
|
113
|
+
issued_at TEXT NOT NULL,
|
|
114
|
+
-- Non-null once rotated out. Presenting a superseded token is reuse.
|
|
115
|
+
superseded_at TEXT,
|
|
116
|
+
FOREIGN KEY (family_id) REFERENCES pdpp_refresh_families (family_id)
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
CREATE TABLE IF NOT EXISTS pdpp_access_tokens (
|
|
120
|
+
token_hash TEXT PRIMARY KEY,
|
|
121
|
+
grant_id TEXT,
|
|
122
|
+
subject_id TEXT NOT NULL,
|
|
123
|
+
client_id TEXT,
|
|
124
|
+
token_kind TEXT NOT NULL CHECK (token_kind IN ('owner','client')),
|
|
125
|
+
family_id TEXT,
|
|
126
|
+
issued_at TEXT NOT NULL,
|
|
127
|
+
expires_at TEXT,
|
|
128
|
+
revoked_at TEXT
|
|
129
|
+
);
|
|
130
|
+
CREATE INDEX IF NOT EXISTS idx_pdpp_access_grant ON pdpp_access_tokens (grant_id);
|
|
131
|
+
CREATE INDEX IF NOT EXISTS idx_pdpp_access_family ON pdpp_access_tokens (family_id);
|
|
132
|
+
`;
|
|
133
|
+
export function hashToken(token) {
|
|
134
|
+
return createHash("sha256").update(token, "utf8").digest("hex");
|
|
135
|
+
}
|
|
136
|
+
export function newOpaqueToken(prefix) {
|
|
137
|
+
return `${prefix}_${randomBytes(32).toString("hex")}`;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Open (and if needed create) the PDPP authorization store.
|
|
141
|
+
*
|
|
142
|
+
* Rejects a store whose persisted version this build cannot validate, before
|
|
143
|
+
* any caller reads authorization facts out of it. That is §9 AS item 21: the
|
|
144
|
+
* failure is loud and up front, not a silently-degraded read path.
|
|
145
|
+
*/
|
|
146
|
+
export function openPdppAuthStore(dbPath) {
|
|
147
|
+
const db = new Database(dbPath);
|
|
148
|
+
db.pragma("journal_mode = WAL");
|
|
149
|
+
// Transactions here express atomicity guarantees; a torn write would defeat
|
|
150
|
+
// exactly the single-use and code-consumption invariants they protect.
|
|
151
|
+
db.pragma("synchronous = FULL");
|
|
152
|
+
db.pragma("foreign_keys = ON");
|
|
153
|
+
db.exec(SCHEMA_SQL);
|
|
154
|
+
// Additive column migration. `CREATE TABLE IF NOT EXISTS` above does not
|
|
155
|
+
// alter an existing table, so a database created before `document` existed
|
|
156
|
+
// still lacks it. Adding a nullable column is backward compatible in both
|
|
157
|
+
// directions: an older build ignores it, and this build treats NULL as
|
|
158
|
+
// "not verifiable from the store" rather than as a failure. That is why
|
|
159
|
+
// this does NOT bump PDPP_AUTH_STATE_VERSION, which would throw
|
|
160
|
+
// UnsupportedAuthStateError and refuse to boot an existing deployment.
|
|
161
|
+
const declarationColumns = db
|
|
162
|
+
.prepare("PRAGMA table_info(pdpp_declarations)")
|
|
163
|
+
.all();
|
|
164
|
+
if (!declarationColumns.some((column) => column.name === "document")) {
|
|
165
|
+
db.exec("ALTER TABLE pdpp_declarations ADD COLUMN document TEXT");
|
|
166
|
+
}
|
|
167
|
+
const meta = db
|
|
168
|
+
.prepare("SELECT version FROM pdpp_state_meta WHERE id = 1")
|
|
169
|
+
.get();
|
|
170
|
+
if (meta === undefined) {
|
|
171
|
+
db.prepare("INSERT INTO pdpp_state_meta (id, version) VALUES (1, ?)").run(PDPP_AUTH_STATE_VERSION);
|
|
172
|
+
}
|
|
173
|
+
else if (meta.version !== PDPP_AUTH_STATE_VERSION) {
|
|
174
|
+
db.close();
|
|
175
|
+
throw new UnsupportedAuthStateError(meta.version);
|
|
176
|
+
}
|
|
177
|
+
return new PdppAuthStore(db);
|
|
178
|
+
}
|
|
179
|
+
export class PdppAuthStore {
|
|
180
|
+
db;
|
|
181
|
+
constructor(db) {
|
|
182
|
+
this.db = db;
|
|
183
|
+
}
|
|
184
|
+
close() {
|
|
185
|
+
this.db.close();
|
|
186
|
+
}
|
|
187
|
+
// -- declarations -------------------------------------------------------
|
|
188
|
+
/**
|
|
189
|
+
* Retain a declaration snapshot, and the exact bytes it was parsed from.
|
|
190
|
+
*
|
|
191
|
+
* Idempotent per (source_id, version): a re-retrieval of the same revision
|
|
192
|
+
* must not disturb the retained facts an issued grant points at, so the
|
|
193
|
+
* first snapshot wins and is never overwritten.
|
|
194
|
+
*
|
|
195
|
+
* The one exception is BACKFILLING `document`. A deployment that retained a
|
|
196
|
+
* version before this column existed has a NULL document, and a plain
|
|
197
|
+
* `DO NOTHING` would leave it NULL forever — the existing row would keep
|
|
198
|
+
* winning on every restart, so the digest would stay unverifiable until the
|
|
199
|
+
* declaration version happened to change. `COALESCE` fills it in once and
|
|
200
|
+
* then never changes it, so backfill happens exactly when it is missing and
|
|
201
|
+
* the retained bytes remain immutable thereafter.
|
|
202
|
+
*/
|
|
203
|
+
retainDeclaration(snapshot, document) {
|
|
204
|
+
this.db
|
|
205
|
+
.prepare(`INSERT INTO pdpp_declarations
|
|
206
|
+
(source_id, version, digest, snapshot_json, document, retrieved_at)
|
|
207
|
+
VALUES (?, ?, ?, ?, ?, ?)
|
|
208
|
+
ON CONFLICT (source_id, version) DO UPDATE SET
|
|
209
|
+
document = COALESCE(pdpp_declarations.document, excluded.document)`)
|
|
210
|
+
.run(snapshot.source_id, snapshot.version, snapshot.digest, JSON.stringify(snapshot), document ?? null, new Date().toISOString());
|
|
211
|
+
}
|
|
212
|
+
getDeclaration(sourceId, version) {
|
|
213
|
+
const row = this.db
|
|
214
|
+
.prepare("SELECT snapshot_json FROM pdpp_declarations WHERE source_id = ? AND version = ?")
|
|
215
|
+
.get(sourceId, version);
|
|
216
|
+
return row ? JSON.parse(row.snapshot_json) : null;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* The exact retrieved bytes a retained declaration was parsed from.
|
|
220
|
+
*
|
|
221
|
+
* Returns null when this row predates the `document` column and has not been
|
|
222
|
+
* backfilled. A caller MUST treat null as "cannot verify from the store",
|
|
223
|
+
* never as "verified" — the whole point of this accessor is that re-digesting
|
|
224
|
+
* `snapshot_json` would silently produce a different value than the retained
|
|
225
|
+
* `digest`.
|
|
226
|
+
*/
|
|
227
|
+
getDeclarationDocument(sourceId, version) {
|
|
228
|
+
const row = this.db
|
|
229
|
+
.prepare("SELECT document FROM pdpp_declarations WHERE source_id = ? AND version = ?")
|
|
230
|
+
.get(sourceId, version);
|
|
231
|
+
return row?.document ?? null;
|
|
232
|
+
}
|
|
233
|
+
// -- grants -------------------------------------------------------------
|
|
234
|
+
insertGrant(input) {
|
|
235
|
+
const { grant } = input;
|
|
236
|
+
this.db
|
|
237
|
+
.prepare(`INSERT INTO pdpp_grants
|
|
238
|
+
(grant_id, subject_id, client_id, source_id, declaration_version,
|
|
239
|
+
access_mode, grant_json, issued_at, expires_at, review_digest,
|
|
240
|
+
consent_evidence_json)
|
|
241
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`)
|
|
242
|
+
.run(grant.grant_id, input.subjectId, grant.client.client_id, grant.source.id, grant.source_declaration.version, grant.access_mode, JSON.stringify(grant), grant.issued_at, grant.expires_at ?? null, input.reviewDigest, input.consentEvidence ? JSON.stringify(input.consentEvidence) : null);
|
|
243
|
+
}
|
|
244
|
+
getGrant(grantId) {
|
|
245
|
+
const row = this.db
|
|
246
|
+
.prepare("SELECT * FROM pdpp_grants WHERE grant_id = ?")
|
|
247
|
+
.get(grantId);
|
|
248
|
+
if (!row)
|
|
249
|
+
return null;
|
|
250
|
+
return {
|
|
251
|
+
grant: JSON.parse(row.grant_json),
|
|
252
|
+
subjectId: row.subject_id,
|
|
253
|
+
clientId: row.client_id,
|
|
254
|
+
reviewDigest: row.review_digest,
|
|
255
|
+
issuedAt: row.issued_at,
|
|
256
|
+
expiresAt: row.expires_at,
|
|
257
|
+
revokedAt: row.revoked_at,
|
|
258
|
+
consumedAt: row.consumed_at,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
listGrantsForSubject(subjectId) {
|
|
262
|
+
const rows = this.db
|
|
263
|
+
.prepare("SELECT * FROM pdpp_grants WHERE subject_id = ? ORDER BY issued_at DESC")
|
|
264
|
+
.all(subjectId);
|
|
265
|
+
return rows.map((row) => ({
|
|
266
|
+
grant: JSON.parse(row.grant_json),
|
|
267
|
+
subjectId: row.subject_id,
|
|
268
|
+
clientId: row.client_id,
|
|
269
|
+
reviewDigest: row.review_digest,
|
|
270
|
+
issuedAt: row.issued_at,
|
|
271
|
+
expiresAt: row.expires_at,
|
|
272
|
+
revokedAt: row.revoked_at,
|
|
273
|
+
consumedAt: row.consumed_at,
|
|
274
|
+
}));
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Grant lifecycle (§9 AS item 8). Revoked beats expired: once an owner
|
|
278
|
+
* revokes, that is the fact worth reporting, and it does not become
|
|
279
|
+
* "expired" later just because the clock passed.
|
|
280
|
+
*/
|
|
281
|
+
grantStatus(stored, now = new Date()) {
|
|
282
|
+
if (stored.revokedAt)
|
|
283
|
+
return "revoked";
|
|
284
|
+
if (stored.expiresAt && Date.parse(stored.expiresAt) <= now.getTime()) {
|
|
285
|
+
return "expired";
|
|
286
|
+
}
|
|
287
|
+
return "active";
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Revoke a grant and everything linked to it, in one transaction.
|
|
291
|
+
*
|
|
292
|
+
* §2 of the delivery scope: the AS marks the grant and every linked token
|
|
293
|
+
* family inactive *immediately*. Doing this in one transaction means there
|
|
294
|
+
* is no window where the grant reads revoked but a linked access token still
|
|
295
|
+
* introspects active.
|
|
296
|
+
*
|
|
297
|
+
* Returns false if the grant does not exist or was already revoked, so a
|
|
298
|
+
* double revoke is not reported as a fresh one.
|
|
299
|
+
*/
|
|
300
|
+
revokeGrant(grantId, now = new Date()) {
|
|
301
|
+
const at = now.toISOString();
|
|
302
|
+
const tx = this.db.transaction(() => {
|
|
303
|
+
const result = this.db
|
|
304
|
+
.prepare("UPDATE pdpp_grants SET revoked_at = ? WHERE grant_id = ? AND revoked_at IS NULL")
|
|
305
|
+
.run(at, grantId);
|
|
306
|
+
if (result.changes === 0)
|
|
307
|
+
return false;
|
|
308
|
+
this.db
|
|
309
|
+
.prepare("UPDATE pdpp_access_tokens SET revoked_at = ? WHERE grant_id = ? AND revoked_at IS NULL")
|
|
310
|
+
.run(at, grantId);
|
|
311
|
+
this.db
|
|
312
|
+
.prepare("UPDATE pdpp_refresh_families SET revoked_at = ? WHERE grant_id = ? AND revoked_at IS NULL")
|
|
313
|
+
.run(at, grantId);
|
|
314
|
+
return true;
|
|
315
|
+
});
|
|
316
|
+
return tx();
|
|
317
|
+
}
|
|
318
|
+
// -- authorization codes ------------------------------------------------
|
|
319
|
+
insertAuthCode(code, record) {
|
|
320
|
+
this.db
|
|
321
|
+
.prepare(`INSERT INTO pdpp_auth_codes
|
|
322
|
+
(code_hash, grant_id, client_id, redirect_uri, code_challenge,
|
|
323
|
+
code_challenge_method, expires_at)
|
|
324
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)`)
|
|
325
|
+
.run(hashToken(code), record.grantId, record.clientId, record.redirectUri, record.codeChallenge, record.codeChallengeMethod, record.expiresAt);
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Consume an authorization code atomically (§9 AS item 19).
|
|
329
|
+
*
|
|
330
|
+
* The `redeemed_at IS NULL` predicate lives in the UPDATE, so two concurrent
|
|
331
|
+
* redemptions of the same code cannot both see it unredeemed. Exactly one
|
|
332
|
+
* gets `changes === 1`; the loser gets null and the caller returns
|
|
333
|
+
* `invalid_grant`. An expired code fails the same way, and a replayed code
|
|
334
|
+
* never issues a second token.
|
|
335
|
+
*/
|
|
336
|
+
consumeAuthCode(code, now = new Date()) {
|
|
337
|
+
const hash = hashToken(code);
|
|
338
|
+
const at = now.toISOString();
|
|
339
|
+
const tx = this.db.transaction(() => {
|
|
340
|
+
const result = this.db
|
|
341
|
+
.prepare(`UPDATE pdpp_auth_codes SET redeemed_at = ?
|
|
342
|
+
WHERE code_hash = ? AND redeemed_at IS NULL AND expires_at > ?`)
|
|
343
|
+
.run(at, hash, at);
|
|
344
|
+
if (result.changes === 0)
|
|
345
|
+
return null;
|
|
346
|
+
const row = this.db
|
|
347
|
+
.prepare("SELECT * FROM pdpp_auth_codes WHERE code_hash = ?")
|
|
348
|
+
.get(hash);
|
|
349
|
+
return {
|
|
350
|
+
grantId: row.grant_id,
|
|
351
|
+
clientId: row.client_id,
|
|
352
|
+
redirectUri: row.redirect_uri,
|
|
353
|
+
codeChallenge: row.code_challenge,
|
|
354
|
+
codeChallengeMethod: row.code_challenge_method,
|
|
355
|
+
expiresAt: row.expires_at,
|
|
356
|
+
};
|
|
357
|
+
});
|
|
358
|
+
return tx();
|
|
359
|
+
}
|
|
360
|
+
// -- tokens -------------------------------------------------------------
|
|
361
|
+
/**
|
|
362
|
+
* Consume a `single_use` grant atomically with the first client access token
|
|
363
|
+
* (§9 AS item 10 / §7 access modes).
|
|
364
|
+
*
|
|
365
|
+
* Both the consumption and the token insert happen in one transaction with
|
|
366
|
+
* the precondition in the UPDATE's WHERE clause, so a second concurrent
|
|
367
|
+
* issuance attempt finds `changes === 0` and issues nothing. A `continuous`
|
|
368
|
+
* grant skips the consume step and may issue repeatedly.
|
|
369
|
+
*
|
|
370
|
+
* Returns false when the grant was already consumed — the caller maps that
|
|
371
|
+
* to `invalid_grant`. Note §7: the RS still honors tokens already issued
|
|
372
|
+
* against a consumed grant until they expire or are revoked; consumption
|
|
373
|
+
* blocks *new* token issuance, not use of the existing token.
|
|
374
|
+
*/
|
|
375
|
+
issueAccessToken(input) {
|
|
376
|
+
const now = input.now ?? new Date();
|
|
377
|
+
const at = now.toISOString();
|
|
378
|
+
const tx = this.db.transaction(() => {
|
|
379
|
+
if (input.consumeSingleUse) {
|
|
380
|
+
if (!input.grantId)
|
|
381
|
+
return false;
|
|
382
|
+
const consumed = this.db
|
|
383
|
+
.prepare(`UPDATE pdpp_grants SET consumed_at = ?
|
|
384
|
+
WHERE grant_id = ? AND consumed_at IS NULL
|
|
385
|
+
AND access_mode = 'single_use' AND revoked_at IS NULL`)
|
|
386
|
+
.run(at, input.grantId);
|
|
387
|
+
if (consumed.changes === 0)
|
|
388
|
+
return false;
|
|
389
|
+
}
|
|
390
|
+
this.db
|
|
391
|
+
.prepare(`INSERT INTO pdpp_access_tokens
|
|
392
|
+
(token_hash, grant_id, subject_id, client_id, token_kind,
|
|
393
|
+
family_id, issued_at, expires_at)
|
|
394
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`)
|
|
395
|
+
.run(hashToken(input.token), input.grantId, input.subjectId, input.clientId, input.tokenKind, input.familyId ?? null, at, input.expiresAt);
|
|
396
|
+
return true;
|
|
397
|
+
});
|
|
398
|
+
return tx();
|
|
399
|
+
}
|
|
400
|
+
getAccessToken(token) {
|
|
401
|
+
const row = this.db
|
|
402
|
+
.prepare("SELECT * FROM pdpp_access_tokens WHERE token_hash = ?")
|
|
403
|
+
.get(hashToken(token));
|
|
404
|
+
if (!row)
|
|
405
|
+
return null;
|
|
406
|
+
return {
|
|
407
|
+
tokenHash: row.token_hash,
|
|
408
|
+
grantId: row.grant_id,
|
|
409
|
+
subjectId: row.subject_id,
|
|
410
|
+
clientId: row.client_id,
|
|
411
|
+
tokenKind: row.token_kind,
|
|
412
|
+
familyId: row.family_id,
|
|
413
|
+
issuedAt: row.issued_at,
|
|
414
|
+
expiresAt: row.expires_at,
|
|
415
|
+
revokedAt: row.revoked_at,
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
// -- refresh families ---------------------------------------------------
|
|
419
|
+
createRefreshFamily(grantId) {
|
|
420
|
+
const familyId = `rfam_${randomBytes(16).toString("hex")}`;
|
|
421
|
+
this.db
|
|
422
|
+
.prepare("INSERT INTO pdpp_refresh_families (family_id, grant_id) VALUES (?, ?)")
|
|
423
|
+
.run(familyId, grantId);
|
|
424
|
+
return familyId;
|
|
425
|
+
}
|
|
426
|
+
insertRefreshToken(token, familyId, now = new Date()) {
|
|
427
|
+
this.db
|
|
428
|
+
.prepare("INSERT INTO pdpp_refresh_tokens (token_hash, family_id, issued_at) VALUES (?, ?, ?)")
|
|
429
|
+
.run(hashToken(token), familyId, now.toISOString());
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Rotate a refresh token, detecting reuse (§9 AS item 20).
|
|
433
|
+
*
|
|
434
|
+
* Three outcomes:
|
|
435
|
+
* - `{ ok: true }`: the presented token was current; it is superseded and
|
|
436
|
+
* the caller issues a replacement in the same family.
|
|
437
|
+
* - `{ ok: false, reason: "reuse_detected" }`: the token was already
|
|
438
|
+
* superseded. The family and every family-linked access token are
|
|
439
|
+
* revoked here, atomically, before returning. The caller returns
|
|
440
|
+
* `invalid_grant` and the client must obtain fresh authorization.
|
|
441
|
+
* - `{ ok: false, reason: "unknown" | "family_revoked" }`: nothing to
|
|
442
|
+
* rotate.
|
|
443
|
+
*
|
|
444
|
+
* Reuse revoking the family is the whole point: an attacker who replays a
|
|
445
|
+
* stolen refresh token and a legitimate client who replays after a dropped
|
|
446
|
+
* response are indistinguishable, so the safe response is to kill both and
|
|
447
|
+
* force a fresh grant-backed authorization.
|
|
448
|
+
*/
|
|
449
|
+
rotateRefreshToken(presented, now = new Date()) {
|
|
450
|
+
const hash = hashToken(presented);
|
|
451
|
+
const at = now.toISOString();
|
|
452
|
+
const tx = this.db.transaction(() => {
|
|
453
|
+
const row = this.db
|
|
454
|
+
.prepare(`SELECT t.token_hash, t.family_id, t.superseded_at,
|
|
455
|
+
f.revoked_at AS family_revoked_at, f.grant_id
|
|
456
|
+
FROM pdpp_refresh_tokens t
|
|
457
|
+
JOIN pdpp_refresh_families f ON f.family_id = t.family_id
|
|
458
|
+
WHERE t.token_hash = ?`)
|
|
459
|
+
.get(hash);
|
|
460
|
+
if (!row)
|
|
461
|
+
return { ok: false, reason: "unknown" };
|
|
462
|
+
if (row.family_revoked_at) {
|
|
463
|
+
return { ok: false, reason: "family_revoked" };
|
|
464
|
+
}
|
|
465
|
+
if (row.superseded_at) {
|
|
466
|
+
// Reuse. Burn the family and every access token issued under it.
|
|
467
|
+
this.db
|
|
468
|
+
.prepare("UPDATE pdpp_refresh_families SET revoked_at = ? WHERE family_id = ?")
|
|
469
|
+
.run(at, row.family_id);
|
|
470
|
+
this.db
|
|
471
|
+
.prepare(`UPDATE pdpp_access_tokens SET revoked_at = ?
|
|
472
|
+
WHERE family_id = ? AND revoked_at IS NULL`)
|
|
473
|
+
.run(at, row.family_id);
|
|
474
|
+
return { ok: false, reason: "reuse_detected" };
|
|
475
|
+
}
|
|
476
|
+
this.db
|
|
477
|
+
.prepare("UPDATE pdpp_refresh_tokens SET superseded_at = ? WHERE token_hash = ?")
|
|
478
|
+
.run(at, hash);
|
|
479
|
+
return {
|
|
480
|
+
ok: true,
|
|
481
|
+
familyId: row.family_id,
|
|
482
|
+
grantId: row.grant_id,
|
|
483
|
+
};
|
|
484
|
+
});
|
|
485
|
+
return tx();
|
|
486
|
+
}
|
|
487
|
+
/** Revoke one access token. Returns false if unknown or already revoked. */
|
|
488
|
+
revokeAccessToken(token, now = new Date()) {
|
|
489
|
+
const result = this.db
|
|
490
|
+
.prepare("UPDATE pdpp_access_tokens SET revoked_at = ? WHERE token_hash = ? AND revoked_at IS NULL")
|
|
491
|
+
.run(now.toISOString(), hashToken(token));
|
|
492
|
+
return result.changes > 0;
|
|
493
|
+
}
|
|
494
|
+
isFamilyRevoked(familyId) {
|
|
495
|
+
const row = this.db
|
|
496
|
+
.prepare("SELECT revoked_at FROM pdpp_refresh_families WHERE family_id = ?")
|
|
497
|
+
.get(familyId);
|
|
498
|
+
return row ? row.revoked_at !== null : true;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/pdpp/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAQtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAEzC,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAEvC;IACA;IAFX,YACW,YAAoB,EACpB,mBAA2B,uBAAuB;QAE3D,KAAK,CACH,iDAAiD,YAAY,qCAAqC;YAChG,aAAa,gBAAgB,2DAA2D;YACxF,2EAA2E,CAC9E,CAAC;QAPO,iBAAY,GAAZ,YAAY,CAAQ;QACpB,qBAAgB,GAAhB,gBAAgB,CAAkC;QAO3D,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF;AAED,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC;IACd,CAAC;IAED,4EAA4E;IAC5E,iBAAiB,CAAC,KAAa,EAAE,MAAY,IAAI,IAAI,EAAE;QACrD,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE;aACnB,OAAO,CACN,0FAA0F,CAC3F;aACA,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5C,OAAO,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC;IAC5B,CAAC;IAED,eAAe,CAAC,QAAgB;QAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE;aAChB,OAAO,CACN,kEAAkE,CACnE;aACA,GAAG,CAAC,QAAQ,CAA8C,CAAC;QAC9D,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PDPP grant-bound token issuance, introspection, and revocation (§8, §9 AS
|
|
3
|
+
* items 8–10, 18–20; delivery scope §2).
|
|
4
|
+
*
|
|
5
|
+
* This module is the single token-validation authority. The RS resolves every
|
|
6
|
+
* request through `resolveToken` and enforces only from the result — §8 is
|
|
7
|
+
* explicit that the separated RS must not make a second AS lookup while
|
|
8
|
+
* handling a request, and that a co-located RS may use a local equivalent.
|
|
9
|
+
* `resolveToken` is that local equivalent, and `introspect` is the same
|
|
10
|
+
* decision rendered onto the RFC 7662 wire shape. They share one code path so
|
|
11
|
+
* the two deployments cannot drift apart.
|
|
12
|
+
*
|
|
13
|
+
* Revocation is immediate here by construction: resolution reads current store
|
|
14
|
+
* state on every call rather than trusting a cached decision, so a revoked
|
|
15
|
+
* grant reports `active: false` on the very next call. The 60-second bound in
|
|
16
|
+
* §8 is the RS's positive-result cache, not slack in the AS.
|
|
17
|
+
*/
|
|
18
|
+
import { type PdppAuthStore } from "./store.js";
|
|
19
|
+
import { type AccessMode, type Grant, type PdppAuthorizationDetail, type PdppIntrospectionResponse, type PdppTokenContext } from "./types.js";
|
|
20
|
+
/** Default client access-token lifetime. Short: the refresh path renews it. */
|
|
21
|
+
export declare const DEFAULT_ACCESS_TOKEN_TTL_SECONDS: number;
|
|
22
|
+
/** How long an authorization code stays redeemable. RFC 6749 §4.1.2 suggests <=10 min. */
|
|
23
|
+
export declare const AUTHORIZATION_CODE_TTL_SECONDS = 60;
|
|
24
|
+
export interface TokenIssuanceResult {
|
|
25
|
+
access_token: string;
|
|
26
|
+
token_type: "Bearer";
|
|
27
|
+
expires_in: number;
|
|
28
|
+
/** Present only for continuous grants (§9 AS item 20). */
|
|
29
|
+
refresh_token?: string;
|
|
30
|
+
/** Echoed so a client can bind its own state to the grant. */
|
|
31
|
+
grant_id: string;
|
|
32
|
+
}
|
|
33
|
+
export type TokenFailureCode = "invalid_grant" | "invalid_request";
|
|
34
|
+
export interface TokenFailure {
|
|
35
|
+
code: TokenFailureCode;
|
|
36
|
+
message: string;
|
|
37
|
+
}
|
|
38
|
+
export type TokenResult = {
|
|
39
|
+
ok: true;
|
|
40
|
+
issued: TokenIssuanceResult;
|
|
41
|
+
} | {
|
|
42
|
+
ok: false;
|
|
43
|
+
failure: TokenFailure;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Whether a grant may carry a refresh token.
|
|
47
|
+
*
|
|
48
|
+
* §9 AS item 20: refresh tokens are issued only for `continuous` grants, or
|
|
49
|
+
* for a grant package only when *every* child grant is continuous. A
|
|
50
|
+
* single-use grant with a refresh token would be a contradiction — the grant
|
|
51
|
+
* is consumed at first issuance, so there is nothing left to refresh into.
|
|
52
|
+
*/
|
|
53
|
+
export declare function mayIssueRefreshToken(accessModes: AccessMode[]): boolean;
|
|
54
|
+
export interface PdppTokenServiceOptions {
|
|
55
|
+
accessTokenTtlSeconds?: number;
|
|
56
|
+
}
|
|
57
|
+
export declare class PdppTokenService {
|
|
58
|
+
private readonly store;
|
|
59
|
+
private readonly accessTtl;
|
|
60
|
+
constructor(store: PdppAuthStore, options?: PdppTokenServiceOptions);
|
|
61
|
+
/**
|
|
62
|
+
* Issue the first client token for a grant, redeeming an authorization code.
|
|
63
|
+
*
|
|
64
|
+
* The code is consumed atomically before anything else happens (§9 AS item
|
|
65
|
+
* 19) and a single-use grant is consumed atomically with the token insert
|
|
66
|
+
* (§9 AS item 10). Both preconditions live in SQL WHERE clauses, so a
|
|
67
|
+
* concurrent duplicate redemption loses the race rather than double-issuing.
|
|
68
|
+
*/
|
|
69
|
+
redeemAuthorizationCode(input: {
|
|
70
|
+
code: string;
|
|
71
|
+
clientId: string;
|
|
72
|
+
redirectUri: string;
|
|
73
|
+
/** RFC 7636 verifier. Required when the code was issued with a challenge. */
|
|
74
|
+
codeVerifier?: string;
|
|
75
|
+
now?: Date;
|
|
76
|
+
}): TokenResult;
|
|
77
|
+
/**
|
|
78
|
+
* Rotate a refresh token within its family.
|
|
79
|
+
*
|
|
80
|
+
* Reuse of a superseded token revokes the family and every family-linked
|
|
81
|
+
* access token inside `rotateRefreshToken`, then this returns
|
|
82
|
+
* `invalid_grant`, which is what §9 AS item 20 requires: reject the reuse
|
|
83
|
+
* and require fresh authorization.
|
|
84
|
+
*/
|
|
85
|
+
refresh(input: {
|
|
86
|
+
refreshToken: string;
|
|
87
|
+
now?: Date;
|
|
88
|
+
}): TokenResult;
|
|
89
|
+
/**
|
|
90
|
+
* Mint an access token (and, for continuous grants, a refresh token) bound
|
|
91
|
+
* to a grant.
|
|
92
|
+
*
|
|
93
|
+
* `existingFamilyId` carries a rotation into the same family so reuse
|
|
94
|
+
* detection keeps working across the whole chain; a first issuance creates
|
|
95
|
+
* the family.
|
|
96
|
+
*/
|
|
97
|
+
private mintForGrant;
|
|
98
|
+
/**
|
|
99
|
+
* The single shared token-validation path (§8 "Grant enforcement").
|
|
100
|
+
*
|
|
101
|
+
* Reads live store state every call. That is what makes revocation immediate
|
|
102
|
+
* in introspection (§9 AS item 8) — there is no AS-side cache to invalidate.
|
|
103
|
+
*/
|
|
104
|
+
resolveToken(accessToken: string, now?: Date): PdppTokenContext;
|
|
105
|
+
/**
|
|
106
|
+
* RFC 7662 introspection.
|
|
107
|
+
*
|
|
108
|
+
* An inactive token yields exactly `{ active: false }`. RFC 7662 §2.2 is
|
|
109
|
+
* clear that the response must not distinguish revoked from expired from
|
|
110
|
+
* never-issued — the reason stays internal (`resolveToken`) for the
|
|
111
|
+
* co-located RS, which needs it to pick 403 `grant_revoked`.
|
|
112
|
+
*/
|
|
113
|
+
introspect(accessToken: string, now?: Date): PdppIntrospectionResponse;
|
|
114
|
+
/** Revoke a grant and every linked token family. Immediate (§2, §9 item 8). */
|
|
115
|
+
revokeGrant(grantId: string, now?: Date): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Issue an owner token for a subject.
|
|
118
|
+
*
|
|
119
|
+
* An owner token carries no grant (§8 "Authentication"): it scopes to a
|
|
120
|
+
* single subject's data store, and the RS derives subject scope from it
|
|
121
|
+
* rather than synthesizing a grant. It is also what authenticates a consent
|
|
122
|
+
* decision — see `approval.ts` for why the AS requires this rather than
|
|
123
|
+
* trusting the consent UI's affiliation.
|
|
124
|
+
*
|
|
125
|
+
* How the owner *obtains* this token is out of scope for Core; this build
|
|
126
|
+
* mints it from the already-authenticated owner session paths.
|
|
127
|
+
*/
|
|
128
|
+
issueOwnerToken(input: {
|
|
129
|
+
subjectId: string;
|
|
130
|
+
ttlSeconds?: number;
|
|
131
|
+
now?: Date;
|
|
132
|
+
}): {
|
|
133
|
+
access_token: string;
|
|
134
|
+
token_type: "Bearer";
|
|
135
|
+
expires_in: number;
|
|
136
|
+
};
|
|
137
|
+
/** Revoke a single access token without touching its grant. */
|
|
138
|
+
revokeAccessToken(token: string, now?: Date): boolean;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Project a grant onto the RFC 9396 detail the introspection response carries.
|
|
142
|
+
*
|
|
143
|
+
* Note what is absent: `client_claims` and `retention` are not enforcement
|
|
144
|
+
* fields. §6 keeps claims outside introspection rights and RS enforcement
|
|
145
|
+
* entirely; retention is a policy commitment PDPP does not technically
|
|
146
|
+
* enforce, so including it would invite an RS to act on it.
|
|
147
|
+
*/
|
|
148
|
+
export declare function toAuthorizationDetail(grant: Grant): PdppAuthorizationDetail;
|
|
149
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/pdpp/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,KAAK,EAEV,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;AAEpB,+EAA+E;AAC/E,eAAO,MAAM,gCAAgC,QAAU,CAAC;AAExD,0FAA0F;AAC1F,eAAO,MAAM,8BAA8B,KAAK,CAAC;AAEjD,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,QAAQ,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,WAAW,GACnB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,mBAAmB,CAAA;CAAE,GACzC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC;AAEzC;;;;;;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