Skip to content

Commit

Permalink
Permissions protocol final touch up (#723)
Browse files Browse the repository at this point in the history
1. Replaced deprecated keyword 'definitions' in JSON schemas in v2020-12
standard.
1. PermissionsGrant -> PermissionGrant renaming.
1. Renamed PermissionXyzModel -> PermissionXyzData to be less
misleading.
  • Loading branch information
thehenrytsai committed Apr 24, 2024
1 parent b970d11 commit 26d1944
Show file tree
Hide file tree
Showing 42 changed files with 476 additions and 397 deletions.
2 changes: 1 addition & 1 deletion json-schemas/definitions.json
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://identity.foundation/dwn/json-schemas/defs.json",
"type": "object",
"definitions": {
"$defs": {
"base64url": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]+$"
Expand Down
6 changes: 3 additions & 3 deletions json-schemas/general-jws.json
Expand Up @@ -5,7 +5,7 @@
"additionalProperties": false,
"properties": {
"payload": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/base64url"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url"
},
"signatures": {
"type": "array",
Expand All @@ -14,10 +14,10 @@
"type": "object",
"properties": {
"protected": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/base64url"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url"
},
"signature": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/base64url"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url"
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions json-schemas/interface-methods/events-filter.json
Expand Up @@ -30,7 +30,7 @@
"type": "string"
},
"recipient": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/did"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/did"
},
"contextId": {
"type": "string"
Expand All @@ -56,10 +56,10 @@
"additionalProperties": false,
"properties": {
"from": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"to": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
}
}
},
Expand All @@ -69,10 +69,10 @@
"additionalProperties": false,
"properties": {
"from": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"to": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
}
}
},
Expand All @@ -82,10 +82,10 @@
"additionalProperties": false,
"properties": {
"from": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"to": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion json-schemas/interface-methods/events-query.json
Expand Up @@ -34,7 +34,7 @@
"type": "string"
},
"messageTimestamp": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"filters": {
"type": "array",
Expand Down
2 changes: 1 addition & 1 deletion json-schemas/interface-methods/messages-get.json
Expand Up @@ -33,7 +33,7 @@
"type": "string"
},
"messageTimestamp": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"messageCids": {
"type": "array",
Expand Down
2 changes: 1 addition & 1 deletion json-schemas/interface-methods/protocols-configure.json
Expand Up @@ -34,7 +34,7 @@
"type": "string"
},
"messageTimestamp": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"definition": {
"$ref": "https://identity.foundation/dwn/json-schemas/protocol-definition.json"
Expand Down
4 changes: 2 additions & 2 deletions json-schemas/interface-methods/protocols-query.json
Expand Up @@ -32,7 +32,7 @@
"type": "string"
},
"messageTimestamp": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"filter": {
"type": "object",
Expand All @@ -43,7 +43,7 @@
"type": "string"
},
"recipient": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/did"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/did"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion json-schemas/interface-methods/records-delete.json
Expand Up @@ -34,7 +34,7 @@
"type": "string"
},
"messageTimestamp": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"recordId": {
"type": "string"
Expand Down
18 changes: 9 additions & 9 deletions json-schemas/interface-methods/records-filter.json
Expand Up @@ -12,13 +12,13 @@
"type": "string"
},
"author": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/did"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/did"
},
"attester": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/did"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/did"
},
"recipient": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/did"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/did"
},
"contextId": {
"type": "string"
Expand Down Expand Up @@ -82,10 +82,10 @@
"additionalProperties": false,
"properties": {
"from": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"to": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
}
}
},
Expand All @@ -95,10 +95,10 @@
"additionalProperties": false,
"properties": {
"from": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"to": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
}
}
},
Expand All @@ -108,10 +108,10 @@
"additionalProperties": false,
"properties": {
"from": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"to": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion json-schemas/interface-methods/records-query.json
Expand Up @@ -33,7 +33,7 @@
"type": "string"
},
"messageTimestamp": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"filter": {
"$ref": "https://identity.foundation/dwn/json-schemas/records-filter.json"
Expand Down
2 changes: 1 addition & 1 deletion json-schemas/interface-methods/records-read.json
Expand Up @@ -33,7 +33,7 @@
"type": "string"
},
"messageTimestamp": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"filter": {
"$ref": "https://identity.foundation/dwn/json-schemas/records-filter.json"
Expand Down
2 changes: 1 addition & 1 deletion json-schemas/interface-methods/records-subscribe.json
Expand Up @@ -33,7 +33,7 @@
"type": "string"
},
"messageTimestamp": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"filter": {
"$ref": "https://identity.foundation/dwn/json-schemas/records-filter.json"
Expand Down
16 changes: 8 additions & 8 deletions json-schemas/interface-methods/records-write-unidentified.json
Expand Up @@ -29,7 +29,7 @@
]
},
"initializationVector": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/base64url"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url"
},
"keyEncryption": {
"type": "array",
Expand Down Expand Up @@ -59,16 +59,16 @@
]
},
"encryptedKey": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/base64url"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url"
},
"initializationVector": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/base64url"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url"
},
"ephemeralPublicKey": {
"$ref": "https://identity.foundation/dwn/json-schemas/public-jwk.json"
},
"messageAuthenticationCode": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/base64url"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url"
}
},
"additionalProperties": false,
Expand Down Expand Up @@ -107,7 +107,7 @@
"type": "string"
},
"recipient": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/did"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/did"
},
"protocol": {
"type": "string"
Expand Down Expand Up @@ -163,16 +163,16 @@
"type": "number"
},
"dateCreated": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"messageTimestamp": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"published": {
"type": "boolean"
},
"datePublished": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"dataFormat": {
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion json-schemas/jwk-verification-method.json
Expand Up @@ -20,7 +20,7 @@
]
},
"controller": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/did"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/did"
},
"publicKeyJwk": {
"$ref": "https://identity.foundation/dwn/json-schemas/public-jwk.json"
Expand Down
6 changes: 3 additions & 3 deletions json-schemas/permissions/permission-grant-data.json
Expand Up @@ -12,7 +12,7 @@
"type": "string"
},
"dateExpires": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time"
},
"requestId": {
"type": "string"
Expand All @@ -21,10 +21,10 @@
"type": "boolean"
},
"scope": {
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/definitions/scope"
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/scope"
},
"conditions": {
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/definitions/conditions"
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/conditions"
}
}
}
4 changes: 2 additions & 2 deletions json-schemas/permissions/permission-request-data.json
Expand Up @@ -15,10 +15,10 @@
"type": "boolean"
},
"scope": {
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/definitions/scope"
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/scope"
},
"conditions": {
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/definitions/conditions"
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/conditions"
}
}
}
23 changes: 7 additions & 16 deletions json-schemas/permissions/permissions-definitions.json
Expand Up @@ -2,35 +2,26 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://identity.foundation/dwn/json-schemas/permissions/defs.json",
"type": "object",
"definitions": {
"grantedTo": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/did"
},
"grantedBy": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/did"
},
"grantedFor": {
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/did"
},
"$defs": {
"scope": {
"oneOf": [
{
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/definitions/protocols-query-scope"
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope"
},
{
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/definitions/records-read-scope"
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope"
},
{
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/definitions/records-delete-scope"
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope"
},
{
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/definitions/records-write-scope"
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope"
},
{
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/definitions/records-query-scope"
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope"
},
{
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/definitions/records-subscribe-scope"
"$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion json-schemas/permissions/scopes.json
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json",
"type": "object",
"definitions": {
"$defs": {
"protocols-query-scope": {
"type": "object",
"properties": {
Expand Down
Expand Up @@ -13,7 +13,7 @@
"delegatedGrantId": {
"type": "string"
},
"permissionsGrantId": {
"permissionGrantId": {
"type": "string"
},
"protocolRole": {
Expand Down
Expand Up @@ -26,7 +26,7 @@
"delegatedGrantId": {
"type": "string"
},
"permissionsGrantId": {
"permissionGrantId": {
"type": "string"
},
"protocolRole": {
Expand Down

0 comments on commit 26d1944

Please sign in to comment.