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

Enhance CountAuthorization to have a sub-authorization field #1483

Closed
4 tasks
SpicyLemon opened this issue Apr 18, 2023 · 2 comments
Closed
4 tasks

Enhance CountAuthorization to have a sub-authorization field #1483

SpicyLemon opened this issue Apr 18, 2023 · 2 comments
Labels
authz cosmos-sdk Issues/PRs related to our fork of the Cosmos-SDK enhancement New feature or request good first issue Good for newcomers wontfix This will not be worked on

Comments

@SpicyLemon
Copy link
Contributor

Summary

Add a sub_authorization field to the CountAuthorization (defined in our SDK fork here).

Problem Definition

As a granter, I want to be able to enhance any authorization with a limit on the number of uses.

Proposal

Add a sub_authorization field to the CountAuthorization.

In the Accept, also call the Accept of the sub-authorization (if there is one) and handle it accordingly.

  • If the sub-authorization's Accept says to delete, then the CountAuthorization's should say to too.
  • If it returns an update, then the sub-authorization value needs the new updated value in the CountAuthorization.
  • A CountAuthorization always returns either an updated version or to delete it.
  • An error from the sub-authorization's Accept should be returned from the CountAuthorization's Accept.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@SpicyLemon SpicyLemon added enhancement New feature or request good first issue Good for newcomers authz cosmos-sdk Issues/PRs related to our fork of the Cosmos-SDK labels Apr 18, 2023
@iramiller iramiller added this to the v1.17.0 milestone May 15, 2023
@SpicyLemon SpicyLemon modified the milestones: v1.17.0, v1.18.0 Sep 6, 2023
@iramiller iramiller modified the milestones: v1.18.0, v1.19.0 Jan 4, 2024
@SpicyLemon SpicyLemon modified the milestones: v1.19.0, v1.20.0 Jul 15, 2024
@SpicyLemon SpicyLemon moved this from Todo to Backlog in Provenance Core Protocol Team Jul 15, 2024
@iramiller iramiller modified the milestones: v1.20.0, v1.21.0 Oct 7, 2024
@SpicyLemon
Copy link
Contributor Author

Actually, I just realized that a better way might be to create a new multi-authorization.
It'd have a string msg for the type url and then a list of sub-authorizations.

All of the sub-authorizations would need to be for the same msg (type url).

When authorizing it, all sub-authorizations would need to be accepted. Once one of them hits "delete", the parent (and the other sub-authorizations) get deleted. If any of them return an update, the parent needs to be updated to have the new sub-authorization.

This would provide a versatile way to combine multiple authorizations, e.g. a CountAuthorization and a MarkerTransferAuthorization. With those two, the entire authorization would be deleted if either the count reaches zero, or the transfer limit reaches zero. I.e. I could say, "I'll allow Bob to do a transfer of up to 100bananas, but only once."

@SpicyLemon
Copy link
Contributor Author

I've created the following issue from my previous comment:

That would solve the same problem that this issue is trying to solve, but in a more generic way. So I'm gonna close this issue.

@SpicyLemon SpicyLemon removed this from the v1.21.0 milestone Nov 4, 2024
@SpicyLemon SpicyLemon added the wontfix This will not be worked on label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authz cosmos-sdk Issues/PRs related to our fork of the Cosmos-SDK enhancement New feature or request good first issue Good for newcomers wontfix This will not be worked on
Projects
Development

No branches or pull requests

2 participants