@kya-os/checkpoint-shared 1.3.0 → 1.3.1
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 +19 -0
- package/dist/beacon-types/index.d.mts +3 -1
- package/dist/beacon-types/index.d.ts +3 -1
- package/dist/beacon-types/index.js +15 -2
- package/dist/beacon-types/index.mjs +15 -2
- package/dist/browser-posture-report.d.mts +85 -0
- package/dist/browser-posture-report.d.ts +85 -0
- package/dist/browser-posture-report.js +1 -0
- package/dist/browser-posture-report.mjs +1 -0
- package/dist/browser-posture.d.mts +114 -0
- package/dist/browser-posture.d.ts +114 -0
- package/dist/browser-posture.js +4204 -0
- package/dist/browser-posture.mjs +4187 -0
- package/dist/browser.d.mts +30 -1
- package/dist/browser.d.ts +30 -1
- package/dist/browser.js +1 -1
- package/dist/browser.mjs +1 -1
- package/dist/errors/index.d.mts +104 -0
- package/dist/errors/index.d.ts +104 -0
- package/dist/errors/index.js +338 -0
- package/dist/errors/index.mjs +333 -0
- package/dist/gateway/index.d.mts +6 -1
- package/dist/gateway/index.d.ts +6 -1
- package/dist/gateway/index.js +4 -0
- package/dist/gateway/index.mjs +4 -1
- package/dist/index.d.mts +769 -146
- package/dist/index.d.ts +769 -146
- package/dist/index.js +926 -282
- package/dist/index.mjs +903 -283
- package/dist/signals/index.d.mts +1 -1
- package/dist/signals/index.d.ts +1 -1
- package/dist/signals/index.js +95 -2
- package/dist/signals/index.mjs +95 -2
- package/fixtures/client-ip-resolution.json +103 -0
- package/fixtures/detection/reason-codes.json +35 -0
- package/fixtures/detection/signal-exposure-example.json +62 -0
- package/fixtures/kya-http/README.md +112 -0
- package/fixtures/kya-http/challenge-proof.canonical.json +25 -0
- package/fixtures/kya-http/challenge.approval-quorum.json +37 -0
- package/fixtures/kya-http/challenge.delegation.fetcher-200.json +55 -0
- package/fixtures/kya-http/challenge.delegation.full.json +81 -0
- package/fixtures/kya-http/challenge.delegation.minimal.json +57 -0
- package/fixtures/kya-http/error-codes.json +35 -0
- package/fixtures/kya-http/fetcher-200-predicate.vectors.json +72 -0
- package/fixtures/kya-http/negative.challenges.json +54 -0
- package/fixtures/kya-http/pickup.transcript.json +96 -0
- package/fixtures/kya-http/pickup.transcript.quorum.json +156 -0
- package/fixtures/kya-http/protected-resource-metadata.full.json +30 -0
- package/fixtures/kya-http/protected-resource-metadata.global.json +28 -0
- package/fixtures/kya-http/registration.request.json +33 -0
- package/fixtures/kya-http/registration.response.json +32 -0
- package/package.json +20 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$fixture": "kya-http/protected-resource-metadata.full",
|
|
3
|
+
"$spec": "RFC 9728 OAuth Protected Resource Metadata (advertised by draft-kya-http-02 §8.1)",
|
|
4
|
+
"description": "Per-org PRM document served at /.well-known/oauth-protected-resource — the URL the §8.1 Bearer challenge advertises. With a resource_org_did carrying an :orgs: slug, authorization_servers advertises the PER-ORG gateway issuer; with scopes present, scopes_supported is emitted. Every PEP that serves this URL (.NET net462 + net8, gateway-worker) must produce this document for the same input.",
|
|
5
|
+
"input": {
|
|
6
|
+
"resource_host": "api.merchant.com",
|
|
7
|
+
"resource_org_did": "did:web:kya.vouched.id:orgs:acme",
|
|
8
|
+
"base_url": "https://kya.vouched.id",
|
|
9
|
+
"scopes": ["commerce.checkout"]
|
|
10
|
+
},
|
|
11
|
+
"expected": {
|
|
12
|
+
"document": {
|
|
13
|
+
"resource": "https://api.merchant.com",
|
|
14
|
+
"authorization_servers": ["https://kya.vouched.id/oauth/gateway/acme"],
|
|
15
|
+
"bearer_methods_supported": ["header"],
|
|
16
|
+
"scopes_supported": ["commerce.checkout"],
|
|
17
|
+
"resource_documentation": "https://kya.vouched.id/docs/enforce/kya-os-enforcement"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"conformance": {
|
|
21
|
+
"key_order": [
|
|
22
|
+
"resource",
|
|
23
|
+
"authorization_servers",
|
|
24
|
+
"bearer_methods_supported",
|
|
25
|
+
"scopes_supported",
|
|
26
|
+
"resource_documentation"
|
|
27
|
+
],
|
|
28
|
+
"notes": "resource byte-matches the §8.1 Bearer resource_metadata URL host; authorization_servers is ALWAYS a single-element array; the .NET v1 document does NOT emit the kyaos_needs_authorization extension the gateway-worker adds."
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$fixture": "kya-http/protected-resource-metadata.global",
|
|
3
|
+
"$spec": "RFC 9728 OAuth Protected Resource Metadata (advertised by draft-kya-http-02 §8.1)",
|
|
4
|
+
"description": "Global PRM document: no resource_org_did and no scopes. authorization_servers advertises the GLOBAL gateway issuer (the BaseUrl origin), and scopes_supported is OMITTED entirely (NOT defaulted to a scope). The minimal counterpart of protected-resource-metadata.full.json.",
|
|
5
|
+
"input": {
|
|
6
|
+
"resource_host": "api.merchant.com",
|
|
7
|
+
"resource_org_did": null,
|
|
8
|
+
"base_url": "https://kya.vouched.id",
|
|
9
|
+
"scopes": []
|
|
10
|
+
},
|
|
11
|
+
"expected": {
|
|
12
|
+
"document": {
|
|
13
|
+
"resource": "https://api.merchant.com",
|
|
14
|
+
"authorization_servers": ["https://kya.vouched.id"],
|
|
15
|
+
"bearer_methods_supported": ["header"],
|
|
16
|
+
"resource_documentation": "https://kya.vouched.id/docs/enforce/kya-os-enforcement"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"conformance": {
|
|
20
|
+
"key_order": [
|
|
21
|
+
"resource",
|
|
22
|
+
"authorization_servers",
|
|
23
|
+
"bearer_methods_supported",
|
|
24
|
+
"resource_documentation"
|
|
25
|
+
],
|
|
26
|
+
"notes": "scopes_supported is OMITTED (no scopes input); authorization_servers is the global issuer (BaseUrl origin) when no org slug is present — still a single-element array."
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$fixture": "kya-http/registration.request",
|
|
3
|
+
"$spec": "H2.4 #3255 \u2014 challenge-anchor registration (POST /api/v1/bouncer/sessions)",
|
|
4
|
+
"description": "Canonical registration REQUEST body, frozen so the TS edge worker (registration-client.ts) and the .NET DelegationAnchorRegistrar.BuildRequestBody cannot drift on field names / required set. Values like client_info.name and agent_did legitimately differ per client (gateway-worker vs the .NET SDK, anonymous-principal vs a verified DID) \u2014 only the SHAPE (top-level keys + nested challenge keys) is normative; the parity tests assert key sets, not values.",
|
|
5
|
+
"body": {
|
|
6
|
+
"session_id": "kya-9f4e7c2a8b1d4e6f0a1b2c3d4e5f6071",
|
|
7
|
+
"agent_did": "did:web:anonymous.example",
|
|
8
|
+
"project_id": "proj_canonical_fixture",
|
|
9
|
+
"created_at": 1700000000000,
|
|
10
|
+
"client_info": {
|
|
11
|
+
"name": "checkpoint-gateway",
|
|
12
|
+
"version": "1.0.0"
|
|
13
|
+
},
|
|
14
|
+
"challenge": {
|
|
15
|
+
"required_scopes": ["commerce.checkout"],
|
|
16
|
+
"pep_surface": "gateway-worker",
|
|
17
|
+
"verdict": "challenge"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"conformance": {
|
|
21
|
+
"required_top_level_keys": [
|
|
22
|
+
"session_id",
|
|
23
|
+
"agent_did",
|
|
24
|
+
"project_id",
|
|
25
|
+
"created_at",
|
|
26
|
+
"client_info",
|
|
27
|
+
"challenge"
|
|
28
|
+
],
|
|
29
|
+
"required_client_info_keys": ["name"],
|
|
30
|
+
"required_challenge_keys": ["required_scopes"],
|
|
31
|
+
"notes": "issued_at is NOT a request field (it is response-only). The challenge block also OPTIONALLY carries pep_surface, verdict, detected_agent_did, challenge_pin, audience (X4 cross-resource claims: the resource org's DID that becomes the deployment-minted VC's aud; server-derived on checkpoint's redirect relay), and the #4201 display-only detected-identity keys detected_agent_name, detected_agent_class, detected_confidence (0-100) \u2014 rendered on the consent screen's agent card, never entering the challenge_proof."
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$fixture": "kya-http/registration.response",
|
|
3
|
+
"$spec": "H2.4 #3255 — challenge-anchor registration success envelope",
|
|
4
|
+
"description": "Canonical registration RESPONSE, frozen so both client runtimes parse it without drift. The TS edge worker (registration-client.ts) reads data.challenge.{consent_uri, challenge_proof, issued_at} and NEVER data.session_id; the .NET DelegationAnchorRegistrar.ParseResponse reads data.session_id (echoed into Sid) + data.challenge.{consent_uri, challenge_proof} and NEVER issued_at. consent_uri + challenge_proof are read by BOTH — renaming either must fail BOTH parity tests (the drift-guard verify-by-revert).",
|
|
5
|
+
"body": {
|
|
6
|
+
"success": true,
|
|
7
|
+
"data": {
|
|
8
|
+
"session_id": "kya-9f4e7c2a8b1d4e6f0a1b2c3d4e5f6071",
|
|
9
|
+
"registered": true,
|
|
10
|
+
"created_at": "2023-11-14T22:13:20.000Z",
|
|
11
|
+
"challenge": {
|
|
12
|
+
"consent_uri": "https://auth.merchant.com/consent?sid=kya-9f4e7c2a8b1d4e6f0a1b2c3d4e5f6071",
|
|
13
|
+
"challenge_proof": { "sig": "test-challenge-proof" },
|
|
14
|
+
"required_scopes": ["commerce.checkout"],
|
|
15
|
+
"issued_at": 1700000000000
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"conformance": {
|
|
20
|
+
"ts_worker_reads": [
|
|
21
|
+
"data.challenge.consent_uri",
|
|
22
|
+
"data.challenge.challenge_proof",
|
|
23
|
+
"data.challenge.issued_at"
|
|
24
|
+
],
|
|
25
|
+
"dotnet_reads": [
|
|
26
|
+
"data.session_id",
|
|
27
|
+
"data.challenge.consent_uri",
|
|
28
|
+
"data.challenge.challenge_proof"
|
|
29
|
+
],
|
|
30
|
+
"read_by_both": ["data.challenge.consent_uri", "data.challenge.challenge_proof"]
|
|
31
|
+
}
|
|
32
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kya-os/checkpoint-shared",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Checkpoint shared types and schemas (formerly @kya-os/agentshield-shared)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -95,12 +95,28 @@
|
|
|
95
95
|
"import": "./dist/signals/index.mjs",
|
|
96
96
|
"require": "./dist/signals/index.js"
|
|
97
97
|
},
|
|
98
|
-
"./
|
|
98
|
+
"./errors": {
|
|
99
|
+
"types": "./dist/errors/index.d.ts",
|
|
100
|
+
"import": "./dist/errors/index.mjs",
|
|
101
|
+
"require": "./dist/errors/index.js"
|
|
102
|
+
},
|
|
103
|
+
"./package.json": "./package.json",
|
|
104
|
+
"./browser-posture-report": {
|
|
105
|
+
"types": "./dist/browser-posture-report.d.ts",
|
|
106
|
+
"import": "./dist/browser-posture-report.mjs",
|
|
107
|
+
"require": "./dist/browser-posture-report.js"
|
|
108
|
+
},
|
|
109
|
+
"./browser-posture": {
|
|
110
|
+
"types": "./dist/browser-posture.d.ts",
|
|
111
|
+
"import": "./dist/browser-posture.mjs",
|
|
112
|
+
"require": "./dist/browser-posture.js"
|
|
113
|
+
}
|
|
99
114
|
},
|
|
100
115
|
"files": [
|
|
101
116
|
"dist",
|
|
102
117
|
"src/data/compiled",
|
|
103
118
|
"src/data/default-rules.json",
|
|
119
|
+
"fixtures",
|
|
104
120
|
"README.md",
|
|
105
121
|
"CHANGELOG.md"
|
|
106
122
|
],
|
|
@@ -139,6 +155,8 @@
|
|
|
139
155
|
"signals:snapshot:write": "tsx scripts/signal-registry-snapshot.ts --write",
|
|
140
156
|
"signals:docs": "tsx scripts/generate-signal-docs.ts",
|
|
141
157
|
"errors:docs": "tsx scripts/generate-error-docs.ts",
|
|
158
|
+
"reason-codes:docs": "tsx scripts/generate-reason-code-docs.ts",
|
|
159
|
+
"signal-exposure:docs": "tsx scripts/generate-signal-exposure-docs.ts",
|
|
142
160
|
"build": "rimraf dist && pnpm run compile-rules && pnpm run build:patterns && tsup",
|
|
143
161
|
"build:watch": "tsup --watch",
|
|
144
162
|
"dev": "tsup --watch",
|