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

add perimission checks to object #14582

Open
wants to merge 1 commit into
base: 09-04-add_permission_check_to_account
Choose a base branch
from

Conversation

runtian-zhou
Copy link
Contributor

@runtian-zhou runtian-zhou commented Sep 10, 2024

Description

Adds permissioned signer support for object transfers and token/collection mutations in the Aptos Framework. This change introduces new permission types and validation checks to ensure only authorized signers can perform transfers and mutations on objects, tokens and collections.

Type of Change

  • New feature
  • Aptos Framework

Which Components or Systems Does This Change Impact?

  • Move/Aptos Virtual Machine
  • Aptos Framework

How Has This Been Tested?

Added new test cases in object.move and aptos_token.move to verify permissioned signer functionality for transfers and mutations.

Key Areas to Review

  • New permission types added: TransferPermission, TokenUpdatePermission, CollectionUpdatePermission
  • Permission validation checks in transfer and mutation operations
  • Integration with existing permissioned_signer module
  • Authorization and revocation flows for token/collection mutations

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Copy link

trunk-io bot commented Sep 10, 2024

⏱️ 1h 41m total CI duration on this PR
Slowest 15 Jobs Cumulative Duration Recent Runs
rust-move-unit-coverage 18m 🟩
rust-move-unit-coverage 14m 🟩
rust-move-unit-coverage 14m 🟩
rust-move-tests 10m 🟥
rust-move-tests 9m 🟥
general-lints 7m 🟩🟩🟩🟩
rust-cargo-deny 7m 🟩🟩🟩🟩
rust-move-tests 5m
rust-move-unit-coverage 5m
check-dynamic-deps 4m 🟩🟩🟩🟩🟩 (+1 more)
rust-move-tests 3m 🟥
semgrep/ci 2m 🟩🟩🟩🟩🟩 (+1 more)
file_change_determinator 48s 🟩🟩🟩🟩
file_change_determinator 43s 🟩🟩🟩🟩
permission-check 16s 🟩🟩🟩🟩🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

Copy link
Contributor Author

runtian-zhou commented Sep 10, 2024

@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from da28781 to 006ad4c Compare September 10, 2024 17:29
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 381be20 to 6a1fe6d Compare September 10, 2024 17:30
Copy link

codecov bot commented Sep 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.4%. Comparing base (0161bbf) to head (2431b7b).

Additional details and impacted files
@@                          Coverage Diff                           @@
##           09-04-add_permission_check_to_account   #14582   +/-   ##
======================================================================
  Coverage                                   59.4%    59.4%           
======================================================================
  Files                                        857      857           
  Lines                                     210762   210762           
======================================================================
  Hits                                      125197   125197           
  Misses                                     85565    85565           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 006ad4c to ef7abd3 Compare September 12, 2024 01:50
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 6a1fe6d to 9037ce3 Compare September 12, 2024 01:50
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from ef7abd3 to c38c2dd Compare September 17, 2024 05:09
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 9037ce3 to 843150a Compare September 17, 2024 05:09
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from c38c2dd to 95b6704 Compare September 17, 2024 21:23
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 843150a to 33a73d7 Compare September 17, 2024 21:23
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 95b6704 to 7394967 Compare September 18, 2024 06:23
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 33a73d7 to 9123ceb Compare September 18, 2024 06:23
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 7394967 to a091794 Compare September 18, 2024 17:52
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 9123ceb to 206e782 Compare September 18, 2024 17:52
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from a091794 to 67163ae Compare September 19, 2024 00:35
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 206e782 to 9c81c83 Compare September 19, 2024 00:35
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 67163ae to f10a3b3 Compare September 19, 2024 08:09
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 9c81c83 to 75362c4 Compare September 19, 2024 08:09
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from f10a3b3 to 5c9396f Compare October 4, 2024 20:56
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 75362c4 to 86c07b1 Compare October 4, 2024 20:57
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 5c9396f to 9935539 Compare October 5, 2024 01:54
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 86c07b1 to 0573a7b Compare October 5, 2024 01:54
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 9935539 to b927c02 Compare October 5, 2024 02:25
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 0573a7b to 6a446be Compare October 5, 2024 02:25
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 01c55aa to b093be7 Compare January 13, 2025 19:07
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 54581c5 to 8d87ba2 Compare January 13, 2025 20:20
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from b093be7 to fecd1c8 Compare January 13, 2025 20:21
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 8d87ba2 to 685ae8e Compare January 13, 2025 20:30
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from fecd1c8 to 604c2c3 Compare January 13, 2025 20:30
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 685ae8e to 714595b Compare January 13, 2025 21:18
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 604c2c3 to 268e658 Compare January 13, 2025 21:19
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 714595b to 4b17b0b Compare January 13, 2025 21:43
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 268e658 to 9242526 Compare January 13, 2025 21:44
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 4b17b0b to ac65e16 Compare January 13, 2025 22:26
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 9242526 to 7fc9e54 Compare January 13, 2025 22:26
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from ac65e16 to f892ca9 Compare January 13, 2025 23:12
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 7fc9e54 to 78d099a Compare January 13, 2025 23:12
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from f892ca9 to 885aaa8 Compare January 14, 2025 00:23
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 78d099a to 6e7ead9 Compare January 14, 2025 00:23
let creator_permission_signer = permissioned_signer::signer_from_permissioned_handle(&creator_permission_handle);

// Grant aaron_permission_signer permission to transfer weapon object
grant_permission(creator, &creator_permission_signer, weapon);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment in the test refers to aaron_permission_signer but the actual variable name used is creator_permission_signer. The variable name in the comment should be updated to match the implementation for accuracy.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 885aaa8 to 37d819c Compare January 14, 2025 04:13
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 6e7ead9 to 5020648 Compare January 14, 2025 04:13
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 37d819c to 6fee5f3 Compare January 14, 2025 15:59
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 5020648 to 3234e44 Compare January 14, 2025 16:00
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 6fee5f3 to 9f787c4 Compare January 14, 2025 17:41
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 3234e44 to 9d42240 Compare January 14, 2025 17:42
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 9f787c4 to 98c30cd Compare January 14, 2025 19:07
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 9d42240 to 00ad379 Compare January 14, 2025 19:08
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 98c30cd to 945343a Compare January 14, 2025 19:10
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 00ad379 to bacdfc0 Compare January 14, 2025 19:11
@runtian-zhou runtian-zhou force-pushed the 09-04-add_permission_check_to_account branch from 945343a to 48f64ba Compare January 14, 2025 19:20
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from bacdfc0 to 87b4bd5 Compare January 14, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants