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

fix: sanitize permissions #801

Merged
merged 3 commits into from
Apr 4, 2022
Merged

fix: sanitize permissions #801

merged 3 commits into from
Apr 4, 2022

Conversation

RiccardoM
Copy link
Contributor

@RiccardoM RiccardoM commented Apr 1, 2022

Description

This PR adds permissions sanitation before storing the permissions while handling a MsgSetUserGroupPermissions or MsgSetUserPermissions.

Special review required by @manu0466 since he was the one to report the bug (and suggest a solution).

Closes: #800


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
@github-actions github-actions bot added x/profiles Module that allows to create and manage decentralized social profiles x/subspaces Issue on the x/subspaces module labels Apr 1, 2022
@codecov
Copy link

codecov bot commented Apr 1, 2022

Codecov Report

Merging #801 (7c69120) into master (28b4a2e) will increase coverage by 0.06%.
The diff coverage is 87.32%.

@@            Coverage Diff             @@
##           master     #801      +/-   ##
==========================================
+ Coverage   81.28%   81.35%   +0.06%     
==========================================
  Files          77       78       +1     
  Lines        6610     6681      +71     
==========================================
+ Hits         5373     5435      +62     
- Misses        989      995       +6     
- Partials      248      251       +3     
Impacted Files Coverage Δ
x/subspaces/legacy/v2/store.go 84.21% <84.21%> (ø)
x/subspaces/keeper/msg_server.go 85.41% <100.00%> (+0.23%) ⬆️
x/subspaces/types/permissions.go 73.52% <100.00%> (+8.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28b4a2e...7c69120. Read the comment docs.

Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Copy link

@manu0466 manu0466 left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@RiccardoM RiccardoM added the automerge Automatically merge PR once all prerequisites pass label Apr 4, 2022
Copy link
Contributor

@leobragaz leobragaz left a comment

Choose a reason for hiding this comment

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

👍

@mergify mergify bot merged commit 3edee0a into master Apr 4, 2022
@mergify mergify bot deleted the riccardo/fix-permissions-bug branch April 4, 2022 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once all prerequisites pass x/profiles Module that allows to create and manage decentralized social profiles x/subspaces Issue on the x/subspaces module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible unexpected behaviours in subspace permissions
3 participants