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

RecordsPermissionScope Revocation must be scoped to a protocol #754

Merged
merged 14 commits into from
Jun 15, 2024

Conversation

LiranCohen
Copy link
Member

@LiranCohen LiranCohen commented Jun 12, 2024

In order to get Permission Revocation messages associated with a specific protocol from the MessageStore it is necessary for the revocation messages to be tagged with the protocol from the grant scope.

In this PR:

  • added an optional protocol property to the PermissionRevocationCreateOptions which normalizes and adds the provided protocol as a tag.
  • added a preProcessingForCoreRecordsWrite method to the RecordsWriteHandler where if the incoming message is a revocation message, the original grant will be fetched and the protocol tag from the revocation will be compared to the grant scope protocol.

@LiranCohen LiranCohen force-pushed the lirancohen/protocol-scoped-permissions-request branch from f03849f to d51bb62 Compare June 13, 2024 18:19
@LiranCohen LiranCohen force-pushed the lirancohen/protocol-scoped-permissions-revoke branch 2 times, most recently from f678d9f to 726c44f Compare June 13, 2024 18:33
@LiranCohen LiranCohen force-pushed the lirancohen/protocol-scoped-permissions-request branch 2 times, most recently from 4e911a2 to 93ef1b9 Compare June 13, 2024 19:13
@LiranCohen LiranCohen force-pushed the lirancohen/protocol-scoped-permissions-revoke branch from 726c44f to b995fe9 Compare June 13, 2024 20:08
@LiranCohen LiranCohen force-pushed the lirancohen/protocol-scoped-permissions-request branch from 8c88313 to 45ab0dd Compare June 13, 2024 20:23
@LiranCohen LiranCohen force-pushed the lirancohen/protocol-scoped-permissions-revoke branch from b995fe9 to 955da16 Compare June 13, 2024 20:28
Base automatically changed from lirancohen/protocol-scoped-permissions-request to main June 13, 2024 22:21
@LiranCohen LiranCohen force-pushed the lirancohen/protocol-scoped-permissions-revoke branch from 955da16 to ab80f65 Compare June 13, 2024 22:26
@codecov-commenter
Copy link

codecov-commenter commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.57%. Comparing base (94da019) to head (b00b990).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #754      +/-   ##
==========================================
+ Coverage   98.55%   98.57%   +0.01%     
==========================================
  Files          73       73              
  Lines       10929    10986      +57     
  Branches     1573     1582       +9     
==========================================
+ Hits        10771    10829      +58     
+ Misses        152      151       -1     
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@LiranCohen LiranCohen marked this pull request as ready for review June 14, 2024 03:09
csuwildcat
csuwildcat previously approved these changes Jun 14, 2024
thehenrytsai
thehenrytsai previously approved these changes Jun 14, 2024
Copy link
Contributor

@thehenrytsai thehenrytsai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legit! And thanks for breaking up the PRs! Really makes reviewing a much pleasant and efficient experience.

Happy to chat if you'd like!

@LiranCohen LiranCohen dismissed stale reviews from thehenrytsai and csuwildcat via b00b990 June 14, 2024 23:32
@LiranCohen LiranCohen requested a review from thehenrytsai June 14, 2024 23:36
Copy link
Contributor

@thehenrytsai thehenrytsai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐐 🚀

Optional nit:

Do you think passing the message JSON directly for revocation creation is easier as dev-ex?

Non-blocking, code can be merged as is, and can be done later even if you agree.

Upon reviewing your code, I realized some of the typing isn't ideal (my code) and I probably meant to fix it but just forgot. A small PR will quickly follow this one it's merged.

@LiranCohen
Copy link
Member Author

Do you think passing the message JSON directly for revocation creation is easier as dev-ex?

Yeah I was debating this, but wasn't sure which object the user would have more readily available so i opted with the parsed type.

I'll merge this in and we can improve it a bit in a subsequent PR. 🙏

@LiranCohen LiranCohen merged commit 158470f into main Jun 15, 2024
4 checks passed
@LiranCohen LiranCohen deleted the lirancohen/protocol-scoped-permissions-revoke branch June 15, 2024 00:56
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.

4 participants