Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add grant to Record class methods #859

Merged
merged 16 commits into from
Sep 3, 2024

Conversation

LiranCohen
Copy link
Member

@LiranCohen LiranCohen commented Aug 29, 2024

This PR fixes a bug where the Record class method which is retrieved with queries, reads, and writes did not respect the delegated permission state. The Record class now accepts an optional PermissionsApi so that it can share the TTL cache with a caller. If one is not provided a new one is instantiated from the agent that is passed.

Took advantage of removing the specific CachedPermissions class and wrapped it into the PermissionsApi interface.

Refactored some unnecessary abstractions when fetching the grant, added tests for missing cases and subscription cases.

Copy link

changeset-bot bot commented Aug 29, 2024

🦋 Changeset detected

Latest commit: 22e29f3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@web5/agent Minor
@web5/identity-agent Minor
@web5/proxy-agent Minor
@web5/user-agent Minor
@web5/api Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Aug 29, 2024

TBDocs Report

🛑 Errors: 0
⚠️ Warnings: 5

@web5/api

  • Project entry file: packages/api/src/index.ts

@web5/crypto

  • Project entry file: packages/crypto/src/index.ts
📄 File: ./packages/crypto/src/utils.ts
⚠️ extractor:typedoc:missing-docs: CryptoUtils (Variable) does not have any documentation.
⚠️ extractor:typedoc:missing-docs: CryptoUtils.__type.randomPin (Property) does not have any documentation.
⚠️ extractor:typedoc:missing-docs: CryptoUtils.__type.randomUuid (Property) does not have any documentation.
⚠️ extractor:typedoc:missing-docs: CryptoUtils.__type.randomBytes (Property) does not have any documentation.
⚠️ extractor:typedoc:missing-docs: CryptoUtils.__type.getJoseSignatureAlgorithmFromPublicKey (Property) does not have any documentation.

@web5/crypto-aws-kms

  • Project entry file: packages/crypto-aws-kms/src/index.ts

@web5/dids

  • Project entry file: packages/dids/src/index.ts

@web5/credentials

  • Project entry file: packages/credentials/src/index.ts

TBDocs Report Updated at 2024-09-03T14:57:55Z 22e29f3

Copy link

codecov bot commented Aug 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.42%. Comparing base (3da24db) to head (22e29f3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #859      +/-   ##
==========================================
+ Coverage   93.40%   93.42%   +0.02%     
==========================================
  Files         118      117       -1     
  Lines       33157    33260     +103     
  Branches     2650     2663      +13     
==========================================
+ Hits        30969    31072     +103     
  Misses       2149     2149              
  Partials       39       39              
Components Coverage Δ
agent 87.36% <100.00%> (-0.02%) ⬇️
api 99.60% <100.00%> (+0.01%) ⬆️
common 98.68% <ø> (ø)
credentials 94.95% <ø> (ø)
crypto 93.79% <ø> (ø)
dids 97.77% <ø> (ø)
identity-agent 96.42% <ø> (ø)
crypto-aws-kms 100.00% <ø> (ø)
proxy-agent 96.42% <ø> (ø)
user-agent 96.57% <ø> (ø)

@LiranCohen LiranCohen force-pushed the lirancohen/delegate-grant-record-type branch from 2efa570 to c9013b2 Compare August 31, 2024 07:17
@LiranCohen LiranCohen changed the base branch from main to lirancohen/records-test-single-did August 31, 2024 07:17
Base automatically changed from lirancohen/records-test-single-did to main August 31, 2024 14:07
@LiranCohen LiranCohen force-pushed the lirancohen/delegate-grant-record-type branch 2 times, most recently from f4394ed to 4d2f117 Compare September 1, 2024 21:58
@LiranCohen LiranCohen force-pushed the lirancohen/delegate-grant-record-type branch from 2c04d13 to 28b772a Compare September 2, 2024 00:43
@LiranCohen LiranCohen marked this pull request as ready for review September 3, 2024 15:06
@LiranCohen LiranCohen merged commit 7fc1f1d into main Sep 3, 2024
35 checks passed
@LiranCohen LiranCohen deleted the lirancohen/delegate-grant-record-type branch September 3, 2024 15:26
@github-actions github-actions bot mentioned this pull request Sep 3, 2024
This was referenced Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants