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 a multi-authorization. #2207

Open
4 tasks
SpicyLemon opened this issue Nov 4, 2024 · 2 comments
Open
4 tasks

Create a multi-authorization. #2207

SpicyLemon opened this issue Nov 4, 2024 · 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
Milestone

Comments

@SpicyLemon
Copy link
Contributor

Summary

Create a MultiAuthorization with a msg (type url) and a list of sub-authorizations.

Problem Definition

Currently, we have a few different authz authorization types, but each is narrowly defined and sometimes we want it to have extra restrictions.

Proposal

Create a MultiAuthorization with a msg (type url) and a list of sub_authorizations.

When accepting a MultiAuthorization, call Accept on each sub-authorization. If any return a delete, the parent also returns that. If any return an update, the parent should return an updated version of itself with the updated sub-authorizations. The parent only returns accept if all sub-messages also do.

The MsgTypeUrl of each sub_authorization must equal the parent's.

The sub_authorizations should be repeated Any unless there's a more specific type or interface that we can use for it.


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 Nov 4, 2024
@SpicyLemon SpicyLemon added this to the v1.21.0 milestone Nov 4, 2024
@SpicyLemon
Copy link
Contributor Author

I'm torn on whether to allow sub_authorizations to have only one entry, or if we should require it to have at least two.

My initial thought was that it should have at least two since otherwise, it'd just be that authorization. But then I realized that the parent counts as a GenericAuthorization, so there might be a use where we need one of these with only one sub-authorization. Then again, all authorizations are extensions of a GenericAuthorization, so maybe that shouldn't count like this.

@iramiller
Copy link
Member

Since the name has Multi in it then it would be reasonable to expect a single to not work imo… but ultimately it seems like whichever leads to the simplistic/least code solution should be used.

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
Projects
Development

No branches or pull requests

2 participants