@kya-os/checkpoint-shared 1.9.0 → 1.10.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/CHANGELOG.md +24 -0
- package/README.md +1 -1
- package/dist/browser-posture-5fPrsxx7.d.mts.map +1 -1
- package/dist/browser-posture-CCR1kh5e.d.ts.map +1 -1
- package/dist/browser-posture.js +35 -4
- package/dist/browser-posture.mjs +35 -4
- package/dist/browser-posture.mjs.map +1 -1
- package/dist/deploy/index.d.mts +1 -0
- package/dist/deploy/index.d.mts.map +1 -1
- package/dist/deploy/index.d.ts +1 -0
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/index.js +9 -1
- package/dist/deploy/index.mjs +9 -1
- package/dist/deploy/index.mjs.map +1 -1
- package/dist/{fetcher-C8qvwdnA.d.ts → fetcher-CCw4Q95g.d.ts} +2 -2
- package/dist/{fetcher-C8qvwdnA.d.ts.map → fetcher-CCw4Q95g.d.ts.map} +1 -1
- package/dist/{fetcher-D2vjr7jB.d.mts → fetcher-CZfLcbRZ.d.mts} +2 -2
- package/dist/{fetcher-D2vjr7jB.d.mts.map → fetcher-CZfLcbRZ.d.mts.map} +1 -1
- package/dist/host-adapter/index.d.mts +1 -1
- package/dist/host-adapter/index.d.ts +1 -1
- package/dist/{index-DnFsmr_o.d.ts → index-Cdv_FH0H.d.ts} +2 -2
- package/dist/{index-DnFsmr_o.d.ts.map → index-Cdv_FH0H.d.ts.map} +1 -1
- package/dist/{index-rvw5Bz-r.d.mts → index-DL_dmQBY.d.mts} +2 -2
- package/dist/{index-rvw5Bz-r.d.mts.map → index-DL_dmQBY.d.mts.map} +1 -1
- package/dist/index.d.mts +68 -52
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +68 -52
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -13
- package/dist/index.mjs +24 -14
- package/dist/index.mjs.map +1 -1
- package/dist/kya-http.d.mts +2 -2
- package/dist/kya-http.d.ts +2 -2
- package/dist/kya-http.js +6 -2
- package/dist/kya-http.mjs +2 -2
- package/dist/policy/fetcher.d.mts +1 -1
- package/dist/policy/fetcher.d.ts +1 -1
- package/dist/policy/schemas.d.mts +1 -1
- package/dist/policy/schemas.d.ts +1 -1
- package/dist/{registered-sid-DVGTSH0L.js → registered-sid-BZfDOfXy.js} +107 -4
- package/dist/{registered-sid-26hNxp6t.mjs → registered-sid-CS9V8nPr.mjs} +85 -6
- package/dist/registered-sid-CS9V8nPr.mjs.map +1 -0
- package/dist/{registered-sid-D6KCaT1E.d.ts → registered-sid-CnWIU_l1.d.mts} +13 -2
- package/dist/registered-sid-CnWIU_l1.d.mts.map +1 -0
- package/dist/{registered-sid-D6KCaT1E.d.mts → registered-sid-CnWIU_l1.d.ts} +13 -2
- package/dist/registered-sid-CnWIU_l1.d.ts.map +1 -0
- package/dist/{schemas-m-GqyfyO.d.mts → schemas-BhC88D1-.d.mts} +5 -5
- package/dist/{schemas-m-GqyfyO.d.mts.map → schemas-BhC88D1-.d.mts.map} +1 -1
- package/dist/{schemas-CGKHzcMV.d.ts → schemas-DZa1ouGs.d.ts} +5 -5
- package/dist/{schemas-CGKHzcMV.d.ts.map → schemas-DZa1ouGs.d.ts.map} +1 -1
- package/dist/signals/index.d.mts.map +1 -1
- package/dist/signals/index.d.ts.map +1 -1
- package/dist/signals/index.js +4 -0
- package/dist/signals/index.mjs +4 -0
- package/dist/signals/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/registered-sid-26hNxp6t.mjs.map +0 -1
- package/dist/registered-sid-D6KCaT1E.d.mts.map +0 -1
- package/dist/registered-sid-D6KCaT1E.d.ts.map +0 -1
package/dist/kya-http.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as KYA_HTTP_ERROR_STATUS, r as KyaHttpErrorCode, t as KYA_HTTP_ERROR } from "./kya-http-error-codes-C14E4gi3.mjs";
|
|
2
|
-
import {
|
|
3
|
-
export { ANONYMOUS_PRINCIPAL_DID, DELEGATION_PROOF_HEADERS, KYA_HTTP_ERROR, KYA_HTTP_ERROR_STATUS, KYA_OS_HANDSHAKE_METHODS, KYA_OS_WIRE_METHODS, KyaHttpErrorCode, REGISTERED_SID_MAX_LENGTH, SID_ATTRIBUTABLE_RESULT, isKyaOsHandshakeMethod, isKyaOsWireMethod, normalizeHandshakeMethod, normalizeWireMethod, requestCarriesDelegationProof, requestPresentedCredential };
|
|
2
|
+
import { S as normalizeWireMethod, a as KYA_SIGNED_BODY_MAX_BYTES, b as isKyaOsWireMethod, c as requestCarriesDelegationProof, d as requestPresentsKyaSignature, f as KYA_OS_HANDSHAKE_METHODS, i as BoundedBody, l as requestDeclaresBody, n as SID_ATTRIBUTABLE_RESULT, o as readBodyBounded, p as KYA_OS_WIRE_METHODS, r as ANONYMOUS_PRINCIPAL_DID, s as DELEGATION_PROOF_HEADERS, t as REGISTERED_SID_MAX_LENGTH, u as requestPresentedCredential, x as normalizeHandshakeMethod, y as isKyaOsHandshakeMethod } from "./registered-sid-CnWIU_l1.mjs";
|
|
3
|
+
export { ANONYMOUS_PRINCIPAL_DID, BoundedBody, DELEGATION_PROOF_HEADERS, KYA_HTTP_ERROR, KYA_HTTP_ERROR_STATUS, KYA_OS_HANDSHAKE_METHODS, KYA_OS_WIRE_METHODS, KYA_SIGNED_BODY_MAX_BYTES, KyaHttpErrorCode, REGISTERED_SID_MAX_LENGTH, SID_ATTRIBUTABLE_RESULT, isKyaOsHandshakeMethod, isKyaOsWireMethod, normalizeHandshakeMethod, normalizeWireMethod, readBodyBounded, requestCarriesDelegationProof, requestDeclaresBody, requestPresentedCredential, requestPresentsKyaSignature };
|
package/dist/kya-http.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as KYA_HTTP_ERROR_STATUS, r as KyaHttpErrorCode, t as KYA_HTTP_ERROR } from "./kya-http-error-codes-C14E4gi3.js";
|
|
2
|
-
import {
|
|
3
|
-
export { ANONYMOUS_PRINCIPAL_DID, DELEGATION_PROOF_HEADERS, KYA_HTTP_ERROR, KYA_HTTP_ERROR_STATUS, KYA_OS_HANDSHAKE_METHODS, KYA_OS_WIRE_METHODS, KyaHttpErrorCode, REGISTERED_SID_MAX_LENGTH, SID_ATTRIBUTABLE_RESULT, isKyaOsHandshakeMethod, isKyaOsWireMethod, normalizeHandshakeMethod, normalizeWireMethod, requestCarriesDelegationProof, requestPresentedCredential };
|
|
2
|
+
import { S as normalizeWireMethod, a as KYA_SIGNED_BODY_MAX_BYTES, b as isKyaOsWireMethod, c as requestCarriesDelegationProof, d as requestPresentsKyaSignature, f as KYA_OS_HANDSHAKE_METHODS, i as BoundedBody, l as requestDeclaresBody, n as SID_ATTRIBUTABLE_RESULT, o as readBodyBounded, p as KYA_OS_WIRE_METHODS, r as ANONYMOUS_PRINCIPAL_DID, s as DELEGATION_PROOF_HEADERS, t as REGISTERED_SID_MAX_LENGTH, u as requestPresentedCredential, x as normalizeHandshakeMethod, y as isKyaOsHandshakeMethod } from "./registered-sid-CnWIU_l1.js";
|
|
3
|
+
export { ANONYMOUS_PRINCIPAL_DID, BoundedBody, DELEGATION_PROOF_HEADERS, KYA_HTTP_ERROR, KYA_HTTP_ERROR_STATUS, KYA_OS_HANDSHAKE_METHODS, KYA_OS_WIRE_METHODS, KYA_SIGNED_BODY_MAX_BYTES, KyaHttpErrorCode, REGISTERED_SID_MAX_LENGTH, SID_ATTRIBUTABLE_RESULT, isKyaOsHandshakeMethod, isKyaOsWireMethod, normalizeHandshakeMethod, normalizeWireMethod, readBodyBounded, requestCarriesDelegationProof, requestDeclaresBody, requestPresentedCredential, requestPresentsKyaSignature };
|
package/dist/kya-http.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_verification = require('./verification-BAw9N8Pt.js');
|
|
3
3
|
const require_kya_http_error_codes = require('./kya-http-error-codes-B4rUmUEI.js');
|
|
4
|
-
const require_registered_sid = require('./registered-sid-
|
|
4
|
+
const require_registered_sid = require('./registered-sid-BZfDOfXy.js');
|
|
5
5
|
|
|
6
6
|
exports.ANONYMOUS_PRINCIPAL_DID = require_registered_sid.ANONYMOUS_PRINCIPAL_DID;
|
|
7
7
|
exports.DELEGATION_PROOF_HEADERS = require_registered_sid.DELEGATION_PROOF_HEADERS;
|
|
@@ -9,11 +9,15 @@ exports.KYA_HTTP_ERROR = require_kya_http_error_codes.KYA_HTTP_ERROR;
|
|
|
9
9
|
exports.KYA_HTTP_ERROR_STATUS = require_kya_http_error_codes.KYA_HTTP_ERROR_STATUS;
|
|
10
10
|
exports.KYA_OS_HANDSHAKE_METHODS = require_verification.KYA_OS_HANDSHAKE_METHODS;
|
|
11
11
|
exports.KYA_OS_WIRE_METHODS = require_verification.KYA_OS_WIRE_METHODS;
|
|
12
|
+
exports.KYA_SIGNED_BODY_MAX_BYTES = require_registered_sid.KYA_SIGNED_BODY_MAX_BYTES;
|
|
12
13
|
exports.REGISTERED_SID_MAX_LENGTH = require_registered_sid.REGISTERED_SID_MAX_LENGTH;
|
|
13
14
|
exports.SID_ATTRIBUTABLE_RESULT = require_registered_sid.SID_ATTRIBUTABLE_RESULT;
|
|
14
15
|
exports.isKyaOsHandshakeMethod = require_verification.isKyaOsHandshakeMethod;
|
|
15
16
|
exports.isKyaOsWireMethod = require_verification.isKyaOsWireMethod;
|
|
16
17
|
exports.normalizeHandshakeMethod = require_verification.normalizeHandshakeMethod;
|
|
17
18
|
exports.normalizeWireMethod = require_verification.normalizeWireMethod;
|
|
19
|
+
exports.readBodyBounded = require_registered_sid.readBodyBounded;
|
|
18
20
|
exports.requestCarriesDelegationProof = require_registered_sid.requestCarriesDelegationProof;
|
|
19
|
-
exports.
|
|
21
|
+
exports.requestDeclaresBody = require_registered_sid.requestDeclaresBody;
|
|
22
|
+
exports.requestPresentedCredential = require_registered_sid.requestPresentedCredential;
|
|
23
|
+
exports.requestPresentsKyaSignature = require_registered_sid.requestPresentsKyaSignature;
|
package/dist/kya-http.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as isKyaOsWireMethod, l as normalizeHandshakeMethod, n as KYA_OS_WIRE_METHODS, s as isKyaOsHandshakeMethod, t as KYA_OS_HANDSHAKE_METHODS, u as normalizeWireMethod } from "./verification-Cvvv86TT.mjs";
|
|
2
2
|
import { n as KYA_HTTP_ERROR_STATUS, t as KYA_HTTP_ERROR } from "./kya-http-error-codes-DSBrxNry.mjs";
|
|
3
|
-
import { a as
|
|
3
|
+
import { a as readBodyBounded, c as requestDeclaresBody, i as KYA_SIGNED_BODY_MAX_BYTES, l as requestPresentedCredential, n as SID_ATTRIBUTABLE_RESULT, o as DELEGATION_PROOF_HEADERS, r as ANONYMOUS_PRINCIPAL_DID, s as requestCarriesDelegationProof, t as REGISTERED_SID_MAX_LENGTH, u as requestPresentsKyaSignature } from "./registered-sid-CS9V8nPr.mjs";
|
|
4
4
|
|
|
5
|
-
export { ANONYMOUS_PRINCIPAL_DID, DELEGATION_PROOF_HEADERS, KYA_HTTP_ERROR, KYA_HTTP_ERROR_STATUS, KYA_OS_HANDSHAKE_METHODS, KYA_OS_WIRE_METHODS, REGISTERED_SID_MAX_LENGTH, SID_ATTRIBUTABLE_RESULT, isKyaOsHandshakeMethod, isKyaOsWireMethod, normalizeHandshakeMethod, normalizeWireMethod, requestCarriesDelegationProof, requestPresentedCredential };
|
|
5
|
+
export { ANONYMOUS_PRINCIPAL_DID, DELEGATION_PROOF_HEADERS, KYA_HTTP_ERROR, KYA_HTTP_ERROR_STATUS, KYA_OS_HANDSHAKE_METHODS, KYA_OS_WIRE_METHODS, KYA_SIGNED_BODY_MAX_BYTES, REGISTERED_SID_MAX_LENGTH, SID_ATTRIBUTABLE_RESULT, isKyaOsHandshakeMethod, isKyaOsWireMethod, normalizeHandshakeMethod, normalizeWireMethod, readBodyBounded, requestCarriesDelegationProof, requestDeclaresBody, requestPresentedCredential, requestPresentsKyaSignature };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PolicyUnavailableError, i as PolicyFetcherConfig, n as PolicyCacheAdapter, o as isPolicyUnavailableError, r as PolicyFetcher, t as CachedPolicy } from "../fetcher-
|
|
1
|
+
import { a as PolicyUnavailableError, i as PolicyFetcherConfig, n as PolicyCacheAdapter, o as isPolicyUnavailableError, r as PolicyFetcher, t as CachedPolicy } from "../fetcher-CZfLcbRZ.mjs";
|
|
2
2
|
export { CachedPolicy, PolicyCacheAdapter, PolicyFetcher, PolicyFetcherConfig, PolicyUnavailableError, isPolicyUnavailableError };
|
package/dist/policy/fetcher.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PolicyUnavailableError, i as PolicyFetcherConfig, n as PolicyCacheAdapter, o as isPolicyUnavailableError, r as PolicyFetcher, t as CachedPolicy } from "../fetcher-
|
|
1
|
+
import { a as PolicyUnavailableError, i as PolicyFetcherConfig, n as PolicyCacheAdapter, o as isPolicyUnavailableError, r as PolicyFetcher, t as CachedPolicy } from "../fetcher-CCw4Q95g.js";
|
|
2
2
|
export { CachedPolicy, PolicyCacheAdapter, PolicyFetcher, PolicyFetcherConfig, PolicyUnavailableError, isPolicyUnavailableError };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as normalizeChallengeType, t as isEngineEnforcing } from "../engine-enforcing-DiOclGqf.mjs";
|
|
2
|
-
import { A as PolicyMetadataSchema, B as ThresholdConfigSchema, C as InstructPayload, D as PolicyConfig, E as PolicyConditionSchema, F as RuleMetadata, I as RuleMetadataSchema, L as SuggestedAction, M as PolicyRuleSchema, N as RedirectTarget, O as PolicyConfigSchema, P as RedirectTargetSchema, R as SuggestedActionSchema, S as EnforcementModeSchema, T as PolicyCondition, V as safeParsePolicyConfig, _ as DenyListEntry, a as BlockReason, b as EnforcementActionSchema, c as ChallengeParamsSchema, d as ConditionOperator, f as ConditionOperatorSchema, g as DecisionSchema, h as Decision, i as AssuranceTierSchema, j as PolicyRule, k as PolicyMetadata, l as ConditionField, m as ConditionValueSchema, n as AllowListEntrySchema, o as BlockReasonSchema, p as ConditionValue, r as AssuranceTier, s as ChallengeParams, t as AllowListEntry, u as ConditionFieldSchema, v as DenyListEntrySchema, w as InstructPayloadSchema, x as EnforcementMode, y as EnforcementAction, z as ThresholdConfig } from "../schemas-
|
|
2
|
+
import { A as PolicyMetadataSchema, B as ThresholdConfigSchema, C as InstructPayload, D as PolicyConfig, E as PolicyConditionSchema, F as RuleMetadata, I as RuleMetadataSchema, L as SuggestedAction, M as PolicyRuleSchema, N as RedirectTarget, O as PolicyConfigSchema, P as RedirectTargetSchema, R as SuggestedActionSchema, S as EnforcementModeSchema, T as PolicyCondition, V as safeParsePolicyConfig, _ as DenyListEntry, a as BlockReason, b as EnforcementActionSchema, c as ChallengeParamsSchema, d as ConditionOperator, f as ConditionOperatorSchema, g as DecisionSchema, h as Decision, i as AssuranceTierSchema, j as PolicyRule, k as PolicyMetadata, l as ConditionField, m as ConditionValueSchema, n as AllowListEntrySchema, o as BlockReasonSchema, p as ConditionValue, r as AssuranceTier, s as ChallengeParams, t as AllowListEntry, u as ConditionFieldSchema, v as DenyListEntrySchema, w as InstructPayloadSchema, x as EnforcementMode, y as EnforcementAction, z as ThresholdConfig } from "../schemas-BhC88D1-.mjs";
|
|
3
3
|
export { AllowListEntry, AllowListEntrySchema, AssuranceTier, AssuranceTierSchema, BlockReason, BlockReasonSchema, ChallengeParams, ChallengeParamsSchema, ConditionField, ConditionFieldSchema, ConditionOperator, ConditionOperatorSchema, ConditionValue, ConditionValueSchema, Decision, DecisionSchema, DenyListEntry, DenyListEntrySchema, EnforcementAction, EnforcementActionSchema, EnforcementMode, EnforcementModeSchema, InstructPayload, InstructPayloadSchema, PolicyCondition, PolicyConditionSchema, PolicyConfig, PolicyConfigSchema, PolicyMetadata, PolicyMetadataSchema, PolicyRule, PolicyRuleSchema, RedirectTarget, RedirectTargetSchema, RuleMetadata, RuleMetadataSchema, SuggestedAction, SuggestedActionSchema, ThresholdConfig, ThresholdConfigSchema, isEngineEnforcing, normalizeChallengeType, safeParsePolicyConfig };
|
package/dist/policy/schemas.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as normalizeChallengeType, t as isEngineEnforcing } from "../engine-enforcing-DiOclGqf.js";
|
|
2
|
-
import { A as PolicyMetadataSchema, B as ThresholdConfigSchema, C as InstructPayload, D as PolicyConfig, E as PolicyConditionSchema, F as RuleMetadata, I as RuleMetadataSchema, L as SuggestedAction, M as PolicyRuleSchema, N as RedirectTarget, O as PolicyConfigSchema, P as RedirectTargetSchema, R as SuggestedActionSchema, S as EnforcementModeSchema, T as PolicyCondition, V as safeParsePolicyConfig, _ as DenyListEntry, a as BlockReason, b as EnforcementActionSchema, c as ChallengeParamsSchema, d as ConditionOperator, f as ConditionOperatorSchema, g as DecisionSchema, h as Decision, i as AssuranceTierSchema, j as PolicyRule, k as PolicyMetadata, l as ConditionField, m as ConditionValueSchema, n as AllowListEntrySchema, o as BlockReasonSchema, p as ConditionValue, r as AssuranceTier, s as ChallengeParams, t as AllowListEntry, u as ConditionFieldSchema, v as DenyListEntrySchema, w as InstructPayloadSchema, x as EnforcementMode, y as EnforcementAction, z as ThresholdConfig } from "../schemas-
|
|
2
|
+
import { A as PolicyMetadataSchema, B as ThresholdConfigSchema, C as InstructPayload, D as PolicyConfig, E as PolicyConditionSchema, F as RuleMetadata, I as RuleMetadataSchema, L as SuggestedAction, M as PolicyRuleSchema, N as RedirectTarget, O as PolicyConfigSchema, P as RedirectTargetSchema, R as SuggestedActionSchema, S as EnforcementModeSchema, T as PolicyCondition, V as safeParsePolicyConfig, _ as DenyListEntry, a as BlockReason, b as EnforcementActionSchema, c as ChallengeParamsSchema, d as ConditionOperator, f as ConditionOperatorSchema, g as DecisionSchema, h as Decision, i as AssuranceTierSchema, j as PolicyRule, k as PolicyMetadata, l as ConditionField, m as ConditionValueSchema, n as AllowListEntrySchema, o as BlockReasonSchema, p as ConditionValue, r as AssuranceTier, s as ChallengeParams, t as AllowListEntry, u as ConditionFieldSchema, v as DenyListEntrySchema, w as InstructPayloadSchema, x as EnforcementMode, y as EnforcementAction, z as ThresholdConfig } from "../schemas-DZa1ouGs.js";
|
|
3
3
|
export { AllowListEntry, AllowListEntrySchema, AssuranceTier, AssuranceTierSchema, BlockReason, BlockReasonSchema, ChallengeParams, ChallengeParamsSchema, ConditionField, ConditionFieldSchema, ConditionOperator, ConditionOperatorSchema, ConditionValue, ConditionValueSchema, Decision, DecisionSchema, DenyListEntry, DenyListEntrySchema, EnforcementAction, EnforcementActionSchema, EnforcementMode, EnforcementModeSchema, InstructPayload, InstructPayloadSchema, PolicyCondition, PolicyConditionSchema, PolicyConfig, PolicyConfigSchema, PolicyMetadata, PolicyMetadataSchema, PolicyRule, PolicyRuleSchema, RedirectTarget, RedirectTargetSchema, RuleMetadata, RuleMetadataSchema, SuggestedAction, SuggestedActionSchema, ThresholdConfig, ThresholdConfigSchema, isEngineEnforcing, normalizeChallengeType, safeParsePolicyConfig };
|
|
@@ -101,14 +101,93 @@ function looksLikeVcJwt(token) {
|
|
|
101
101
|
/** Same definition as the .NET / Java `IsCredentialPresented`. */
|
|
102
102
|
function requestPresentedCredential(headers) {
|
|
103
103
|
if (!headers) return false;
|
|
104
|
-
|
|
105
|
-
const value = headerText(headers, name);
|
|
106
|
-
if (value && hasKyaMember(value)) return true;
|
|
107
|
-
}
|
|
104
|
+
if (requestPresentsKyaSignature(headers)) return true;
|
|
108
105
|
if (requestCarriesDelegationProof(headers)) return true;
|
|
109
106
|
const bearer = headerText(headers, "authorization")?.match(/^bearer\s+(\S+)/i);
|
|
110
107
|
return bearer !== null && bearer !== void 0 && looksLikeVcJwt(bearer[1]);
|
|
111
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* True when `Signature-Input` or `Signature` carries a `kya` member, i.e. the
|
|
111
|
+
* request presents a KYA HTTP Binding (kya-http/2) signature. Same member scan
|
|
112
|
+
* as {@link requestPresentedCredential}; routing only, the engine validates it.
|
|
113
|
+
*/
|
|
114
|
+
function requestPresentsKyaSignature(headers) {
|
|
115
|
+
if (!headers) return false;
|
|
116
|
+
return ["signature-input", "signature"].some((name) => {
|
|
117
|
+
const value = headerText(headers, name);
|
|
118
|
+
return value !== void 0 && hasKyaMember(value);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* True when the request's framing says it carries a body: a
|
|
123
|
+
* `Transfer-Encoding` header, or a `Content-Length` other than exactly `0`
|
|
124
|
+
* (an empty, blank or malformed length counts as a body, so it fails closed).
|
|
125
|
+
* This is `type-is`'s `hasBody`, except that `Content-Length: 0` is an empty
|
|
126
|
+
* body. A kya-http/2 verifier uses it to tell a request with no body apart
|
|
127
|
+
* from one whose body bytes it never received. HTTP/2 can carry a body with
|
|
128
|
+
* neither header, so a host that can read the body should pass its bytes
|
|
129
|
+
* instead of relying on this.
|
|
130
|
+
*/
|
|
131
|
+
function requestDeclaresBody(headers) {
|
|
132
|
+
if (!headers) return false;
|
|
133
|
+
if (headerText(headers, "transfer-encoding") !== void 0) return true;
|
|
134
|
+
const contentLength = headerText(headers, "content-length");
|
|
135
|
+
return contentLength !== void 0 && contentLength !== "0";
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/mcpi/signed-body.ts
|
|
140
|
+
/**
|
|
141
|
+
* The body bound of a kya-http/2 (KYA HTTP Binding) signed request.
|
|
142
|
+
*
|
|
143
|
+
* A kya-http/2 signature binds the body through `Content-Digest`, so a host
|
|
144
|
+
* hands the engine the exact body bytes. Every host bounds them the same way,
|
|
145
|
+
* at the .NET adapters' 1 MiB: a larger signed body is answered 413 and never
|
|
146
|
+
* verified in part. In observe mode it goes on without its bytes, and the
|
|
147
|
+
* refusal it would have been is reported.
|
|
148
|
+
*/
|
|
149
|
+
/** Largest kya-http/2 signed body a host hands the engine. */
|
|
150
|
+
const KYA_SIGNED_BODY_MAX_BYTES = 1048576;
|
|
151
|
+
/**
|
|
152
|
+
* Read a clone of `request`'s body, stopping at `maxBytes`, so the original
|
|
153
|
+
* body is still owed, whole, downstream. A request with no body stream reads
|
|
154
|
+
* as empty, unless its framing declares a body (one the host dropped): that is
|
|
155
|
+
* `unreadable`, never an empty body.
|
|
156
|
+
*
|
|
157
|
+
* Streamed with an early stop, not `arrayBuffer()`: a chunked body with no
|
|
158
|
+
* `Content-Length` would otherwise be pulled whole (into both branches of the
|
|
159
|
+
* clone's tee) before its size was ever looked at.
|
|
160
|
+
*/
|
|
161
|
+
async function readBodyBounded(request, maxBytes) {
|
|
162
|
+
const declaredLength = Number(request.headers.get("content-length"));
|
|
163
|
+
if (Number.isFinite(declaredLength) && declaredLength > maxBytes) return { failure: "too-large" };
|
|
164
|
+
const stream = request.clone().body;
|
|
165
|
+
if (!stream) return requestDeclaresBody(request.headers) ? { failure: "unreadable" } : { bytes: /* @__PURE__ */ new Uint8Array(0) };
|
|
166
|
+
const reader = stream.getReader();
|
|
167
|
+
const chunks = [];
|
|
168
|
+
let total = 0;
|
|
169
|
+
try {
|
|
170
|
+
for (;;) {
|
|
171
|
+
const { done, value } = await reader.read();
|
|
172
|
+
if (done) break;
|
|
173
|
+
total += value.byteLength;
|
|
174
|
+
if (total > maxBytes) {
|
|
175
|
+
reader.cancel().catch(() => void 0);
|
|
176
|
+
return { failure: "too-large" };
|
|
177
|
+
}
|
|
178
|
+
chunks.push(value);
|
|
179
|
+
}
|
|
180
|
+
} catch {
|
|
181
|
+
return { failure: "unreadable" };
|
|
182
|
+
}
|
|
183
|
+
const bytes = new Uint8Array(total);
|
|
184
|
+
let offset = 0;
|
|
185
|
+
for (const chunk of chunks) {
|
|
186
|
+
bytes.set(chunk, offset);
|
|
187
|
+
offset += chunk.byteLength;
|
|
188
|
+
}
|
|
189
|
+
return { bytes };
|
|
190
|
+
}
|
|
112
191
|
|
|
113
192
|
//#endregion
|
|
114
193
|
//#region src/mcpi/anonymous-principal.ts
|
|
@@ -159,6 +238,12 @@ Object.defineProperty(exports, 'DELEGATION_PROOF_HEADERS', {
|
|
|
159
238
|
return DELEGATION_PROOF_HEADERS;
|
|
160
239
|
}
|
|
161
240
|
});
|
|
241
|
+
Object.defineProperty(exports, 'KYA_SIGNED_BODY_MAX_BYTES', {
|
|
242
|
+
enumerable: true,
|
|
243
|
+
get: function () {
|
|
244
|
+
return KYA_SIGNED_BODY_MAX_BYTES;
|
|
245
|
+
}
|
|
246
|
+
});
|
|
162
247
|
Object.defineProperty(exports, 'REGISTERED_SID_MAX_LENGTH', {
|
|
163
248
|
enumerable: true,
|
|
164
249
|
get: function () {
|
|
@@ -171,15 +256,33 @@ Object.defineProperty(exports, 'SID_ATTRIBUTABLE_RESULT', {
|
|
|
171
256
|
return SID_ATTRIBUTABLE_RESULT;
|
|
172
257
|
}
|
|
173
258
|
});
|
|
259
|
+
Object.defineProperty(exports, 'readBodyBounded', {
|
|
260
|
+
enumerable: true,
|
|
261
|
+
get: function () {
|
|
262
|
+
return readBodyBounded;
|
|
263
|
+
}
|
|
264
|
+
});
|
|
174
265
|
Object.defineProperty(exports, 'requestCarriesDelegationProof', {
|
|
175
266
|
enumerable: true,
|
|
176
267
|
get: function () {
|
|
177
268
|
return requestCarriesDelegationProof;
|
|
178
269
|
}
|
|
179
270
|
});
|
|
271
|
+
Object.defineProperty(exports, 'requestDeclaresBody', {
|
|
272
|
+
enumerable: true,
|
|
273
|
+
get: function () {
|
|
274
|
+
return requestDeclaresBody;
|
|
275
|
+
}
|
|
276
|
+
});
|
|
180
277
|
Object.defineProperty(exports, 'requestPresentedCredential', {
|
|
181
278
|
enumerable: true,
|
|
182
279
|
get: function () {
|
|
183
280
|
return requestPresentedCredential;
|
|
184
281
|
}
|
|
282
|
+
});
|
|
283
|
+
Object.defineProperty(exports, 'requestPresentsKyaSignature', {
|
|
284
|
+
enumerable: true,
|
|
285
|
+
get: function () {
|
|
286
|
+
return requestPresentsKyaSignature;
|
|
287
|
+
}
|
|
185
288
|
});
|
|
@@ -101,14 +101,93 @@ function looksLikeVcJwt(token) {
|
|
|
101
101
|
/** Same definition as the .NET / Java `IsCredentialPresented`. */
|
|
102
102
|
function requestPresentedCredential(headers) {
|
|
103
103
|
if (!headers) return false;
|
|
104
|
-
|
|
105
|
-
const value = headerText(headers, name);
|
|
106
|
-
if (value && hasKyaMember(value)) return true;
|
|
107
|
-
}
|
|
104
|
+
if (requestPresentsKyaSignature(headers)) return true;
|
|
108
105
|
if (requestCarriesDelegationProof(headers)) return true;
|
|
109
106
|
const bearer = headerText(headers, "authorization")?.match(/^bearer\s+(\S+)/i);
|
|
110
107
|
return bearer !== null && bearer !== void 0 && looksLikeVcJwt(bearer[1]);
|
|
111
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* True when `Signature-Input` or `Signature` carries a `kya` member, i.e. the
|
|
111
|
+
* request presents a KYA HTTP Binding (kya-http/2) signature. Same member scan
|
|
112
|
+
* as {@link requestPresentedCredential}; routing only, the engine validates it.
|
|
113
|
+
*/
|
|
114
|
+
function requestPresentsKyaSignature(headers) {
|
|
115
|
+
if (!headers) return false;
|
|
116
|
+
return ["signature-input", "signature"].some((name) => {
|
|
117
|
+
const value = headerText(headers, name);
|
|
118
|
+
return value !== void 0 && hasKyaMember(value);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* True when the request's framing says it carries a body: a
|
|
123
|
+
* `Transfer-Encoding` header, or a `Content-Length` other than exactly `0`
|
|
124
|
+
* (an empty, blank or malformed length counts as a body, so it fails closed).
|
|
125
|
+
* This is `type-is`'s `hasBody`, except that `Content-Length: 0` is an empty
|
|
126
|
+
* body. A kya-http/2 verifier uses it to tell a request with no body apart
|
|
127
|
+
* from one whose body bytes it never received. HTTP/2 can carry a body with
|
|
128
|
+
* neither header, so a host that can read the body should pass its bytes
|
|
129
|
+
* instead of relying on this.
|
|
130
|
+
*/
|
|
131
|
+
function requestDeclaresBody(headers) {
|
|
132
|
+
if (!headers) return false;
|
|
133
|
+
if (headerText(headers, "transfer-encoding") !== void 0) return true;
|
|
134
|
+
const contentLength = headerText(headers, "content-length");
|
|
135
|
+
return contentLength !== void 0 && contentLength !== "0";
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/mcpi/signed-body.ts
|
|
140
|
+
/**
|
|
141
|
+
* The body bound of a kya-http/2 (KYA HTTP Binding) signed request.
|
|
142
|
+
*
|
|
143
|
+
* A kya-http/2 signature binds the body through `Content-Digest`, so a host
|
|
144
|
+
* hands the engine the exact body bytes. Every host bounds them the same way,
|
|
145
|
+
* at the .NET adapters' 1 MiB: a larger signed body is answered 413 and never
|
|
146
|
+
* verified in part. In observe mode it goes on without its bytes, and the
|
|
147
|
+
* refusal it would have been is reported.
|
|
148
|
+
*/
|
|
149
|
+
/** Largest kya-http/2 signed body a host hands the engine. */
|
|
150
|
+
const KYA_SIGNED_BODY_MAX_BYTES = 1048576;
|
|
151
|
+
/**
|
|
152
|
+
* Read a clone of `request`'s body, stopping at `maxBytes`, so the original
|
|
153
|
+
* body is still owed, whole, downstream. A request with no body stream reads
|
|
154
|
+
* as empty, unless its framing declares a body (one the host dropped): that is
|
|
155
|
+
* `unreadable`, never an empty body.
|
|
156
|
+
*
|
|
157
|
+
* Streamed with an early stop, not `arrayBuffer()`: a chunked body with no
|
|
158
|
+
* `Content-Length` would otherwise be pulled whole (into both branches of the
|
|
159
|
+
* clone's tee) before its size was ever looked at.
|
|
160
|
+
*/
|
|
161
|
+
async function readBodyBounded(request, maxBytes) {
|
|
162
|
+
const declaredLength = Number(request.headers.get("content-length"));
|
|
163
|
+
if (Number.isFinite(declaredLength) && declaredLength > maxBytes) return { failure: "too-large" };
|
|
164
|
+
const stream = request.clone().body;
|
|
165
|
+
if (!stream) return requestDeclaresBody(request.headers) ? { failure: "unreadable" } : { bytes: /* @__PURE__ */ new Uint8Array(0) };
|
|
166
|
+
const reader = stream.getReader();
|
|
167
|
+
const chunks = [];
|
|
168
|
+
let total = 0;
|
|
169
|
+
try {
|
|
170
|
+
for (;;) {
|
|
171
|
+
const { done, value } = await reader.read();
|
|
172
|
+
if (done) break;
|
|
173
|
+
total += value.byteLength;
|
|
174
|
+
if (total > maxBytes) {
|
|
175
|
+
reader.cancel().catch(() => void 0);
|
|
176
|
+
return { failure: "too-large" };
|
|
177
|
+
}
|
|
178
|
+
chunks.push(value);
|
|
179
|
+
}
|
|
180
|
+
} catch {
|
|
181
|
+
return { failure: "unreadable" };
|
|
182
|
+
}
|
|
183
|
+
const bytes = new Uint8Array(total);
|
|
184
|
+
let offset = 0;
|
|
185
|
+
for (const chunk of chunks) {
|
|
186
|
+
bytes.set(chunk, offset);
|
|
187
|
+
offset += chunk.byteLength;
|
|
188
|
+
}
|
|
189
|
+
return { bytes };
|
|
190
|
+
}
|
|
112
191
|
|
|
113
192
|
//#endregion
|
|
114
193
|
//#region src/mcpi/anonymous-principal.ts
|
|
@@ -147,5 +226,5 @@ const REGISTERED_SID_MAX_LENGTH = 100;
|
|
|
147
226
|
const SID_ATTRIBUTABLE_RESULT = "verified";
|
|
148
227
|
|
|
149
228
|
//#endregion
|
|
150
|
-
export {
|
|
151
|
-
//# sourceMappingURL=registered-sid-
|
|
229
|
+
export { readBodyBounded as a, requestDeclaresBody as c, KYA_SIGNED_BODY_MAX_BYTES as i, requestPresentedCredential as l, SID_ATTRIBUTABLE_RESULT as n, DELEGATION_PROOF_HEADERS as o, ANONYMOUS_PRINCIPAL_DID as r, requestCarriesDelegationProof as s, REGISTERED_SID_MAX_LENGTH as t, requestPresentsKyaSignature as u };
|
|
230
|
+
//# sourceMappingURL=registered-sid-CS9V8nPr.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registered-sid-CS9V8nPr.mjs","names":[],"sources":["../src/mcpi/delegation-headers.ts","../src/mcpi/signed-body.ts","../src/mcpi/anonymous-principal.ts","../src/mcpi/registered-sid.ts"],"sourcesContent":["/**\n * Delegation-proof request detection (P2 / DR-1).\n *\n * The engine's L2 delegation-root pinning (`ContextSpec.trustedDelegationRoots`)\n * is consulted for every credential the engine verifies: the delegation-proof\n * headers below AND an `Authorization: Bearer` VC-JWT. Consumers gate root\n * resolution on `requestPresentedCredential`, so the human / no-credential hot\n * path stays a precise no-op.\n *\n * Keeping the header set here (rather than re-listing the literals at each site)\n * is the whole point: a new delegation transport header is added in one place\n * and every verifier surface agrees.\n */\n\n/**\n * Lowercased delegation-proof header names. `kya-os-delegation-credential` is the\n * canonical KYA-OS transport; `kya-delegation` is the legacy envelope form still\n * accepted via `legacyEnvelopeFallback`.\n */\nexport const DELEGATION_PROOF_HEADERS = ['kya-os-delegation-credential', 'kya-delegation'] as const;\n\n/** A header value is \"present\" when it is a non-empty string (or non-empty list). */\nfunction isPresent(value: unknown): boolean {\n if (Array.isArray(value)) return value.length > 0;\n return typeof value === 'string' && value.length > 0;\n}\n\n/**\n * Does the request carry a KYA-OS delegation-proof header?\n *\n * Accepts either a `Headers` instance (Next.js / fetch — case-insensitive\n * lookup) or a plain header record (raw Node/Express headers, gateway worker's\n * lowercased map). Record keys are matched case-insensitively, so callers do not\n * need to pre-normalize. Returns `false` for `null`/`undefined`.\n */\nexport function requestCarriesDelegationProof(\n headers: Headers | Record<string, unknown> | null | undefined\n): boolean {\n if (!headers) return false;\n\n if (typeof (headers as Headers).get === 'function') {\n const h = headers as Headers;\n return DELEGATION_PROOF_HEADERS.some((name) => isPresent(h.get(name)));\n }\n\n const record = headers as Record<string, unknown>;\n const lowerKeyed = new Map<string, unknown>();\n for (const key of Object.keys(record)) {\n lowerKeyed.set(key.toLowerCase(), record[key]);\n }\n return DELEGATION_PROOF_HEADERS.some((name) => isPresent(lowerKeyed.get(name)));\n}\n\nconst MAX_VC_JWT_PAYLOAD_CHARS = 16 * 1024;\n\nfunction headerText(headers: Headers | Record<string, unknown>, name: string): string | undefined {\n if (typeof (headers as Headers).get === 'function') {\n return (headers as Headers).get(name) ?? undefined;\n }\n for (const [key, value] of Object.entries(headers as Record<string, unknown>)) {\n if (key.toLowerCase() !== name) continue;\n if (Array.isArray(value)) return value.join(', ');\n return typeof value === 'string' ? value : undefined;\n }\n return undefined;\n}\n\nfunction isMemberDelimiter(c: string): boolean {\n return c === '=' || c === ';' || c === ',' || c === ' ' || c === '\\t';\n}\n\n// Quote-aware member scan; the engine owns the authoritative parse.\nfunction hasKyaMember(value: string): boolean {\n let memberStart = true;\n let quoted = false;\n let escaped = false;\n for (let i = 0; i < value.length; i++) {\n const c = value[i];\n if (quoted) {\n if (escaped) escaped = false;\n else if (c === '\\\\') escaped = true;\n else if (c === '\"') quoted = false;\n continue;\n }\n if (memberStart) {\n if (c === ' ' || c === '\\t') continue;\n if (\n value.startsWith('kya', i) &&\n (i + 3 === value.length || isMemberDelimiter(value[i + 3]))\n ) {\n return true;\n }\n memberStart = false;\n }\n if (c === '\"') quoted = true;\n else if (c === ',') memberStart = true;\n }\n return false;\n}\n\nfunction decodeBase64UrlJson(segment: string): unknown {\n const padded = segment.replace(/-/g, '+').replace(/_/g, '/');\n const binary = atob(padded + '='.repeat((4 - (padded.length % 4)) % 4));\n const bytes = Uint8Array.from(binary, (ch) => ch.charCodeAt(0));\n return JSON.parse(new TextDecoder().decode(bytes));\n}\n\nfunction isDelegationCredentialPayload(payload: unknown): boolean {\n if (typeof payload !== 'object' || payload === null) return false;\n if ('vc' in payload) return true;\n const type = (payload as { type?: unknown }).type;\n return Array.isArray(type) && type.includes('DelegationCredential');\n}\n\n// Must equal the orchestrator's delegation routing (`vc` claim OR flat `type`\n// DelegationCredential); an oversized payload counts as presented.\nfunction looksLikeVcJwt(token: string): boolean {\n const parts = token.split('.');\n if (parts.length !== 3 || parts.some((part) => part.length === 0)) return false;\n if (parts[1].length > MAX_VC_JWT_PAYLOAD_CHARS) return true;\n try {\n return isDelegationCredentialPayload(decodeBase64UrlJson(parts[1]));\n } catch {\n return false;\n }\n}\n\n/** Same definition as the .NET / Java `IsCredentialPresented`. */\nexport function requestPresentedCredential(\n headers: Headers | Record<string, unknown> | null | undefined\n): boolean {\n if (!headers) return false;\n if (requestPresentsKyaSignature(headers)) return true;\n if (requestCarriesDelegationProof(headers)) return true;\n const authorization = headerText(headers, 'authorization');\n const bearer = authorization?.match(/^bearer\\s+(\\S+)/i);\n return bearer !== null && bearer !== undefined && looksLikeVcJwt(bearer[1]);\n}\n\n/**\n * True when `Signature-Input` or `Signature` carries a `kya` member, i.e. the\n * request presents a KYA HTTP Binding (kya-http/2) signature. Same member scan\n * as {@link requestPresentedCredential}; routing only, the engine validates it.\n */\nexport function requestPresentsKyaSignature(\n headers: Headers | Record<string, unknown> | null | undefined\n): boolean {\n if (!headers) return false;\n return ['signature-input', 'signature'].some((name) => {\n const value = headerText(headers, name);\n return value !== undefined && hasKyaMember(value);\n });\n}\n\n/**\n * True when the request's framing says it carries a body: a\n * `Transfer-Encoding` header, or a `Content-Length` other than exactly `0`\n * (an empty, blank or malformed length counts as a body, so it fails closed).\n * This is `type-is`'s `hasBody`, except that `Content-Length: 0` is an empty\n * body. A kya-http/2 verifier uses it to tell a request with no body apart\n * from one whose body bytes it never received. HTTP/2 can carry a body with\n * neither header, so a host that can read the body should pass its bytes\n * instead of relying on this.\n */\nexport function requestDeclaresBody(\n headers: Headers | Record<string, unknown> | null | undefined\n): boolean {\n if (!headers) return false;\n if (headerText(headers, 'transfer-encoding') !== undefined) return true;\n const contentLength = headerText(headers, 'content-length');\n // A string compare, not Number(): Number('') and Number(' ') are 0.\n return contentLength !== undefined && contentLength !== '0';\n}\n","/**\n * The body bound of a kya-http/2 (KYA HTTP Binding) signed request.\n *\n * A kya-http/2 signature binds the body through `Content-Digest`, so a host\n * hands the engine the exact body bytes. Every host bounds them the same way,\n * at the .NET adapters' 1 MiB: a larger signed body is answered 413 and never\n * verified in part. In observe mode it goes on without its bytes, and the\n * refusal it would have been is reported.\n */\n\nimport { requestDeclaresBody } from './delegation-headers';\n\n/** Largest kya-http/2 signed body a host hands the engine. */\nexport const KYA_SIGNED_BODY_MAX_BYTES = 1_048_576;\n\n/** A bounded read: the whole body, or why there is none. Never a prefix. */\nexport type BoundedBody = { bytes: Uint8Array } | { failure: 'too-large' | 'unreadable' };\n\n/**\n * Read a clone of `request`'s body, stopping at `maxBytes`, so the original\n * body is still owed, whole, downstream. A request with no body stream reads\n * as empty, unless its framing declares a body (one the host dropped): that is\n * `unreadable`, never an empty body.\n *\n * Streamed with an early stop, not `arrayBuffer()`: a chunked body with no\n * `Content-Length` would otherwise be pulled whole (into both branches of the\n * clone's tee) before its size was ever looked at.\n */\nexport async function readBodyBounded(request: Request, maxBytes: number): Promise<BoundedBody> {\n const declaredLength = Number(request.headers.get('content-length'));\n if (Number.isFinite(declaredLength) && declaredLength > maxBytes) {\n return { failure: 'too-large' };\n }\n const stream = request.clone().body;\n if (!stream) {\n return requestDeclaresBody(request.headers)\n ? { failure: 'unreadable' }\n : { bytes: new Uint8Array(0) };\n }\n const reader = stream.getReader();\n const chunks: Uint8Array[] = [];\n let total = 0;\n try {\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n total += value.byteLength;\n if (total > maxBytes) {\n // Not awaited: cancelling one branch of a tee settles only once the\n // other branch (the original body, still owed downstream) is\n // cancelled too, so awaiting here would never return.\n reader.cancel().catch(() => undefined);\n return { failure: 'too-large' };\n }\n chunks.push(value);\n }\n } catch {\n return { failure: 'unreadable' };\n }\n const bytes = new Uint8Array(total);\n let offset = 0;\n for (const chunk of chunks) {\n bytes.set(chunk, offset);\n offset += chunk.byteLength;\n }\n return { bytes };\n}\n","/**\n * Canonical did:web for the anonymous-principal sentinel (see `./principal.ts`).\n * Kept apart from the client DID derivation, which loads `@noble/hashes`, so\n * request-path code can take it from the `./kya-http` lean entry.\n */\nexport const ANONYMOUS_PRINCIPAL_DID = 'did:web:kya.vouched.id:principals:anonymous';\n","/**\n * The registered session anchor (`sid`) contract between a reporter and\n * Checkpoint ingest. Kept apart from `reported-identity.ts`, which builds Zod\n * schemas when it loads, so the runtime and the `./kya-http` entry can read\n * these values without loading Zod.\n */\n\n/**\n * Max length of a registered session anchor (`sid`) accepted on the wire and\n * enforced again at the customer route. The join partner\n * `bouncer_sessions.id` is `varchar(100)`; `detections.registered_sid` stays\n * `text` (converting a live column to `varchar` would take an ACCESS EXCLUSIVE\n * rewrite of the hottest table), so this constant is the width contract\n * instead of the column type.\n */\nexport const REGISTERED_SID_MAX_LENGTH = 100;\n\n/**\n * The one delegation result that may attribute a `sid` to a session timeline.\n * A rejected presentation carries no engine-emitted sid, and a sid on a\n * `failed` / `not_presented` report is attacker-shaped, so ingest stamps\n * `registered_sid` only for this result and nulls it otherwise (D4 / D15).\n * One member on purpose: Section 13 of the plan records how an explicitly\n * unverified-labeled `failed` could join it later.\n */\nexport const SID_ATTRIBUTABLE_RESULT = 'verified' as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAa,2BAA2B,CAAC,gCAAgC,gBAAgB;;AAGzF,SAAS,UAAU,OAAyB;CAC1C,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,SAAS;CAChD,OAAO,OAAO,UAAU,YAAY,MAAM,SAAS;AACrD;;;;;;;;;AAUA,SAAgB,8BACd,SACS;CACT,IAAI,CAAC,SAAS,OAAO;CAErB,IAAI,OAAQ,QAAoB,QAAQ,YAAY;EAClD,MAAM,IAAI;EACV,OAAO,yBAAyB,MAAM,SAAS,UAAU,EAAE,IAAI,IAAI,CAAC,CAAC;CACvE;CAEA,MAAM,SAAS;CACf,MAAM,6BAAa,IAAI,IAAqB;CAC5C,KAAK,MAAM,OAAO,OAAO,KAAK,MAAM,GAClC,WAAW,IAAI,IAAI,YAAY,GAAG,OAAO,IAAI;CAE/C,OAAO,yBAAyB,MAAM,SAAS,UAAU,WAAW,IAAI,IAAI,CAAC,CAAC;AAChF;AAEA,MAAM,2BAA2B;AAEjC,SAAS,WAAW,SAA4C,MAAkC;CAChG,IAAI,OAAQ,QAAoB,QAAQ,YACtC,OAAQ,QAAo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IAAI,gBAAgB,CAAC;CACnE,IAAI,OAAO,SAAS,cAAc,KAAK,iBAAiB,UACtD,OAAO,EAAE,SAAS,YAAY;CAEhC,MAAM,SAAS,QAAQ,MAAM,CAAC,CAAC;CAC/B,IAAI,CAAC,QACH,OAAO,oBAAoB,QAAQ,OAAO,IACtC,EAAE,SAAS,aAAa,IACxB,EAAE,uBAAO,IAAI,WAAW,CAAC,EAAE;CAEjC,MAAM,SAAS,OAAO,UAAU;CAChC,MAAM,SAAuB,CAAC;CAC9B,IAAI,QAAQ;CACZ,IAAI;EACF,SAAS;GACP,MAAM,EAAE,MAAM,UAAU,MAAM,OAAO,KAAK;GAC1C,IAAI,MAAM;GACV,SAAS,MAAM;GACf,IAAI,QAAQ,UAAU;IAIpB,OAAO,OAAO,CAAC,CAAC,YAAY,MAAS;IACrC,OAAO,EAAE,SAAS,YAAY;GAChC;GACA,OAAO,KAAK,KAAK;EACnB;CACF,QAAQ;EACN,OAAO,EAAE,SAAS,aAAa;CACjC;CACA,MAAM,QAAQ,IAAI,WAAW,KAAK;CAClC,IAAI,SAAS;CACb,KAAK,MAAM,SAAS,QAAQ;EAC1B,MAAM,IAAI,OAAO,MAAM;EACvB,UAAU,MAAM;CAClB;CACA,OAAO,EAAE,MAAM;AACjB;;;;;;;;;AC7DA,MAAa,0BAA0B;;;;;;;;;;;;;;;;;;ACUvC,MAAa,4BAA4B;;;;;;;;;AAUzC,MAAa,0BAA0B"}
|
|
@@ -21,6 +21,17 @@ declare function getVerificationRiskLevel(method: VerificationMethod, confidence
|
|
|
21
21
|
declare const DELEGATION_PROOF_HEADERS: readonly ["kya-os-delegation-credential", "kya-delegation"];
|
|
22
22
|
declare function requestCarriesDelegationProof(headers: Headers | Record<string, unknown> | null | undefined): boolean;
|
|
23
23
|
declare function requestPresentedCredential(headers: Headers | Record<string, unknown> | null | undefined): boolean;
|
|
24
|
+
declare function requestPresentsKyaSignature(headers: Headers | Record<string, unknown> | null | undefined): boolean;
|
|
25
|
+
declare function requestDeclaresBody(headers: Headers | Record<string, unknown> | null | undefined): boolean;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/mcpi/signed-body.d.ts
|
|
28
|
+
declare const KYA_SIGNED_BODY_MAX_BYTES = 1048576;
|
|
29
|
+
type BoundedBody = {
|
|
30
|
+
bytes: Uint8Array;
|
|
31
|
+
} | {
|
|
32
|
+
failure: 'too-large' | 'unreadable';
|
|
33
|
+
};
|
|
34
|
+
declare function readBodyBounded(request: Request, maxBytes: number): Promise<BoundedBody>;
|
|
24
35
|
//#endregion
|
|
25
36
|
//#region src/mcpi/anonymous-principal.d.ts
|
|
26
37
|
declare const ANONYMOUS_PRINCIPAL_DID = "did:web:kya.vouched.id:principals:anonymous";
|
|
@@ -29,5 +40,5 @@ declare const ANONYMOUS_PRINCIPAL_DID = "did:web:kya.vouched.id:principals:anony
|
|
|
29
40
|
declare const REGISTERED_SID_MAX_LENGTH = 100;
|
|
30
41
|
declare const SID_ATTRIBUTABLE_RESULT: "verified";
|
|
31
42
|
//#endregion
|
|
32
|
-
export { normalizeWireMethod as _,
|
|
33
|
-
//# sourceMappingURL=registered-sid-
|
|
43
|
+
export { normalizeWireMethod as S, getVerificationRiskLevel as _, KYA_SIGNED_BODY_MAX_BYTES as a, isKyaOsWireMethod as b, requestCarriesDelegationProof as c, requestPresentsKyaSignature as d, KYA_OS_HANDSHAKE_METHODS as f, getVerificationReliability as g, getVerificationMethodDescription as h, BoundedBody as i, requestDeclaresBody as l, VerificationMethod as m, SID_ATTRIBUTABLE_RESULT as n, readBodyBounded as o, KYA_OS_WIRE_METHODS as p, ANONYMOUS_PRINCIPAL_DID as r, DELEGATION_PROOF_HEADERS as s, REGISTERED_SID_MAX_LENGTH as t, requestPresentedCredential as u, isHighConfidenceVerification as v, normalizeHandshakeMethod as x, isKyaOsHandshakeMethod as y };
|
|
44
|
+
//# sourceMappingURL=registered-sid-CnWIU_l1.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registered-sid-CnWIU_l1.d.mts","names":[],"sources":["../src/utils/verification.ts","../src/mcpi/delegation-headers.ts","../src/mcpi/signed-body.ts","../src/mcpi/anonymous-principal.ts","../src/mcpi/registered-sid.ts"],"mappings":";KAIY;cA8BC;WAAA;WAAA;;cAOA;WAAA;WAAA;;iBAQG,uBAAuB;iBAKvB,kBAAkB;iBAsBlB,yBAAyB,qCACvC,OAAO,IACN,WAAW,yBAAyB;iBAavB,oBAAoB,qCAClC,OAAO,IACN,WAAW,oBAAoB;iBAOlB,iCAAiC,QAAQ;iBA2BzC,2BAA2B,QAAQ;iBAwBnC,6BAA6B,QAAQ;iBAQrC,yBACd,QAAQ,oBACR;;;cC9IW;iBAgBG,8BACd,SAAS,UAAU;iBA4FL,2BACd,SAAS,UAAU;iBAeL,4BACd,SAAS,UAAU;iBAmBL,oBACd,SAAS,UAAU;;;cCxJR;KAGD;EAAgB,OAAO;;EAAiB;;iBAY9B,gBAAgB,SAAS,SAAS,mBAAmB,QAAQ;;;cCvBtE;;;cCUA;cAUA"}
|
|
@@ -21,6 +21,17 @@ declare function getVerificationRiskLevel(method: VerificationMethod, confidence
|
|
|
21
21
|
declare const DELEGATION_PROOF_HEADERS: readonly ["kya-os-delegation-credential", "kya-delegation"];
|
|
22
22
|
declare function requestCarriesDelegationProof(headers: Headers | Record<string, unknown> | null | undefined): boolean;
|
|
23
23
|
declare function requestPresentedCredential(headers: Headers | Record<string, unknown> | null | undefined): boolean;
|
|
24
|
+
declare function requestPresentsKyaSignature(headers: Headers | Record<string, unknown> | null | undefined): boolean;
|
|
25
|
+
declare function requestDeclaresBody(headers: Headers | Record<string, unknown> | null | undefined): boolean;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/mcpi/signed-body.d.ts
|
|
28
|
+
declare const KYA_SIGNED_BODY_MAX_BYTES = 1048576;
|
|
29
|
+
type BoundedBody = {
|
|
30
|
+
bytes: Uint8Array;
|
|
31
|
+
} | {
|
|
32
|
+
failure: 'too-large' | 'unreadable';
|
|
33
|
+
};
|
|
34
|
+
declare function readBodyBounded(request: Request, maxBytes: number): Promise<BoundedBody>;
|
|
24
35
|
//#endregion
|
|
25
36
|
//#region src/mcpi/anonymous-principal.d.ts
|
|
26
37
|
declare const ANONYMOUS_PRINCIPAL_DID = "did:web:kya.vouched.id:principals:anonymous";
|
|
@@ -29,5 +40,5 @@ declare const ANONYMOUS_PRINCIPAL_DID = "did:web:kya.vouched.id:principals:anony
|
|
|
29
40
|
declare const REGISTERED_SID_MAX_LENGTH = 100;
|
|
30
41
|
declare const SID_ATTRIBUTABLE_RESULT: "verified";
|
|
31
42
|
//#endregion
|
|
32
|
-
export { normalizeWireMethod as _,
|
|
33
|
-
//# sourceMappingURL=registered-sid-
|
|
43
|
+
export { normalizeWireMethod as S, getVerificationRiskLevel as _, KYA_SIGNED_BODY_MAX_BYTES as a, isKyaOsWireMethod as b, requestCarriesDelegationProof as c, requestPresentsKyaSignature as d, KYA_OS_HANDSHAKE_METHODS as f, getVerificationReliability as g, getVerificationMethodDescription as h, BoundedBody as i, requestDeclaresBody as l, VerificationMethod as m, SID_ATTRIBUTABLE_RESULT as n, readBodyBounded as o, KYA_OS_WIRE_METHODS as p, ANONYMOUS_PRINCIPAL_DID as r, DELEGATION_PROOF_HEADERS as s, REGISTERED_SID_MAX_LENGTH as t, requestPresentedCredential as u, isHighConfidenceVerification as v, normalizeHandshakeMethod as x, isKyaOsHandshakeMethod as y };
|
|
44
|
+
//# sourceMappingURL=registered-sid-CnWIU_l1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registered-sid-CnWIU_l1.d.ts","names":[],"sources":["../src/utils/verification.ts","../src/mcpi/delegation-headers.ts","../src/mcpi/signed-body.ts","../src/mcpi/anonymous-principal.ts","../src/mcpi/registered-sid.ts"],"mappings":";KAIY;cA8BC;WAAA;WAAA;;cAOA;WAAA;WAAA;;iBAQG,uBAAuB;iBAKvB,kBAAkB;iBAsBlB,yBAAyB,qCACvC,OAAO,IACN,WAAW,yBAAyB;iBAavB,oBAAoB,qCAClC,OAAO,IACN,WAAW,oBAAoB;iBAOlB,iCAAiC,QAAQ;iBA2BzC,2BAA2B,QAAQ;iBAwBnC,6BAA6B,QAAQ;iBAQrC,yBACd,QAAQ,oBACR;;;cC9IW;iBAgBG,8BACd,SAAS,UAAU;iBA4FL,2BACd,SAAS,UAAU;iBAeL,4BACd,SAAS,UAAU;iBAmBL,oBACd,SAAS,UAAU;;;cCxJR;KAGD;EAAgB,OAAO;;EAAiB;;iBAY9B,gBAAgB,SAAS,SAAS,mBAAmB,QAAQ;;;cCvBtE;;;cCUA;cAUA"}
|
|
@@ -265,8 +265,8 @@ declare const ConditionOperatorSchema: ZodEnum<{
|
|
|
265
265
|
notIn: "notIn";
|
|
266
266
|
}>;
|
|
267
267
|
declare const ConditionFieldSchema: ZodEnum<{
|
|
268
|
-
origin: "origin";
|
|
269
268
|
path: "path";
|
|
269
|
+
origin: "origin";
|
|
270
270
|
confidence: "confidence";
|
|
271
271
|
clientDid: "clientDid";
|
|
272
272
|
agentDid: "agentDid";
|
|
@@ -284,8 +284,8 @@ declare const ConditionFieldSchema: ZodEnum<{
|
|
|
284
284
|
declare const ConditionValueSchema: ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean, ZodArray<ZodString>]>;
|
|
285
285
|
declare const PolicyConditionSchema: ZodObject<{
|
|
286
286
|
field: ZodEnum<{
|
|
287
|
-
origin: "origin";
|
|
288
287
|
path: "path";
|
|
288
|
+
origin: "origin";
|
|
289
289
|
confidence: "confidence";
|
|
290
290
|
clientDid: "clientDid";
|
|
291
291
|
agentDid: "agentDid";
|
|
@@ -330,8 +330,8 @@ declare const PolicyRuleSchema: ZodObject<{
|
|
|
330
330
|
priority: ZodDefault<ZodNumber>;
|
|
331
331
|
conditions: ZodArray<ZodObject<{
|
|
332
332
|
field: ZodEnum<{
|
|
333
|
-
origin: "origin";
|
|
334
333
|
path: "path";
|
|
334
|
+
origin: "origin";
|
|
335
335
|
confidence: "confidence";
|
|
336
336
|
clientDid: "clientDid";
|
|
337
337
|
agentDid: "agentDid";
|
|
@@ -451,8 +451,8 @@ declare const PolicyConfigSchema: ZodObject<{
|
|
|
451
451
|
priority: ZodDefault<ZodNumber>;
|
|
452
452
|
conditions: ZodArray<ZodObject<{
|
|
453
453
|
field: ZodEnum<{
|
|
454
|
-
origin: "origin";
|
|
455
454
|
path: "path";
|
|
455
|
+
origin: "origin";
|
|
456
456
|
confidence: "confidence";
|
|
457
457
|
clientDid: "clientDid";
|
|
458
458
|
agentDid: "agentDid";
|
|
@@ -532,4 +532,4 @@ type PolicyConfig = output<typeof PolicyConfigSchema>;
|
|
|
532
532
|
declare function safeParsePolicyConfig(data: unknown): PolicyConfig | null;
|
|
533
533
|
//#endregion
|
|
534
534
|
export { PolicyMetadataSchema as A, ThresholdConfigSchema as B, InstructPayload as C, PolicyConfig as D, PolicyConditionSchema as E, RuleMetadata as F, RuleMetadataSchema as I, SuggestedAction as L, PolicyRuleSchema as M, RedirectTarget as N, PolicyConfigSchema as O, RedirectTargetSchema as P, SuggestedActionSchema as R, EnforcementModeSchema as S, PolicyCondition as T, safeParsePolicyConfig as V, DenyListEntry as _, BlockReason as a, EnforcementActionSchema as b, ChallengeParamsSchema as c, ConditionOperator as d, ConditionOperatorSchema as f, DecisionSchema as g, Decision as h, AssuranceTierSchema as i, PolicyRule as j, PolicyMetadata as k, ConditionField as l, ConditionValueSchema as m, AllowListEntrySchema as n, BlockReasonSchema as o, ConditionValue as p, AssuranceTier as r, ChallengeParams as s, AllowListEntry as t, ConditionFieldSchema as u, DenyListEntrySchema as v, InstructPayloadSchema as w, EnforcementMode as x, EnforcementAction as y, ThresholdConfig as z };
|
|
535
|
-
//# sourceMappingURL=schemas-
|
|
535
|
+
//# sourceMappingURL=schemas-BhC88D1-.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas-
|
|
1
|
+
{"version":3,"file":"schemas-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;;;;;;;;GAsF7B;KAMU,oBAAoB,cAAe;KACnC,kBAAkB,cAAe;KACjC,gBAAgB,cAAe;KAC/B,iBAAiB,cAAe;KAChC,oBAAoB,cAAe;KACnC,iBAAiB,cAAe;KAChC,iBAAiB,cAAe;KAChC,kBAAkB,cAAe;KACjC,eAAe,cAAe;KAC9B,aAAa,cAAe;KAC5B,iBAAiB,cAAe;KAChC,eAAe,cAAe;iBAW1B,sBAAsB,gBAAgB"}
|
|
@@ -265,8 +265,8 @@ declare const ConditionOperatorSchema: ZodEnum<{
|
|
|
265
265
|
notIn: "notIn";
|
|
266
266
|
}>;
|
|
267
267
|
declare const ConditionFieldSchema: ZodEnum<{
|
|
268
|
-
origin: "origin";
|
|
269
268
|
path: "path";
|
|
269
|
+
origin: "origin";
|
|
270
270
|
confidence: "confidence";
|
|
271
271
|
clientDid: "clientDid";
|
|
272
272
|
agentDid: "agentDid";
|
|
@@ -284,8 +284,8 @@ declare const ConditionFieldSchema: ZodEnum<{
|
|
|
284
284
|
declare const ConditionValueSchema: ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean, ZodArray<ZodString>]>;
|
|
285
285
|
declare const PolicyConditionSchema: ZodObject<{
|
|
286
286
|
field: ZodEnum<{
|
|
287
|
-
origin: "origin";
|
|
288
287
|
path: "path";
|
|
288
|
+
origin: "origin";
|
|
289
289
|
confidence: "confidence";
|
|
290
290
|
clientDid: "clientDid";
|
|
291
291
|
agentDid: "agentDid";
|
|
@@ -330,8 +330,8 @@ declare const PolicyRuleSchema: ZodObject<{
|
|
|
330
330
|
priority: ZodDefault<ZodNumber>;
|
|
331
331
|
conditions: ZodArray<ZodObject<{
|
|
332
332
|
field: ZodEnum<{
|
|
333
|
-
origin: "origin";
|
|
334
333
|
path: "path";
|
|
334
|
+
origin: "origin";
|
|
335
335
|
confidence: "confidence";
|
|
336
336
|
clientDid: "clientDid";
|
|
337
337
|
agentDid: "agentDid";
|
|
@@ -451,8 +451,8 @@ declare const PolicyConfigSchema: ZodObject<{
|
|
|
451
451
|
priority: ZodDefault<ZodNumber>;
|
|
452
452
|
conditions: ZodArray<ZodObject<{
|
|
453
453
|
field: ZodEnum<{
|
|
454
|
-
origin: "origin";
|
|
455
454
|
path: "path";
|
|
455
|
+
origin: "origin";
|
|
456
456
|
confidence: "confidence";
|
|
457
457
|
clientDid: "clientDid";
|
|
458
458
|
agentDid: "agentDid";
|
|
@@ -532,4 +532,4 @@ type PolicyConfig = output<typeof PolicyConfigSchema>;
|
|
|
532
532
|
declare function safeParsePolicyConfig(data: unknown): PolicyConfig | null;
|
|
533
533
|
//#endregion
|
|
534
534
|
export { PolicyMetadataSchema as A, ThresholdConfigSchema as B, InstructPayload as C, PolicyConfig as D, PolicyConditionSchema as E, RuleMetadata as F, RuleMetadataSchema as I, SuggestedAction as L, PolicyRuleSchema as M, RedirectTarget as N, PolicyConfigSchema as O, RedirectTargetSchema as P, SuggestedActionSchema as R, EnforcementModeSchema as S, PolicyCondition as T, safeParsePolicyConfig as V, DenyListEntry as _, BlockReason as a, EnforcementActionSchema as b, ChallengeParamsSchema as c, ConditionOperator as d, ConditionOperatorSchema as f, DecisionSchema as g, Decision as h, AssuranceTierSchema as i, PolicyRule as j, PolicyMetadata as k, ConditionField as l, ConditionValueSchema as m, AllowListEntrySchema as n, BlockReasonSchema as o, ConditionValue as p, AssuranceTier as r, ChallengeParams as s, AllowListEntry as t, ConditionFieldSchema as u, DenyListEntrySchema as v, InstructPayloadSchema as w, EnforcementMode as x, EnforcementAction as y, ThresholdConfig as z };
|
|
535
|
-
//# sourceMappingURL=schemas-
|
|
535
|
+
//# sourceMappingURL=schemas-DZa1ouGs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas-
|
|
1
|
+
{"version":3,"file":"schemas-DZa1ouGs.d.ts","names":[],"sources":["../src/policy/schemas.ts"],"mappings":";;cAiCa,yBAAuB;;;;;;;;;cAgBvB,uBAAqB;;;;KAEtB,kBAAkB,cAAe;cAo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ACnC,iBAAiB,cAAe;KAChC,iBAAiB,cAAe;KAChC,kBAAkB,cAAe;KACjC,eAAe,cAAe;KAC9B,aAAa,cAAe;KAC5B,iBAAiB,cAAe;KAChC,eAAe,cAAe;iBAW1B,sBAAsB,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/signals/types.ts","../../src/signals/registry.ts","../../src/signals/resolve.ts","../../src/signals/merkle.ts","../../src/signals/session-fingerprint-hash.ts","../../src/signals/device-fingerprint.ts","../../src/signals/validate.ts","../../src/signals/immutability.ts","../../src/signals/docs.ts","../../src/signals/sensitive-attributes.ts"],"mappings":";qBAuBa;KAED,0BAA0B;qBAEzB,0BAA0B;KAU3B;KAQA;KASA;KAEA;EAAkB;;EAAmB;EAAe;;UAS/C;EAEf;EACA;EAEA;EAEA;EACA;EACA;;qBAIW;KAED,wCAAwC;KAMxC;UAgBK;EAEf,aAAa;EACb;EAEA;EAEA;EAEA,iBAAiB;EAEjB;;UAGe;EAEf;EAEA,cAAc;EAEd,gBAAgB;EAChB,MAAM;EACN,aAAa;EACb,SAAS;EACT,MAAM;EACN,OAAO;EAEP;EAEA;EAEA;EACA;EAOA,QAAQ;;qBAIG;qBASA;UASI;EACf;EACA,cAAc;EACd,gBAAgB;EAChB,SAAS;EACT,MAAM;EACN,OAAO;EACP;EACA,eAAe;;;;qBCrCJ,iBAAiB;;;wBC3Gd,iBACd,UAAU,oBACV,UAAS,kBACR;wBASa,UACd,UAAU,oBACV,YACA,UAAS,kBACR;wBAKa,mBAAmB,UAAU,qBAAqB;KAItD,iBAAiB,OAAO,aAAa,eAAe;wBAOhD,aAAa,SAAS,qBAAqB;;;KCG/C;EACN;EAAiB;;EACjB;;EACA;EAAe;;UAEJ;EAEf;EAEA,QAAQ;;UAGO;EAEf;EAKA;EACA,QAAQ,eAAe;;UAGR;EAEf,iBAAiB;EAEjB;EAEA,QAAQ,QAAQ,OAAO,aAAa;;wBAiFtB,qBACd,UAAU,oBACV,UAAU,eAAe,gBACzB,kBAAiB,kBAChB;;;wBC7Fa,8BACd,kBAAkB;;;qBCjFP;qBAEA;KAED;UAEK;WACN,MAAM;WACN;WACA;WACA;;qBA2BE;qBAEA;qBAEA;qBA6BA,iCAAiC,oBAAoB;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/signals/types.ts","../../src/signals/registry.ts","../../src/signals/resolve.ts","../../src/signals/merkle.ts","../../src/signals/session-fingerprint-hash.ts","../../src/signals/device-fingerprint.ts","../../src/signals/validate.ts","../../src/signals/immutability.ts","../../src/signals/docs.ts","../../src/signals/sensitive-attributes.ts"],"mappings":";qBAuBa;KAED,0BAA0B;qBAEzB,0BAA0B;KAU3B;KAQA;KASA;KAEA;EAAkB;;EAAmB;EAAe;;UAS/C;EAEf;EACA;EAEA;EAEA;EACA;EACA;;qBAIW;KAED,wCAAwC;KAMxC;UAgBK;EAEf,aAAa;EACb;EAEA;EAEA;EAEA,iBAAiB;EAEjB;;UAGe;EAEf;EAEA,cAAc;EAEd,gBAAgB;EAChB,MAAM;EACN,aAAa;EACb,SAAS;EACT,MAAM;EACN,OAAO;EAEP;EAEA;EAEA;EACA;EAOA,QAAQ;;qBAIG;qBASA;UASI;EACf;EACA,cAAc;EACd,gBAAgB;EAChB,SAAS;EACT,MAAM;EACN,OAAO;EACP;EACA,eAAe;;;;qBCrCJ,iBAAiB;;;wBC3Gd,iBACd,UAAU,oBACV,UAAS,kBACR;wBASa,UACd,UAAU,oBACV,YACA,UAAS,kBACR;wBAKa,mBAAmB,UAAU,qBAAqB;KAItD,iBAAiB,OAAO,aAAa,eAAe;wBAOhD,aAAa,SAAS,qBAAqB;;;KCG/C;EACN;EAAiB;;EACjB;;EACA;EAAe;;UAEJ;EAEf;EAEA,QAAQ;;UAGO;EAEf;EAKA;EACA,QAAQ,eAAe;;UAGR;EAEf,iBAAiB;EAEjB;EAEA,QAAQ,QAAQ,OAAO,aAAa;;wBAiFtB,qBACd,UAAU,oBACV,UAAU,eAAe,gBACzB,kBAAiB,kBAChB;;;wBC7Fa,8BACd,kBAAkB;;;qBCjFP;qBAEA;KAED;UAEK;WACN,MAAM;WACN;WACA;WACA;;qBA2BE;qBAEA;qBAEA;qBA6BA,iCAAiC,oBAAoB;wBAuMlD,0BAA0B;wBAK1B,iCAAiC;wBA4BjC,6BACd,YAAY,SAAS,6CACpB;wBAgBa,4BACd,YAAY,SAAS,6CACpB;wBAWa,yBACd,YAAY,SAAS;;;UC1UN;EACf;EACA;;wBAac,iBAAiB,SAAS,qBAAqB;;;UCpB9C;EACf;EACA;EACA;;UAGe;EACf;EACA,YAAY;;wBAgBE,yBAAyB,QAAQ,mBAAmB;wBA0BpD,yBACd,WAAW,kBACX,MAAM,qBACL;wBA0Ea,eACd,WAAW,kBACX,MAAM,qBACL;;;wBCzEa,yBAAyB,UAAU;;;qBCLtC,0CAA0C;UAGtC;EACf,UAAU;EACV;EAEA;EAOA;;qBAGW,oCAAoC,OAC/C,+BACA;UA8Ge;EACf;EACA,UAAU;EAEV;EAEA;EACA;EACA;;qBAGW,wBAAwB;KAsCzB;UAMK;EACf,MAAM;EAEN,UAAU;EAEV;EACA;EACA;;wBAiCc,iBACd,QAAQ,KAAK,mDACb,UAAS,gCACR;wBAwBa,qBACd,kBACA,yBACC;wBAoBa,sBACd,QAAQ,KAAK,8CACb,UAAS,gCACR;wBAuBa,2BACd,QAAQ,wCACR,iBAAgB,gCACf;wBAsCa,qCACd,QAAQ,mBACP;qBAiBU,yCAAyC;WAC3C;WACA,YAAY;EAET,YAAA,kBAAkB,YAAY;;wBAqB5B,eAAe,YAAY,mBAAmB;wBAa9C,kCAAkC,QAAQ;EACxD;EACA,YAAY;;wBAaE,+BACd,SAAS,oBACT,iBAAgB,gCACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/signals/types.ts","../../src/signals/registry.ts","../../src/signals/resolve.ts","../../src/signals/merkle.ts","../../src/signals/session-fingerprint-hash.ts","../../src/signals/device-fingerprint.ts","../../src/signals/validate.ts","../../src/signals/immutability.ts","../../src/signals/docs.ts","../../src/signals/sensitive-attributes.ts"],"mappings":";qBAuBa;KAED,0BAA0B;qBAEzB,0BAA0B;KAU3B;KAQA;KASA;KAEA;EAAkB;;EAAmB;EAAe;;UAS/C;EAEf;EACA;EAEA;EAEA;EACA;EACA;;qBAIW;KAED,wCAAwC;KAMxC;UAgBK;EAEf,aAAa;EACb;EAEA;EAEA;EAEA,iBAAiB;EAEjB;;UAGe;EAEf;EAEA,cAAc;EAEd,gBAAgB;EAChB,MAAM;EACN,aAAa;EACb,SAAS;EACT,MAAM;EACN,OAAO;EAEP;EAEA;EAEA;EACA;EAOA,QAAQ;;qBAIG;qBASA;UASI;EACf;EACA,cAAc;EACd,gBAAgB;EAChB,SAAS;EACT,MAAM;EACN,OAAO;EACP;EACA,eAAe;;;;qBCrCJ,iBAAiB;;;wBC3Gd,iBACd,UAAU,oBACV,UAAS,kBACR;wBASa,UACd,UAAU,oBACV,YACA,UAAS,kBACR;wBAKa,mBAAmB,UAAU,qBAAqB;KAItD,iBAAiB,OAAO,aAAa,eAAe;wBAOhD,aAAa,SAAS,qBAAqB;;;KCG/C;EACN;EAAiB;;EACjB;;EACA;EAAe;;UAEJ;EAEf;EAEA,QAAQ;;UAGO;EAEf;EAKA;EACA,QAAQ,eAAe;;UAGR;EAEf,iBAAiB;EAEjB;EAEA,QAAQ,QAAQ,OAAO,aAAa;;wBAiFtB,qBACd,UAAU,oBACV,UAAU,eAAe,gBACzB,kBAAiB,kBAChB;;;wBC7Fa,8BACd,kBAAkB;;;qBCjFP;qBAEA;KAED;UAEK;WACN,MAAM;WACN;WACA;WACA;;qBA2BE;qBAEA;qBAEA;qBA6BA,iCAAiC,oBAAoB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/signals/types.ts","../../src/signals/registry.ts","../../src/signals/resolve.ts","../../src/signals/merkle.ts","../../src/signals/session-fingerprint-hash.ts","../../src/signals/device-fingerprint.ts","../../src/signals/validate.ts","../../src/signals/immutability.ts","../../src/signals/docs.ts","../../src/signals/sensitive-attributes.ts"],"mappings":";qBAuBa;KAED,0BAA0B;qBAEzB,0BAA0B;KAU3B;KAQA;KASA;KAEA;EAAkB;;EAAmB;EAAe;;UAS/C;EAEf;EACA;EAEA;EAEA;EACA;EACA;;qBAIW;KAED,wCAAwC;KAMxC;UAgBK;EAEf,aAAa;EACb;EAEA;EAEA;EAEA,iBAAiB;EAEjB;;UAGe;EAEf;EAEA,cAAc;EAEd,gBAAgB;EAChB,MAAM;EACN,aAAa;EACb,SAAS;EACT,MAAM;EACN,OAAO;EAEP;EAEA;EAEA;EACA;EAOA,QAAQ;;qBAIG;qBASA;UASI;EACf;EACA,cAAc;EACd,gBAAgB;EAChB,SAAS;EACT,MAAM;EACN,OAAO;EACP;EACA,eAAe;;;;qBCrCJ,iBAAiB;;;wBC3Gd,iBACd,UAAU,oBACV,UAAS,kBACR;wBASa,UACd,UAAU,oBACV,YACA,UAAS,kBACR;wBAKa,mBAAmB,UAAU,qBAAqB;KAItD,iBAAiB,OAAO,aAAa,eAAe;wBAOhD,aAAa,SAAS,qBAAqB;;;KCG/C;EACN;EAAiB;;EACjB;;EACA;EAAe;;UAEJ;EAEf;EAEA,QAAQ;;UAGO;EAEf;EAKA;EACA,QAAQ,eAAe;;UAGR;EAEf,iBAAiB;EAEjB;EAEA,QAAQ,QAAQ,OAAO,aAAa;;wBAiFtB,qBACd,UAAU,oBACV,UAAU,eAAe,gBACzB,kBAAiB,kBAChB;;;wBC7Fa,8BACd,kBAAkB;;;qBCjFP;qBAEA;KAED;UAEK;WACN,MAAM;WACN;WACA;WACA;;qBA2BE;qBAEA;qBAEA;qBA6BA,iCAAiC,oBAAoB;wBAuMlD,0BAA0B;wBAK1B,iCAAiC;wBA4BjC,6BACd,YAAY,SAAS,6CACpB;wBAgBa,4BACd,YAAY,SAAS,6CACpB;wBAWa,yBACd,YAAY,SAAS;;;UC1UN;EACf;EACA;;wBAac,iBAAiB,SAAS,qBAAqB;;;UCpB9C;EACf;EACA;EACA;;UAGe;EACf;EACA,YAAY;;wBAgBE,yBAAyB,QAAQ,mBAAmB;wBA0BpD,yBACd,WAAW,kBACX,MAAM,qBACL;wBA0Ea,eACd,WAAW,kBACX,MAAM,qBACL;;;wBCzEa,yBAAyB,UAAU;;;qBCLtC,0CAA0C;UAGtC;EACf,UAAU;EACV;EAEA;EAOA;;qBAGW,oCAAoC,OAC/C,+BACA;UA8Ge;EACf;EACA,UAAU;EAEV;EAEA;EACA;EACA;;qBAGW,wBAAwB;KAsCzB;UAMK;EACf,MAAM;EAEN,UAAU;EAEV;EACA;EACA;;wBAiCc,iBACd,QAAQ,KAAK,mDACb,UAAS,gCACR;wBAwBa,qBACd,kBACA,yBACC;wBAoBa,sBACd,QAAQ,KAAK,8CACb,UAAS,gCACR;wBAuBa,2BACd,QAAQ,wCACR,iBAAgB,gCACf;wBAsCa,qCACd,QAAQ,mBACP;qBAiBU,yCAAyC;WAC3C;WACA,YAAY;EAET,YAAA,kBAAkB,YAAY;;wBAqB5B,eAAe,YAAY,mBAAmB;wBAa9C,kCAAkC,QAAQ;EACxD;EACA,YAAY;;wBAaE,+BACd,SAAS,oBACT,iBAAgB,gCACf"}
|
package/dist/signals/index.js
CHANGED
|
@@ -1681,6 +1681,8 @@ const CLIENT_ATTRIBUTE_CLASSIFICATION = /* @__PURE__ */ new Map([
|
|
|
1681
1681
|
["client.keyDwellCount", counter],
|
|
1682
1682
|
["client.keyDwellUnder5", counter],
|
|
1683
1683
|
["client.keyDwellSumMs", counter],
|
|
1684
|
+
["client.keyDwellCongested", counter],
|
|
1685
|
+
["client.keyDwellStampFlat", counter],
|
|
1684
1686
|
["client.keyGapCount", counter],
|
|
1685
1687
|
["client.keyGapUnder5", counter],
|
|
1686
1688
|
["client.pressCount", counter],
|
|
@@ -1688,6 +1690,8 @@ const CLIENT_ATTRIBUTE_CLASSIFICATION = /* @__PURE__ */ new Map([
|
|
|
1688
1690
|
["client.pressAdjacentUnder5", counter],
|
|
1689
1691
|
["client.pressUnder10", counter],
|
|
1690
1692
|
["client.pressSumMs", counter],
|
|
1693
|
+
["client.pressCongested", counter],
|
|
1694
|
+
["client.pressStampFlat", counter],
|
|
1691
1695
|
["client.mouseClicks", counter],
|
|
1692
1696
|
["client.zeroTrailClicks", counter],
|
|
1693
1697
|
["client.pointerMoves", counter],
|
package/dist/signals/index.mjs
CHANGED
|
@@ -1680,6 +1680,8 @@ const CLIENT_ATTRIBUTE_CLASSIFICATION = /* @__PURE__ */ new Map([
|
|
|
1680
1680
|
["client.keyDwellCount", counter],
|
|
1681
1681
|
["client.keyDwellUnder5", counter],
|
|
1682
1682
|
["client.keyDwellSumMs", counter],
|
|
1683
|
+
["client.keyDwellCongested", counter],
|
|
1684
|
+
["client.keyDwellStampFlat", counter],
|
|
1683
1685
|
["client.keyGapCount", counter],
|
|
1684
1686
|
["client.keyGapUnder5", counter],
|
|
1685
1687
|
["client.pressCount", counter],
|
|
@@ -1687,6 +1689,8 @@ const CLIENT_ATTRIBUTE_CLASSIFICATION = /* @__PURE__ */ new Map([
|
|
|
1687
1689
|
["client.pressAdjacentUnder5", counter],
|
|
1688
1690
|
["client.pressUnder10", counter],
|
|
1689
1691
|
["client.pressSumMs", counter],
|
|
1692
|
+
["client.pressCongested", counter],
|
|
1693
|
+
["client.pressStampFlat", counter],
|
|
1690
1694
|
["client.mouseClicks", counter],
|
|
1691
1695
|
["client.zeroTrailClicks", counter],
|
|
1692
1696
|
["client.pointerMoves", counter],
|