Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Add option to login as root user from config #1116

Merged
merged 9 commits into from
Aug 23, 2022
Merged

Add option to login as root user from config #1116

merged 9 commits into from
Aug 23, 2022

Conversation

sanders41
Copy link
Contributor

@sanders41 sanders41 commented Aug 21, 2022

Purpose

❗ This won't work until fideslib 3.1.0 is released.

Allows logging in with a root user set in the config.

Changes

  • Bump fideslib to 3.1.0
  • Add a dependency injection for get_config
  • Add a dependency injection override for get_config
  • Add root_username and root_password to fidesops.toml
  • Add root_user_scopes to the default config

Checklist

  • Update CHANGELOG.md file
    • Merge in main so the most recent CHANGELOG.md file is being appended to
    • Add description within the Unreleased section in an appropriate category. Add a new category from the list at the top of the file if the needed one isn't already there.
    • Add a link to this PR at the end of the description with the PR number as the text. example: #1
  • Applicable documentation updated (guides, quickstart, postman collections, tutorial, fidesdemo, database diagram.
  • If docs updated (select one):
    • documentation complete, or draft/outline provided (tag docs-team to complete/review on this branch)
    • documentation issue created (tag docs-team to complete issue separately)
  • Good unit test/integration test coverage
  • This PR contains a DB migration. If checked, the reviewer should confirm with the author that the down_revision correctly references the previous migration before merging
  • The Run Unsafe PR Checks label has been applied, and checks have passed, if this PR touches any external services

Ticket

Fixes #1067

@sanders41 sanders41 marked this pull request as ready for review August 22, 2022 15:31
@sanders41 sanders41 changed the title Root user Add option to login as root user from config Aug 22, 2022
src/fidesops/ops/util/oauth_util.py Outdated Show resolved Hide resolved
@@ -128,8 +130,10 @@ def prepare_and_log_request(

app.include_router(api_router)
app.include_router(user_router, tags=["Users"], prefix=f"{V1_URL_PREFIX}")
app.dependency_overrides[lib_get_config] = get_config
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@pattisdr
Copy link
Contributor

still trying to verify locally, right now I can't login due to a 400 on the OPTIONS request http://0.0.0.0:8080/api/v1/login but this may be unrelated.

@pattisdr
Copy link
Contributor

pattisdr commented Aug 22, 2022

OK I was able to login, still getting this bg error in the UI, I'm going to switch to main and see if I can duplicate there, I don't think this would be related at first glance? You have to have privacy requests in your db.
Screen Shot 2022-08-22 at 12 35 35 PM

@sanders41 and I also discussed deprecating the superuser script which was originally created to let you make the "first user" which could then create other users, but this functionality does the same thing, without creating an actual user or client object.

@pattisdr
Copy link
Contributor

Ignore the bg error, this was something due to a new privacy request status on my local machine!

Copy link
Contributor

@pattisdr pattisdr left a comment

Choose a reason for hiding this comment

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

Thanks for removing this "create_superuser" script while you were here, it makes sense to me to just have one way to create this root user.

docs/fidesops/docs/ui/local_dev.md Outdated Show resolved Hide resolved
@pattisdr pattisdr merged commit 74717fb into main Aug 23, 2022
@pattisdr pattisdr deleted the root-user branch August 23, 2022 21:53
sanders41 added a commit that referenced this pull request Sep 22, 2022
Co-authored-by: Paul Sanders <pau@ethyca.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow creating a default “root” user via configuration variables
3 participants