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

Remove Scopes and Add Viewer Role #2821

Merged
merged 5 commits into from
Mar 15, 2023
Merged

Conversation

pattisdr
Copy link
Contributor

@pattisdr pattisdr commented Mar 13, 2023

Closes #2776
❗ Locked to the same release as #2739

Code Changes

  • Removes CONFIG_UPDATE from contributor scopes - Allow UI-created users to use system config UI #2791 (comment)
  • Adds a data migration to give all users a viewer role, removes their scopes from their permissions and client table
  • Tacks on automatically generated messagingconfig_service_type_key unique index, leftovers from 179f2bb623ae_update_table_for_twilio.py. From Adam: i'm assuming that index got deleted in my migration along with dropping the column it refers to, i.e. with op.drop_column("messagingconfig", "service_type_old") - since earlier in the migration i had: op.alter_column( "messagingconfig", "service_type", new_column_name="service_type_old" )
    and so now the new migration is adding it back in to keep things in sync
  • Updatest src/fides/data/test_env/fides.test_env.toml since we now develop with the more strict prod setting - this extends this to when we run fides test env

Steps to Confirm

  • list any manual steps for reviewers to confirm the changes

Pre-Merge Checklist

Description Of Changes

This is an automated data migration to transition to the new "roles".

Sets all user scopes to an empty list and gives all users a viewer role. Someone will need to login as a root user and assign roles. Intentionally nothing preventing users from adding scopes to their users via the API yet.

A followup in a future sprint will get rid of fidesuserpermission.scopes entirely #2696

@cypress
Copy link

cypress bot commented Mar 14, 2023

Passing run #835 ↗︎

0 3 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge 050a0b7 into 53979ef...
Project: fides Commit: 912b634c32 ℹ️
Status: Passed Duration: 00:53 💡
Started: Mar 15, 2023 8:15 PM Ended: Mar 15, 2023 8:16 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@codecov
Copy link

codecov bot commented Mar 14, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (53979ef) 86.73% compared to head (050a0b7) 86.73%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2821   +/-   ##
=======================================
  Coverage   86.73%   86.73%           
=======================================
  Files         295      295           
  Lines       16753    16753           
  Branches     2145     2145           
=======================================
  Hits        14531    14531           
  Misses       1819     1819           
  Partials      403      403           
Impacted Files Coverage Δ
src/fides/api/ops/tasks/storage.py 74.39% <ø> (ø)
src/fides/lib/oauth/roles.py 100.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pattisdr pattisdr marked this pull request as ready for review March 14, 2023 00:41
Copy link
Contributor

@allisonking allisonking left a comment

Choose a reason for hiding this comment

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

the scopes/roles migration lgtm! don't know much about the other stuff though :)

@pattisdr
Copy link
Contributor Author

Thank you @allisonking! I'll see if I can get @adamsachs to take a look at the other piece. I'll hold off on merging until your piece is ready.

Copy link
Contributor

@adamsachs adamsachs left a comment

Choose a reason for hiding this comment

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

this looks good, thanks a lot for the cleanup/follow-up work here! 🧹

@pattisdr
Copy link
Contributor Author

Thanks @adamsachs 🏆

@pattisdr
Copy link
Contributor Author

Updated with main for CHANGELOG conflict

@pattisdr pattisdr merged commit feb36a4 into main Mar 15, 2023
@pattisdr pattisdr deleted the fides_2776_automated_viewer_migration branch March 15, 2023 20:26
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.

Automated Migration Plan: Scopes -> Roles
3 participants