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

Support disabling Auth0 #967

Merged
merged 19 commits into from
Jul 25, 2023
Merged

Support disabling Auth0 #967

merged 19 commits into from
Jul 25, 2023

Conversation

binh-dam-ibigroup
Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup commented Jul 12, 2023

Checklist

  • Appropriate branch selected (all PRs must first be merged to dev before they can be merged to master)
  • Any modified or new methods or classes have helpful JSDoc and code is thoroughly commented
  • The description lists all applicable issues this PR seeks to resolve
  • The description lists any configuration setting(s) that differ from the default settings
  • All tests and CI builds passing

Description

This PR allows running the datatools UI without having to log in using Auth0.
When Auth0 is disabled:

  • A single admin user is created and is the only user available.
  • No user management, account management or feed activity watching are available.

The PR is based on https://github.com/ibi-group/datatools-ui/tree/auth-disable but simplifies the permission checks by creating an admin user on loading.

Rough edges caused by not knowing what panes will be available until after a few render passes - I think that can be addressed in a subsequent PR:

  • The users page in the Admin section is blank.
  • The profile page in the Account section is blank.

To disable Auth0, insert a line with DISABLE_AUTH: true in env.yml for both frontend and backend configurations.
No other changes are needed on the backend.

This PR might address #962.

Copy link
Contributor

@miles-grant-ibigroup miles-grant-ibigroup 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 cleaning this up! Much better approach than mine. I've tested thoroughly and everything works fantastic! Excited for what this will allow for the project

Copy link
Contributor

@amy-corson-ibigroup amy-corson-ibigroup left a comment

Choose a reason for hiding this comment

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

Very cool fix! Works great for me locally. Just a couple questions.

'user'
]
},
// FIXME: pick a better email address for both backend and frontend.
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you looking for a real email address here or just a different fake/placeholder one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably a different one. This email address appears in the Notes section of each feed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be worth it to add a status message in this pane if AUTH0_DISABLED is true, that says something along the lines of "You're running datatools without user authentication enabled. Features such as user management, account management and feed activity watching are unavailable"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

The homepage might be a better place? Could add a warning above the recent activity section?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the message to the home page, above Recent Activity (969af57)

@binh-dam-ibigroup binh-dam-ibigroup merged commit d8826a7 into dev Jul 25, 2023
5 checks passed
@binh-dam-ibigroup binh-dam-ibigroup deleted the auth-disable-qbd branch July 25, 2023 16:51
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