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

Create authz authorization with limited number of uses. #807

Closed
2 of 6 tasks
dwedul-figure opened this issue Apr 27, 2022 · 3 comments
Closed
2 of 6 tasks

Create authz authorization with limited number of uses. #807

dwedul-figure opened this issue Apr 27, 2022 · 3 comments
Assignees
Labels
authz CLI Command line interface feature enhancement New feature or request epic This ticket is used for grouping other tickets together. marker Marker Module metadata Metadata Module proto Protobuf files work
Milestone

Comments

@dwedul-figure
Copy link
Contributor

dwedul-figure commented Apr 27, 2022

Summary

Create an authorization for use with x/authz that restricts the authorization to a number of uses.

Problem Definition

As an asset owner, I want to give authorization to a grantee that is limited to a certain number of times, so that I can more accurately restrict the authorization.

Proposal

Create a new authorization message that has a uses left count and an underlying authorization.

MsgTypeURL should return the MsgTypeURL of the underlying authorization.
Accept should check and update the uses left and also call the Accept of the underlying authorization.
ValidateBasic should make sure the uses left is greater than zero and call the underlying authorization's ValidateBasic.

This will be similar to the SendAuthorization implementation in https://docs.cosmos.network/master/architecture/adr-030-authz-module.html#authorization except with a uses left count instead of coins, and the addition of the underlying authorization.

As part of this, we will also want to update all custom uses of authorizations (e.g. in the x/metadata module) to call the Accept method and make sure they allow for this new type of authorization (e.g. aren't limited to a generic authorization). If any such limitations exist, check for this type of authorization, and then limit off of its underlying type. In other words, don't allow this type of authorization without checking the underlying type.

Also, make sure that we can use the provenanced tx authz command stuff to add this new type of authorization.

Subtasks:


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@dwedul-figure dwedul-figure added enhancement New feature or request marker Marker Module metadata Metadata Module authz proto Protobuf files work CLI Command line interface feature labels Apr 27, 2022
@dwedul-figure
Copy link
Contributor Author

This issue was created due to this comment: #788 (comment) on #788

@egaxhaj
Copy link
Contributor

egaxhaj commented Jun 28, 2022

Found a bug #903 in the marker module that blocks part of the work for this.

@egaxhaj
Copy link
Contributor

egaxhaj commented Aug 2, 2022

Closing this. Subtasks #904 and #905 have been completed and merged.

@egaxhaj egaxhaj closed this as completed Aug 2, 2022
Repository owner moved this from In Progress to Done in Provenance Core Protocol Team Aug 2, 2022
@iramiller iramiller moved this from Done to Archive in Provenance Core Protocol Team Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authz CLI Command line interface feature enhancement New feature or request epic This ticket is used for grouping other tickets together. marker Marker Module metadata Metadata Module proto Protobuf files work
Projects
Development

No branches or pull requests

2 participants