TBD54566975 / dwn-sdk-js

Decentralized Web Node (DWN) Reference implementation
https://identity.foundation/decentralized-web-node/spec/
Apache License 2.0
324 stars 95 forks source link

RecordsPermissionScope Grants must be scoped to a protocol #750

Closed LiranCohen closed 2 months ago

LiranCohen commented 3 months ago

Modifies RecordsPermissionScope to require scoping to a specific protocol. This also removes the ability to scope to a schema as you would just scope to a protocolPath instead.

The motivation behind this was to make querying for all Messages tied to a specific protocol for subset sync. Without this change getting grants, and more importantly the grant revocations which have unrestricted scopes would be challenging/not performant.

Since we are planning on getting rid of flat-spaced records anyway, this is a step in the right direction.

grant is covered by this PR. request and revoke will come in subsequent PRs

codecov-commenter commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.55%. Comparing base (0311b9e) to head (c47f3d1).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #750 +/- ## ========================================== - Coverage 98.64% 98.55% -0.10% ========================================== Files 73 73 Lines 10945 10911 -34 Branches 1582 1571 -11 ========================================== - Hits 10797 10753 -44 - Misses 142 152 +10 Partials 6 6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.