@openvtc/trust-tasks 0.3.0 → 0.4.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/dist/_framework/0.3/framework.d.ts +13 -0
- package/dist/_framework/0.3/framework.d.ts.map +1 -0
- package/dist/_framework/0.3/framework.js +6 -0
- package/dist/_framework/0.3/framework.js.map +1 -0
- package/dist/audit/list/0.1/payload.d.ts +11 -9
- package/dist/audit/list/0.1/payload.d.ts.map +1 -1
- package/dist/audit/list/0.1/payload.js.map +1 -1
- package/dist/audit/verify/0.1/payload.d.ts +6 -5
- package/dist/audit/verify/0.1/payload.d.ts.map +1 -1
- package/dist/audit/verify/0.1/payload.js.map +1 -1
- package/dist/chat/message/0.1/payload.d.ts +11 -9
- package/dist/chat/message/0.1/payload.d.ts.map +1 -1
- package/dist/chat/message/0.1/payload.js.map +1 -1
- package/dist/consent/request/1.0/payload.d.ts +6 -5
- package/dist/consent/request/1.0/payload.d.ts.map +1 -1
- package/dist/consent/request/1.0/payload.js.map +1 -1
- package/dist/credentials/_shared/0.2/credentials.d.ts +15 -0
- package/dist/credentials/_shared/0.2/credentials.d.ts.map +1 -0
- package/dist/credentials/_shared/0.2/credentials.js +6 -0
- package/dist/credentials/_shared/0.2/credentials.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/policy/evaluate/0.3/payload.d.ts +6 -5
- package/dist/policy/evaluate/0.3/payload.d.ts.map +1 -1
- package/dist/policy/evaluate/0.3/payload.js.map +1 -1
- package/dist/task-consent/decision/0.1/payload.d.ts +11 -9
- package/dist/task-consent/decision/0.1/payload.d.ts.map +1 -1
- package/dist/task-consent/decision/0.1/payload.js.map +1 -1
- package/dist/task-consent/granted/0.1/payload.d.ts +6 -5
- package/dist/task-consent/granted/0.1/payload.d.ts.map +1 -1
- package/dist/task-consent/granted/0.1/payload.js.map +1 -1
- package/dist/task-consent/request/0.1/payload.d.ts +6 -5
- package/dist/task-consent/request/0.1/payload.d.ts.map +1 -1
- package/dist/task-consent/request/0.1/payload.js.map +1 -1
- package/dist/vta/credentials/issue/0.1/payload.d.ts +2 -0
- package/dist/vta/credentials/issue/0.1/payload.d.ts.map +1 -1
- package/dist/vta/credentials/issue/0.1/payload.js.map +1 -1
- package/dist/vta/credentials/issue/0.2/payload.d.ts +94 -0
- package/dist/vta/credentials/issue/0.2/payload.d.ts.map +1 -0
- package/dist/vta/credentials/issue/0.2/payload.js +31 -0
- package/dist/vta/credentials/issue/0.2/payload.js.map +1 -0
- package/dist/vtc/relationships/request/0.1/payload.d.ts +65 -0
- package/dist/vtc/relationships/request/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/relationships/request/0.1/payload.js +31 -0
- package/dist/vtc/relationships/request/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_framework/0.3/framework.ts +13 -0
- package/src/audit/list/0.1/payload.ts +12 -9
- package/src/audit/verify/0.1/payload.ts +7 -5
- package/src/chat/message/0.1/payload.ts +12 -9
- package/src/consent/request/1.0/payload.ts +7 -5
- package/src/credentials/_shared/0.2/credentials.ts +15 -0
- package/src/index.ts +4 -0
- package/src/policy/evaluate/0.3/payload.ts +6 -5
- package/src/task-consent/decision/0.1/payload.ts +11 -9
- package/src/task-consent/granted/0.1/payload.ts +7 -5
- package/src/task-consent/request/0.1/payload.ts +7 -5
- package/src/vta/credentials/issue/0.1/payload.ts +2 -0
- package/src/vta/credentials/issue/0.2/payload.ts +101 -0
- package/src/vtc/relationships/request/0.1/payload.ts +71 -0
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
* Source: specs/policy/evaluate/0.3/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Multibase-encoded multihash over the RFC 8785 (JCS) canonicalization of the payload, salted with the request challenge, present when a delegated-execution consent flow must bind approval to this exact payload. Absent when no consent binding is in play.
|
|
8
|
+
*/
|
|
9
|
+
export type DigestMultibase = string;
|
|
6
10
|
/**
|
|
7
11
|
* A single binding target for a vault entry. Tagged union over the discriminator `kind`. A VaultEntry's `targets` array MAY mix any number of these.
|
|
8
12
|
*/
|
|
@@ -42,10 +46,7 @@ export interface PolicyInput {
|
|
|
42
46
|
* The identifier the task acts on — the value at the spec's `subjectPath` (usually a DID). The evaluator checks the consumer's authority to act on this subject. Absent for subjectless tasks (discovery, list).
|
|
43
47
|
*/
|
|
44
48
|
subject?: string;
|
|
45
|
-
|
|
46
|
-
* Multihash of the canonicalized payload, salted with the request challenge, present when a delegated-execution consent flow must bind approval to this exact payload. Absent when no consent binding is in play.
|
|
47
|
-
*/
|
|
48
|
-
payloadDigest?: string;
|
|
49
|
+
payloadDigest?: DigestMultibase;
|
|
49
50
|
/**
|
|
50
51
|
* Authoritative integrity class (SPEC §7.3 item 13). The evaluator MUST derive this from the compiled handler it is about to invoke, not from the wire — the registry's declared value is advisory only.
|
|
51
52
|
*/
|
|
@@ -176,7 +177,7 @@ export interface PolicyDecision {
|
|
|
176
177
|
export const TYPE_URI = "https://trusttasks.org/spec/policy/evaluate/0.3" as const;
|
|
177
178
|
|
|
178
179
|
/** Stable alias for this specification's request payload shape. */
|
|
179
|
-
export type Payload =
|
|
180
|
+
export type Payload = DigestMultibase;
|
|
180
181
|
|
|
181
182
|
/** Trust Task response type URI (request type URI + "#response"). */
|
|
182
183
|
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/policy/evaluate/0.3#response" as const;
|
|
@@ -3,10 +3,18 @@
|
|
|
3
3
|
* Source: specs/task-consent/decision/0.1/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Echoes the digest of the task being authorized, in the encoding `task-consent/request` carried it. The executor re-derives it from the payload it is about to execute and refuses on mismatch — this is what makes the approved payload the executed payload, cryptographically rather than by convention.
|
|
8
|
+
*/
|
|
9
|
+
export type DigestMultibase = string;
|
|
6
10
|
/**
|
|
7
11
|
* The approver's answer. `deny` aborts the pending request; a subsequent submit of the same task starts a fresh one.
|
|
8
12
|
*/
|
|
9
13
|
export type Decision = "approve" | "deny";
|
|
14
|
+
/**
|
|
15
|
+
* The digest this decision concerned, in the encoding `task-consent/request` carried it.
|
|
16
|
+
*/
|
|
17
|
+
export type DigestMultibase1 = string;
|
|
10
18
|
|
|
11
19
|
/**
|
|
12
20
|
* An enrolled approver authorizes (or refuses) one pending privileged task, bound to the exact payload it was shown. The proof on this document — not the transport session that carried it — is the authorization.
|
|
@@ -16,10 +24,7 @@ export interface TaskConsentDecisionPayload {
|
|
|
16
24
|
* Echoes the task-consent/request this decision answers, binding it to that one pending request. An executor MUST consume the challenge at execution rather than on receipt of this decision: a decision authorizes exactly one execution, and consuming it earlier lets an executor's own retry legitimately replay it.
|
|
17
25
|
*/
|
|
18
26
|
challenge: string;
|
|
19
|
-
|
|
20
|
-
* Echoes the digest of the task being authorized. The executor re-derives it from the payload it is about to execute and refuses on mismatch — this is what makes the approved payload the executed payload, cryptographically rather than by convention.
|
|
21
|
-
*/
|
|
22
|
-
payloadDigest: string;
|
|
27
|
+
payloadDigest: DigestMultibase;
|
|
23
28
|
decision: Decision;
|
|
24
29
|
/**
|
|
25
30
|
* OPTIONAL human-facing note, most useful on a `deny`.
|
|
@@ -41,10 +46,7 @@ export interface TaskConsentDecisionResponsePayload {
|
|
|
41
46
|
* `granted` = the threshold is met and the requester's re-submit will now execute. `pending` = the approval was recorded but more are needed. `denied` = the request was aborted.
|
|
42
47
|
*/
|
|
43
48
|
status: "granted" | "pending" | "denied";
|
|
44
|
-
|
|
45
|
-
* The digest this decision concerned.
|
|
46
|
-
*/
|
|
47
|
-
payloadDigest: string;
|
|
49
|
+
payloadDigest: DigestMultibase1;
|
|
48
50
|
/**
|
|
49
51
|
* Distinct approvals recorded so far.
|
|
50
52
|
*/
|
|
@@ -60,7 +62,7 @@ export interface TaskConsentDecisionResponsePayload {
|
|
|
60
62
|
export const TYPE_URI = "https://trusttasks.org/spec/task-consent/decision/0.1" as const;
|
|
61
63
|
|
|
62
64
|
/** Stable alias for this specification's request payload shape. */
|
|
63
|
-
export type Payload =
|
|
65
|
+
export type Payload = DigestMultibase;
|
|
64
66
|
|
|
65
67
|
/** Trust Task response type URI (request type URI + "#response"). */
|
|
66
68
|
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/task-consent/decision/0.1#response" as const;
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
* Source: specs/task-consent/granted/0.1/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* The salted wire digest of the approved task — the same value the matching task-consent/request carried and the decision echoed. The requester already holds it; it is repeated here only so the requester can correlate the notice to the pending task it should now re-submit. It confers nothing: the executor's single-use grant lookup at re-submit is the authorization.
|
|
8
|
+
*/
|
|
9
|
+
export type DigestMultibase = string;
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* Fire-and-forget notice from the executor to the requester that its pending task has reached the approval threshold and a single-use grant is waiting, so the requester re-submits at once instead of polling. Non-load-bearing by design: the grant check at re-submit is the real gate, so a lost or spurious notice costs at most one poll cycle.
|
|
8
13
|
*/
|
|
@@ -11,10 +16,7 @@ export interface TaskConsentGrantedPayload {
|
|
|
11
16
|
* Always `granted`. A denial sends no notice — the requester's re-submit discovers it, and a notice that could carry a denial would tempt a consumer into treating this advisory channel as the authoritative outcome, which it is not.
|
|
12
17
|
*/
|
|
13
18
|
status: "granted";
|
|
14
|
-
|
|
15
|
-
* The salted wire digest of the approved task — the same value the matching task-consent/request carried and the decision echoed. The requester already holds it; it is repeated here only so the requester can correlate the notice to the pending task it should now re-submit. It confers nothing: the executor's single-use grant lookup at re-submit is the authorization.
|
|
16
|
-
*/
|
|
17
|
-
payloadDigest: string;
|
|
19
|
+
payloadDigest: DigestMultibase;
|
|
18
20
|
/**
|
|
19
21
|
* Type URI of the approved task, for correlation and display at the requester. Advisory on the same terms as the digest — the executor re-derives everything it enforces from the re-submitted payload itself.
|
|
20
22
|
*/
|
|
@@ -32,7 +34,7 @@ export interface Ext {
|
|
|
32
34
|
export const TYPE_URI = "https://trusttasks.org/spec/task-consent/granted/0.1" as const;
|
|
33
35
|
|
|
34
36
|
/** Stable alias for this specification's request payload shape. */
|
|
35
|
-
export type Payload =
|
|
37
|
+
export type Payload = DigestMultibase;
|
|
36
38
|
|
|
37
39
|
/**
|
|
38
40
|
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
* Source: specs/task-consent/request/0.1/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* The binding between what the approver sees and what executes. Multibase-encoded multihash over the RFC 8785 (JCS) canonicalization of the payload, the task type, and the `challenge` as salt. The decision echoes it; the executor re-derives it from the payload it is about to run and refuses on mismatch. Salted because an unsalted digest over a low-entropy payload is a confirmation oracle for anyone who observes it in transit.
|
|
8
|
+
*/
|
|
9
|
+
export type DigestMultibase = string;
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* The executor asks an enrolled approver device to authorize one pending privileged task, presenting the effects it computed by dry-running the real handler against its own prior state. The executor signs this document; the approver renders only what it verifies under that signature.
|
|
8
13
|
*/
|
|
@@ -15,10 +20,7 @@ export interface TaskConsentRequestPayload {
|
|
|
15
20
|
* Type URI of the task awaiting approval. It is bound into `payloadDigest`: without that binding, two tasks whose payloads canonicalize identically would share a digest, and an approval for a benign task would authorize a destructive one.
|
|
16
21
|
*/
|
|
17
22
|
taskType: string;
|
|
18
|
-
|
|
19
|
-
* The binding between what the approver sees and what executes. Digest of the canonical (RFC 8785 JCS) payload, the task type, and the `challenge` as salt. The decision echoes it; the executor re-derives it from the payload it is about to run and refuses on mismatch. Salted because an unsalted digest over a low-entropy payload is a confirmation oracle for anyone who observes it in transit.
|
|
20
|
-
*/
|
|
21
|
-
payloadDigest: string;
|
|
23
|
+
payloadDigest: DigestMultibase;
|
|
22
24
|
/**
|
|
23
25
|
* Authoritative SPEC §7.3 item 13 side-effect class of the pending task, derived by the executor from the compiled handler it is about to invoke. NEVER taken from the registry: a registry that decided this would be a consent kill-switch, downgradeable by publishing a new version with a weaker class.
|
|
24
26
|
*/
|
|
@@ -157,7 +159,7 @@ export interface TaskConsentRequestResponsePayload {
|
|
|
157
159
|
export const TYPE_URI = "https://trusttasks.org/spec/task-consent/request/0.1" as const;
|
|
158
160
|
|
|
159
161
|
/** Stable alias for this specification's request payload shape. */
|
|
160
|
-
export type Payload =
|
|
162
|
+
export type Payload = DigestMultibase;
|
|
161
163
|
|
|
162
164
|
/** Trust Task response type URI (request type URI + "#response"). */
|
|
163
165
|
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/task-consent/request/0.1#response" as const;
|
|
@@ -39,6 +39,8 @@ export interface Ext {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* The success response to a vta/credentials/issue request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vta/credentials/issue/0.1#response.
|
|
42
|
+
*
|
|
43
|
+
* This is the credentials/_shared IssuedCredential shape — same members, same required set — plus `supersedes` and `ext`. It states them inline rather than `$ref`-ing the shared definition because that definition sets `additionalProperties: false`, which under `allOf` would reject the two extra members. The shared CredentialId is still referenced. Keep the two in step by hand if either changes.
|
|
42
44
|
*/
|
|
43
45
|
export interface VTACredentialsIssueResponsePayload {
|
|
44
46
|
credentialId: CredentialId;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/credentials/issue/0.2/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The success response to a vta/credentials/issue request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vta/credentials/issue/0.1#response.
|
|
8
|
+
*
|
|
9
|
+
* Composed from the shared IssuedCredential rather than restating it: that definition is the issuance receipt every issuer returns, and duplicating it here let the two drift silently. `unevaluatedProperties` closes the object after the `allOf` is applied, which is what makes the composition possible at all — `additionalProperties` is evaluated per-subschema against the whole object and would reject `supersedes` and `ext`.
|
|
10
|
+
*/
|
|
11
|
+
export type VTACredentialsIssueResponsePayload = IssuedCredentialBase;
|
|
12
|
+
/**
|
|
13
|
+
* Stable identifier for an issued credential — the handle for revocation and audit. Opaque to the holder: it MUST be echoed verbatim when revoking and MUST NOT be parsed.
|
|
14
|
+
*/
|
|
15
|
+
export type CredentialId = string;
|
|
16
|
+
|
|
17
|
+
export interface VTACredentialsIssuePayload {
|
|
18
|
+
/**
|
|
19
|
+
* DID of the credential's subject/holder (becomes credentialSubject.id).
|
|
20
|
+
*/
|
|
21
|
+
holder: string;
|
|
22
|
+
/**
|
|
23
|
+
* The scoped claims to attest — the share's scope. Opaque to the framework; non-empty.
|
|
24
|
+
*/
|
|
25
|
+
claims: {};
|
|
26
|
+
/**
|
|
27
|
+
* Additional credential type beyond VerifiableCredential (e.g. ScopedShareCredential). Some values name a claims profile defined by this specification (e.g. GovernancePolicyCredential), which constrains the shape of `claims`.
|
|
28
|
+
*/
|
|
29
|
+
credentialType?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Credential lifetime in seconds from issuance. The issuer MAY cap this.
|
|
32
|
+
*/
|
|
33
|
+
validitySeconds: number;
|
|
34
|
+
/**
|
|
35
|
+
* Optional human-readable rationale, recorded for audit.
|
|
36
|
+
*/
|
|
37
|
+
purpose?: string;
|
|
38
|
+
ext?: Ext;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
42
|
+
*/
|
|
43
|
+
export interface Ext {
|
|
44
|
+
[k: string]: unknown | undefined;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The members of an issuance receipt, deliberately left **open** so a consuming specification can `$ref` it under `allOf` and add its own, then close the result with `unevaluatedProperties: false`.
|
|
48
|
+
*
|
|
49
|
+
* A closure inside this definition would defeat that. Both `additionalProperties` and `unevaluatedProperties` are evaluated against the whole instance from within the subschema that declares them, and neither can see members the *outer* schema matched — so either one here rejects the consumer's extras. Only an `unevaluatedProperties` at the outer level sees everything the composition matched. Use `IssuedCredential` where a closed standalone shape is wanted.
|
|
50
|
+
*/
|
|
51
|
+
export interface IssuedCredentialBase {
|
|
52
|
+
credentialId: CredentialId;
|
|
53
|
+
/**
|
|
54
|
+
* The issued Verifiable Credential (W3C VC Data Model 2.0), signed by the issuer's key. Opaque to the framework.
|
|
55
|
+
*/
|
|
56
|
+
credential: {};
|
|
57
|
+
/**
|
|
58
|
+
* When the credential was minted.
|
|
59
|
+
*/
|
|
60
|
+
issuedAt?: string;
|
|
61
|
+
/**
|
|
62
|
+
* When the credential's validUntil falls due.
|
|
63
|
+
*/
|
|
64
|
+
expiresAt: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Trust Task type URI. */
|
|
68
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vta/credentials/issue/0.2" as const;
|
|
69
|
+
|
|
70
|
+
/** Stable alias for this specification's request payload shape. */
|
|
71
|
+
export type Payload = VTACredentialsIssueResponsePayload;
|
|
72
|
+
|
|
73
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
74
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/credentials/issue/0.2#response" as const;
|
|
75
|
+
|
|
76
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
77
|
+
export type Response = VTACredentialsIssueResponsePayload;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
81
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
82
|
+
* per-specification and cannot be derived from the document alone.
|
|
83
|
+
*/
|
|
84
|
+
export const SPEC = {
|
|
85
|
+
typeUri: TYPE_URI,
|
|
86
|
+
isBearer: false,
|
|
87
|
+
isProofRequired: true,
|
|
88
|
+
isRecipientRequired: true,
|
|
89
|
+
} as const;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
93
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
94
|
+
* parties (§7.3 item 5).
|
|
95
|
+
*/
|
|
96
|
+
export const RESPONSE_SPEC = {
|
|
97
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
98
|
+
isBearer: false,
|
|
99
|
+
isProofRequired: true,
|
|
100
|
+
isRecipientRequired: true,
|
|
101
|
+
} as const;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/relationships/request/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A member asks another member to issue them a Verifiable Relationship Credential. Everything here is a hint: the issuing member decides, and declines with a trust-task-error carrying `vtc/relationships/request:declined` rather than a bespoke rejection message.
|
|
8
|
+
*/
|
|
9
|
+
export interface VTCRelationshipsRequestPayload {
|
|
10
|
+
/**
|
|
11
|
+
* Why the requester is asking, in their own words, for the issuing member to weigh. A hint and not a term — the issuing member is under no obligation to honour it, and MUST NOT treat its absence as a defect. Free text reaching a human, so a producer SHOULD keep it to what it is willing to have quoted back.
|
|
12
|
+
*/
|
|
13
|
+
reason?: string;
|
|
14
|
+
ext?: Ext;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.
|
|
18
|
+
*/
|
|
19
|
+
export interface Ext {
|
|
20
|
+
[k: string]: unknown | undefined;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The issued credential. Returned only where the issuing member agreed; a decline is a trust-task-error, not a response with an empty field.
|
|
24
|
+
*/
|
|
25
|
+
export interface VTCRelationshipsRequestResponsePayload {
|
|
26
|
+
/**
|
|
27
|
+
* A signed W3C Verifiable Relationship Credential (opaque here). Its issuer MUST be the issuing member — the party that signed this response — and its credentialSubject.id MUST name the requester. The same shape `vtc/relationships/publish` accepts, so a requester can lodge it with the community unchanged.
|
|
28
|
+
*/
|
|
29
|
+
vrc: {};
|
|
30
|
+
/**
|
|
31
|
+
* SHA-256 of the returned VRC, for out-of-band integrity checks. Matches the digest `vtc/relationships/publish` reports once the credential is lodged, so the two can be tied together without re-hashing.
|
|
32
|
+
*/
|
|
33
|
+
vrcSha256?: string;
|
|
34
|
+
ext?: Ext;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Trust Task type URI. */
|
|
38
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/relationships/request/0.1" as const;
|
|
39
|
+
|
|
40
|
+
/** Stable alias for this specification's request payload shape. */
|
|
41
|
+
export type Payload = VTCRelationshipsRequestPayload;
|
|
42
|
+
|
|
43
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
44
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/relationships/request/0.1#response" as const;
|
|
45
|
+
|
|
46
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
47
|
+
export type Response = VTCRelationshipsRequestResponsePayload;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
51
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
52
|
+
* per-specification and cannot be derived from the document alone.
|
|
53
|
+
*/
|
|
54
|
+
export const SPEC = {
|
|
55
|
+
typeUri: TYPE_URI,
|
|
56
|
+
isBearer: false,
|
|
57
|
+
isProofRequired: true,
|
|
58
|
+
isRecipientRequired: true,
|
|
59
|
+
} as const;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
63
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
64
|
+
* parties (§7.3 item 5).
|
|
65
|
+
*/
|
|
66
|
+
export const RESPONSE_SPEC = {
|
|
67
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
68
|
+
isBearer: false,
|
|
69
|
+
isProofRequired: true,
|
|
70
|
+
isRecipientRequired: true,
|
|
71
|
+
} as const;
|