Skip to content

Commit 64909db

Browse files
committed
fix: sync discovery schema/spec with IETF-RFC.md
- Fix Appendix D Provider diagram tokens/fields to match the draft (tokenEndPoint, http-sig, http-request-signatures, publicKeys[]) - Align spec.yaml wording/examples with the draft (capability tokens, accessTypes, tokenEndPoint URL vs inviteAcceptDialog path) - Move discovery schema to schemas/ocm-discovery.jsonc with draft-strict URL rules Signed-off-by: Mahdi Baghbani <[email protected]>
1 parent 0ec7ec2 commit 64909db

File tree

5 files changed

+1055
-115
lines changed

5 files changed

+1055
-115
lines changed

IETF-RFC.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,23 +1677,27 @@ OCM Providers.
16771677
| - inviteAcceptDialog |
16781678
| - provider |
16791679
| - publicKey |
1680-
| - tokenEndpoint |
1680+
| - publicKeys[] |
1681+
| - tokenEndPoint |
16811682
+-----------------------+
16821683
|
16831684
| exposes
16841685
|
16851686
+---------+---------+----------------------+
16861687
| | |
16871688
v v v
1688-
+------------------+ +------------------+ +------------------+
1689-
| ResourceTypes[] | | Capabilities[] | | Criteria[] |
1690-
+------------------+ +------------------+ +------------------+
1691-
| - name | | - enforce-mfa | | - allowlist |
1692-
| - shareTypes[] | | - exchange-token | | - denylist |
1693-
| - protocols{} | | - invite-wayf | | - http-signatures|
1694-
+------------------+ | - invites | | - invite |
1695-
| | - webdav-uri | | - token-exchange |
1696-
| +------------------+ +------------------+
1689+
+------------------+ +------------------+ +--------------------------+
1690+
| ResourceTypes[] | | Capabilities[] | | Criteria[] |
1691+
+------------------+ +------------------+ +--------------------------+
1692+
| - name | | - enforce-mfa | | - allowlist |
1693+
| - shareTypes[] | | - exchange-token | | - denylist |
1694+
| - protocols{} | | - http-sig | | - http-request-signatures|
1695+
+------------------+ | - invites | | - invite |
1696+
| | - notifications | | - token-exchange |
1697+
| | - protocol-object| +--------------------------+
1698+
| | - webdav-uri |
1699+
| +------------------+
1700+
|
16971701
| supports
16981702
v
16991703
+------------------+

schemas/ocm-discovery.json

Lines changed: 0 additions & 101 deletions
This file was deleted.

schemas/ocm-discovery.jsonc

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
// Discovery schema for OCM API Discovery (JSON Schema, JSONC for comments).
3+
//
4+
// Content source of truth: IETF-RFC.md (this repo).
5+
//
6+
// Mixed URL forms (per draft wording):
7+
// - inviteAcceptDialog is a URL path (starts with "/"), resolved at the server origin.
8+
// - tokenEndPoint is a URL (typically https://...) of the token exchange endpoint.
9+
//
10+
"title": "OCM API Discovery",
11+
"$schema": "https://json-schema.org/draft/2020-12/schema",
12+
"type": "object",
13+
"properties": {
14+
"enabled": { "type": "boolean" },
15+
"apiVersion": { "type": "string" },
16+
"endPoint": { "type": "string", "format": "uri" },
17+
"provider": { "type": "string" },
18+
"resourceTypes": {
19+
"type": "array",
20+
"items": { "$ref": "#/$defs/resourceType" }
21+
},
22+
"capabilities": {
23+
"type": "array",
24+
"description": "Optional capability tokens (for example: enforce-mfa, exchange-token, http-sig, invites, invite-wayf, notifications, protocol-object, webdav-uri).",
25+
"items": { "type": "string" }
26+
},
27+
"criteria": {
28+
"type": "array",
29+
"description": "Optional criteria tokens (for example: http-request-signatures, token-exchange, denylist, allowlist, invite).",
30+
"items": { "type": "string" }
31+
},
32+
"publicKey": { "$ref": "#/$defs/publicKeyLegacy" },
33+
"publicKeys": {
34+
"type": "array",
35+
"description": "Optional public keys for RFC 9421 HTTP Message Signatures (see IETF-RFC.md).",
36+
"items": { "$ref": "#/$defs/publicKeyRfc9421" }
37+
},
38+
"inviteAcceptDialog": {
39+
"type": "string",
40+
"pattern": "^/",
41+
"description": "URL path of a web page where a user can accept an invite (see IETF-RFC.md)."
42+
},
43+
"tokenEndPoint": {
44+
"type": "string",
45+
"format": "uri",
46+
"pattern": "^https?://",
47+
"description": "URL of the token exchange endpoint (see IETF-RFC.md)."
48+
}
49+
},
50+
"required": ["enabled", "apiVersion", "endPoint", "resourceTypes"],
51+
"$defs": {
52+
"resourceType": {
53+
"properties": {
54+
"name": { "type": "string" },
55+
"shareTypes": { "type": "array" },
56+
"protocols": { "$ref": "#/$defs/protocols" }
57+
},
58+
"required": ["name", "shareTypes", "protocols"]
59+
},
60+
"protocols": {
61+
"type": "object",
62+
"minProperties": 1,
63+
"description": "Additional protocols besides 'webdav', 'webapp' and 'ssh' may be defined.",
64+
"properties": {
65+
"webdav": { "type": "string", "pattern": "^/" },
66+
"webapp": { "type": "string", "pattern": "^/" },
67+
"ssh": { "type": "string" }
68+
}
69+
},
70+
"publicKeyLegacy": {
71+
"type": "object",
72+
"properties": {
73+
"keyId": { "type": "string" },
74+
"publicKeyPem": { "type": "string" }
75+
},
76+
"required": ["keyId", "publicKeyPem"]
77+
},
78+
"publicKeyRfc9421": {
79+
"type": "object",
80+
"properties": {
81+
"keyId": { "type": "string" },
82+
"publicKeyPem": { "type": "string" },
83+
"algorithm": { "type": "string" }
84+
},
85+
"required": ["keyId", "publicKeyPem", "algorithm"]
86+
}
87+
}
88+
}

0 commit comments

Comments
 (0)