Skip to content

Commit

Permalink
Support protocol authorized reads (#307)
Browse files Browse the repository at this point in the history
* Support protocol authorized reads

* Refactor ancestorMessageChain

* Rewrite tests with email protocol

* Remove stubDidResolver

* Update socialMediaProtocol to allow anyone to read captions

* Update tests/interfaces/records/handlers/records-read.spec.ts

Co-authored-by: Henry Tsai <[email protected]>

* Lint

---------

Co-authored-by: Henry Tsai <[email protected]>
  • Loading branch information
Diane Huxley and thehenrytsai authored Apr 14, 2023
1 parent e760006 commit c6733d6
Show file tree
Hide file tree
Showing 9 changed files with 331 additions and 174 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Decentralized Web Node (DWN) SDK

Code Coverage
![Statements](https://img.shields.io/badge/statements-93.56%25-brightgreen.svg?style=flat) ![Branches](https://img.shields.io/badge/branches-93.09%25-brightgreen.svg?style=flat) ![Functions](https://img.shields.io/badge/functions-91.24%25-brightgreen.svg?style=flat) ![Lines](https://img.shields.io/badge/lines-93.56%25-brightgreen.svg?style=flat)
![Statements](https://img.shields.io/badge/statements-93.62%25-brightgreen.svg?style=flat) ![Branches](https://img.shields.io/badge/branches-93.2%25-brightgreen.svg?style=flat) ![Functions](https://img.shields.io/badge/functions-91.24%25-brightgreen.svg?style=flat) ![Lines](https://img.shields.io/badge/lines-93.62%25-brightgreen.svg?style=flat)

## Introduction

Expand Down
127 changes: 57 additions & 70 deletions json-schemas/protocol-rule-set.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,91 +6,78 @@
"properties": {
"allow": {
"type": "object",
"oneOf": [
{
"minProperties": 1,
"additionalProperties": false,
"properties": {
"anyone": {
"type": "object",
"additionalProperties": false,
"properties": {
"anyone": {
"type": "object",
"additionalProperties": false,
"properties": {
"to": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"enum": [
"write"
]
}
}
},
"required": [
"to"
]
"to": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"enum": [
"read",
"write"
]
}
}
}
},
"required": [
"to"
]
},
{
"author": {
"type": "object",
"additionalProperties": false,
"properties": {
"author": {
"type": "object",
"additionalProperties": false,
"properties": {
"of": {
"type": "string"
},
"to": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"enum": [
"write"
]
}
}
},
"required": [
"of",
"to"
]
"of": {
"type": "string"
},
"to": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"enum": [
"read",
"write"
]
}
}
}
},
"required": [
"of",
"to"
]
},
{
"recipient": {
"type": "object",
"additionalProperties": false,
"properties": {
"recipient": {
"type": "object",
"additionalProperties": false,
"properties": {
"of": {
"type": "string"
},
"to": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"enum": [
"write"
]
}
}
},
"required": [
"of",
"to"
]
"of": {
"type": "string"
},
"to": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"enum": [
"read",
"write"
]
}
}
}
},
"required": [
"of",
"to"
]
}
]
}
},
"records": {
"type": "object",
Expand Down
Loading

0 comments on commit c6733d6

Please sign in to comment.