Skip to content

Commit

Permalink
feat(x/authz): Add MsgRevokeAll (cosmos#20161)
Browse files Browse the repository at this point in the history
Co-authored-by: Tuan Tran <[email protected]>
Co-authored-by: Khanh Hoa <[email protected]>
  • Loading branch information
3 people authored Apr 26, 2024
1 parent fbb94f4 commit 2d0d190
Show file tree
Hide file tree
Showing 16 changed files with 2,408 additions and 135 deletions.
601 changes: 576 additions & 25 deletions api/cosmos/authz/v1beta1/event.pulsar.go

Large diffs are not rendered by default.

989 changes: 937 additions & 52 deletions api/cosmos/authz/v1beta1/tx.pulsar.go

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions api/cosmos/authz/v1beta1/tx_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions x/authz/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Features

* [#18737](https://github.com/cosmos/cosmos-sdk/pull/18737) Added a limit of 200 grants pruned per `BeginBlock` and the `PruneExpiredGrants` message that prunes 75 expired grants on every run.
* [#20161](https://github.com/cosmos/cosmos-sdk/pull/20161) Added `RevokeAll` method to revoke all grants at once.

### API Breaking Changes

Expand Down
14 changes: 14 additions & 0 deletions x/authz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ granting arbitrary privileges from one account (the granter) to another account
* [Messages](#messages)
* [MsgGrant](#msggrant)
* [MsgRevoke](#msgrevoke)
* [MsgRevokeAll](#msgrevokeall)
* [MsgExec](#msgexec)
* [MsgPruneExpiredGrants](#msgpruneexpiredgrants)
* [Events](#events)
Expand Down Expand Up @@ -168,6 +169,19 @@ The message handling should fail if:

NOTE: The `MsgExec` message removes a grant if the grant has expired.

### MsgRevokeAll

The `MsgRevokeAll` message revokes all grants issued by the specified granter. This is useful for quickly removing all authorizations granted by a single granter without specifying individual message types or grantees.

```protobuf reference
https://github.com/cosmos/cosmos-sdk/tree/main/proto/cosmos/authz/v1beta1/tx.proto#L91-L97
```

The message handling should fail if:

* the `granter` address is not provided or invalid.
* the `granter` does not have any active grants.

### MsgExec

When a grantee wants to execute a transaction on behalf of a granter, they must send `MsgExec`.
Expand Down
Loading

0 comments on commit 2d0d190

Please sign in to comment.