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 admin panel option to enable/disable SSO only mode #740

Merged
merged 5 commits into from
May 4, 2024

Conversation

e-five256
Copy link
Member

@e-five256 e-five256 commented Apr 29, 2024

This add a new admin panel option to enable/disable SSO only mode, which was previously only able to be done via modifying the .env file

image

Because it already exists as an environment var, we should be able to use it to populate the value in the settings DTO safely (this differs from previous settings where I've said we trend away from declaring new env vars, everyone should already have this one even if it's just SSO_ONLY_MODE=)

So the hope is for those that run with SSO_ONLY_MODE=true, this should populate to the DB correctly and already default to true

(This doesn't seem to be working currently, the code reads like it should default to the env var, and sometimes I'll have the DB setting put into my DB, but other times I don't. I have yet to see it enter the DB as true, so that makes this risky for people running with SSO only mode currently enabled. Not sure if there's a great way out of this situation, maybe a migration that automatically inserts it to the settings table if that's possible)

It does seem to work, but it feels kind of flaky. Right now I don't have the setting in my DB, rebuilt as SSO_ONLY_MODE=true in .env, and it correctly shows the admin panel as checked. So I think it is working, but maybe is worth noting for people that it's worth double checking the setting was saved if this change is pulled in


This is partly being done as I believe admins should be able to run their instance from the UI, of course, but also to make it easier to grab this setting as I need it in multiple components for #706 as I started to run into the limit of what I could do with SASS doing things like has child/sibling selectors based on whether a form appears on the page at all, it'd be easier to just only add things based on whether the site is in SSO only or not

@e-five256 e-five256 added the enhancement New feature or request label Apr 29, 2024
@e-five256 e-five256 marked this pull request as ready for review April 29, 2024 22:51
@e-five256 e-five256 merged commit f517e4a into main May 4, 2024
7 checks passed
@e-five256 e-five256 deleted the e5/admin-sso-only branch May 4, 2024 12:08
@e-five256 e-five256 added the sso Single-sign-on issues or pull requests label May 4, 2024
@e-five256
Copy link
Member Author

@WebVoid @thepaperpilot heads up on this new admin setting as I believe you two are running in SSO only mode. In my testing the only time it was a bit odd was when I was constantly flipping between the env var SSO_ONLY_MODE false / true. But then I launched with true and a clean DB it did correctly only set to SSO only mode with no fields in the DB, so I don't believe there should be any problems getting this change (that is, it should stay SSO only mode even without setting it in the admin panel as long as that's what the env var says). Still might be worth watching out for though, just in case I did make a mistake in my testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sso Single-sign-on issues or pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant