@pdtf/schemas 3.4.1-8 → 3.5.1-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.
@@ -32,28 +32,6 @@
32
32
  "role": "variant",
33
33
  "externalIds": {},
34
34
  "participantStatus": "string",
35
- "verification": {
36
- "identity": {
37
- "result": "string",
38
- "reports": [
39
- {
40
- "reportName": "string",
41
- "result": "string",
42
- "details": "string"
43
- }
44
- ]
45
- },
46
- "antiMoneyLaundering": {
47
- "result": "string",
48
- "reports": [
49
- {
50
- "reportName": "string",
51
- "result": "string",
52
- "details": "string"
53
- }
54
- ]
55
- }
56
- },
57
35
  "sellersCapacity": {
58
36
  "capacity": "variant",
59
37
  "sellersCapacityDetails": "string",
@@ -1,12 +1,21 @@
1
1
  ## README
2
2
 
3
3
  ### About verified claims
4
- `pdtf-verified-claims.json` describes the schema container in which we store property `claims` and their corresponding `verification`.
4
+ `pdtf-verified-claims.json` describes the schema container in which we store property `claims` and their corresponding `verification`.
5
5
 
6
- This schema structure is strongly influenced by OpenID Connect for Identity Assurance 1.0's way of storing "verified claims".
6
+ This schema structure is strongly influenced by OpenID Connect for Identity Assurance 1.0's way of storing "verified claims".
7
7
 
8
8
  More Details from the OIDC page which describes the details the nature of `verification` and `claims` objects: https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-representing-verified-claim
9
9
 
10
- Notes:
10
+ ### Terms of Use
11
+ The schema supports an optional `terms_of_use` object to control access to verified claims based on confidentiality levels:
12
+
13
+ * **Public**: No access restrictions (`allowed_roles: []`)
14
+ * **Restricted**: Requires some participant role but not specifically defined (`allowed_roles: []`)
15
+ * **Confidential**: Specific roles defined for access control (e.g., `allowed_roles: ["Seller's Conveyancer", "Buyer's Conveyancer"]`)
16
+
17
+ The `allowed_roles` array accepts any of the participant roles defined in [pdtf-transaction.json](../v3/pdtf-transaction.json).
18
+
19
+ Notes:
11
20
  * For PDTF Schema, all data included in the `claims` object must adhere to [pdtf-transaction.json (v3)](../v3/pdtf-transaction.json)
12
21
  * For verification, there is more freedom in terms of the type of data that can currently be provided, see the documentation in the OIDC link above for details and examples.
@@ -374,6 +374,11 @@
374
374
  "description": "The semantic version of the schema used to validate the claims",
375
375
  "type": "string"
376
376
  },
377
+ "timestamp": {
378
+ "type": "integer",
379
+ "minimum": 0,
380
+ "description": "Unix timestamp in milliseconds when the verified claims were created"
381
+ },
377
382
  "verification": {
378
383
  "type": "object",
379
384
  "properties": {
@@ -406,6 +411,22 @@
406
411
  },
407
412
  "minProperties": 1,
408
413
  "additionalProperties": false
414
+ },
415
+ "terms_of_use": {
416
+ "type": "object",
417
+ "properties": {
418
+ "confidentiality_level": {
419
+ "type": "string",
420
+ "enum": ["public", "restricted", "confidential"]
421
+ },
422
+ "allowed_roles": {
423
+ "type": "array",
424
+ "items": {
425
+ "type": "string"
426
+ }
427
+ }
428
+ },
429
+ "additionalProperties": false
409
430
  }
410
431
  },
411
432
  "required": ["verification", "claims"],
@@ -126,3 +126,70 @@ test("returns an empty array of errors for verified claim with multiple valid pa
126
126
  };
127
127
  expect(validateVerifiedClaims([clonedVouch], v3SchemaId, null)).toEqual([]);
128
128
  });
129
+
130
+ test("returns an empty array for valid terms_of_use object with confidential level", () => {
131
+ const clonedVouch = JSON.parse(JSON.stringify(exampleVouch));
132
+ clonedVouch.terms_of_use = {
133
+ confidentiality_level: "confidential",
134
+ allowed_roles: ["Seller's Conveyancer", "Buyer's Conveyancer"]
135
+ };
136
+ expect(validateVerifiedClaims([clonedVouch])).toEqual([]);
137
+ });
138
+
139
+ test("returns an empty array for valid terms_of_use with public confidentiality", () => {
140
+ const clonedVouch = JSON.parse(JSON.stringify(exampleVouch));
141
+ clonedVouch.terms_of_use = {
142
+ confidentiality_level: "public",
143
+ allowed_roles: []
144
+ };
145
+ expect(validateVerifiedClaims([clonedVouch])).toEqual([]);
146
+ });
147
+
148
+ test("returns an empty array for valid terms_of_use with restricted level", () => {
149
+ const clonedVouch = JSON.parse(JSON.stringify(exampleVouch));
150
+ clonedVouch.terms_of_use = {
151
+ confidentiality_level: "restricted",
152
+ allowed_roles: []
153
+ };
154
+ expect(validateVerifiedClaims([clonedVouch])).toEqual([]);
155
+ });
156
+
157
+ test("returns errors for invalid confidentiality_level in terms_of_use", () => {
158
+ const clonedVouch = JSON.parse(JSON.stringify(exampleVouch));
159
+ clonedVouch.terms_of_use = {
160
+ confidentiality_level: "invalid_level",
161
+ allowed_roles: ["Seller's Conveyancer"]
162
+ };
163
+ const errors = validateVerifiedClaims([clonedVouch]);
164
+ expect(errors).toHaveLength(1);
165
+ expect(errors[0]).toHaveLength(1);
166
+ expect(errors[0][0].instancePath).toBe("/verified_claims/0/terms_of_use/confidentiality_level");
167
+ expect(errors[0][0].keyword).toBe("enum");
168
+ });
169
+
170
+ test("returns errors for invalid allowed_roles type in terms_of_use", () => {
171
+ const clonedVouch = JSON.parse(JSON.stringify(exampleVouch));
172
+ clonedVouch.terms_of_use = {
173
+ confidentiality_level: "confidential",
174
+ allowed_roles: "not_an_array"
175
+ };
176
+ const errors = validateVerifiedClaims([clonedVouch]);
177
+ expect(errors).toHaveLength(1);
178
+ expect(errors[0]).toHaveLength(1);
179
+ expect(errors[0][0].instancePath).toBe("/verified_claims/0/terms_of_use/allowed_roles");
180
+ expect(errors[0][0].keyword).toBe("type");
181
+ });
182
+
183
+ test("returns errors for additional properties in terms_of_use", () => {
184
+ const clonedVouch = JSON.parse(JSON.stringify(exampleVouch));
185
+ clonedVouch.terms_of_use = {
186
+ confidentiality_level: "confidential",
187
+ allowed_roles: ["Estate Agent"],
188
+ extra_property: "should_not_be_allowed"
189
+ };
190
+ const errors = validateVerifiedClaims([clonedVouch]);
191
+ expect(errors).toHaveLength(1);
192
+ expect(errors[0]).toHaveLength(1);
193
+ expect(errors[0][0].instancePath).toBe("/verified_claims/0/terms_of_use");
194
+ expect(errors[0][0].keyword).toBe("additionalProperties");
195
+ });
@@ -287,4 +287,4 @@ fs.writeFileSync(
287
287
  "../schemas/v3/compactSkeleton.txt",
288
288
  compactSkeleton
289
289
  );
290
- console.log("Compact Skeleton written to ../schemas/v3/compactSkeleton.txt");
290
+ console.log("Compact Skeleton written to ../schemas/v3/compactSkeleton.txt");
@@ -1,91 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Transaction Milestones",
4
- "description": "Schema for tracking transaction milestones throughout the conveyancing process",
5
- "type": "object",
6
- "properties": {
7
- "listed": {
8
- "type": "object",
9
- "properties": {
10
- "completed": {
11
- "type": "string",
12
- "format": "date-time"
13
- }
14
- }
15
- },
16
- "legalForms": {
17
- "type": "object",
18
- "properties": {
19
- "completed": {
20
- "type": "string",
21
- "format": "date-time"
22
- }
23
- }
24
- },
25
- "soldSubjectToContract": {
26
- "type": "object",
27
- "properties": {
28
- "completed": {
29
- "type": "string",
30
- "format": "date-time"
31
- }
32
- }
33
- },
34
- "searches": {
35
- "type": "object",
36
- "properties": {
37
- "ordered": {
38
- "type": "string",
39
- "format": "date-time"
40
- },
41
- "expected": {
42
- "type": "string",
43
- "format": "date-time"
44
- },
45
- "completed": {
46
- "type": "string",
47
- "format": "date-time"
48
- }
49
- }
50
- },
51
- "enquiries": {
52
- "type": "object",
53
- "properties": {
54
- "completed": {
55
- "type": "string",
56
- "format": "date-time"
57
- }
58
- }
59
- },
60
- "exchangeOfContracts": {
61
- "type": "object",
62
- "properties": {
63
- "expected": {
64
- "type": "string",
65
- "format": "date-time"
66
- },
67
- "completed": {
68
- "type": "string",
69
- "format": "date-time"
70
- }
71
- }
72
- },
73
- "completion": {
74
- "type": "object",
75
- "properties": {
76
- "started": {
77
- "type": "string",
78
- "format": "date-time"
79
- },
80
- "expected": {
81
- "type": "string",
82
- "format": "date-time"
83
- },
84
- "completed": {
85
- "type": "string",
86
- "format": "date-time"
87
- }
88
- }
89
- }
90
- }
91
- }