-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add permission check to account #14535
base: asset_permission
Are you sure you want to change the base?
Add permission check to account #14535
Conversation
⏱️ 3h 5m total CI duration on this PR
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
703921b
to
48991ff
Compare
05cd155
to
19324d8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## asset_permission #14535 +/- ##
===================================================
Coverage ? 59.4%
===================================================
Files ? 857
Lines ? 210762
Branches ? 0
===================================================
Hits ? 125197
Misses ? 85565
Partials ? 0 ☔ View full report in Codecov by Sentry. |
48991ff
to
906c7c7
Compare
19324d8
to
0a93383
Compare
906c7c7
to
350db4c
Compare
0a93383
to
bde486a
Compare
dec4a79
to
6cd5fd0
Compare
bde486a
to
5fc08ad
Compare
6cd5fd0
to
88ad9a1
Compare
5fc08ad
to
da28781
Compare
88ad9a1
to
5f90e3a
Compare
da28781
to
006ad4c
Compare
5f90e3a
to
ef7be0f
Compare
006ad4c
to
ef7abd3
Compare
ef7be0f
to
cd6090b
Compare
ef7abd3
to
c38c2dd
Compare
cd6090b
to
0df1c5a
Compare
c38c2dd
to
95b6704
Compare
0df1c5a
to
1bd468b
Compare
95b6704
to
7394967
Compare
1bd468b
to
40796a4
Compare
c557d1d
to
1212bb1
Compare
da2d989
to
c124e6c
Compare
1212bb1
to
57713ac
Compare
c124e6c
to
304e1e6
Compare
57713ac
to
289ab4d
Compare
304e1e6
to
3cd3d85
Compare
289ab4d
to
75ffedc
Compare
3cd3d85
to
5aae08b
Compare
aptos-move/framework/aptos-framework/sources/aptos_account.move
Outdated
Show resolved
Hide resolved
@@ -187,6 +190,23 @@ module aptos_framework::account { | |||
/// Create signer for testing, independently of an Aptos-style `Account`. | |||
public fun create_signer_for_test(addr: address): signer { create_signer(addr) } | |||
|
|||
struct AccountPermission has copy, drop, store {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't follow fully what all of the function below do - but not all are related to key rotation, right?
If so, can we organize them, and have AccountKeyRotationPermission as a separate category, and see for the rest if we need 1 or more.
If all below are related to key rotation - then rename to AccountKeyRotationPermission - as that sounds much scarier (as it should), than AccountPermission
75ffedc
to
d09b7ba
Compare
5aae08b
to
f15f9e1
Compare
/// Permissions | ||
inline fun check_signer_permission(s: &signer) { | ||
assert!( | ||
permissioned_signer::check_permission_exists(s, AccountPermission {}), | ||
error::permission_denied(ENO_ACCOUNT_PERMISSION), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a test-only flag to optionally skip permission checks in tests by modifying check_signer_permission() to check this flag first
Spotted by Graphite Reviewer (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.
d09b7ba
to
7d7eed9
Compare
f15f9e1
to
5ed6a9c
Compare
4db0036
to
d932531
Compare
5ed6a9c
to
895df9e
Compare
d932531
to
15dfa6e
Compare
895df9e
to
65c5737
Compare
Description
Adds permission checks to account operations in the Aptos Framework to restrict key rotation and signer capability management. This introduces a new
AccountPermission
type and associated functions to control access to privileged account operations.Key changes:
check_signer_permission
function to verify permissionsgrant_permission
function to authorize signersENO_ACCOUNT_PERMISSION
Type of Change
Which Components or Systems Does This Change Impact?
How Has This Been Tested?
TBA
Key Areas to Review
check_signer_permission
grant_permission
Checklist