-
Notifications
You must be signed in to change notification settings - Fork 19
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: toggle oidc login via settings #4588
Conversation
- Keep state in settings ( like the other settings) - only check props once ( on system start ) - always include isOidcEnabled setting on settings request
...lgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlDatabaseFieldFactory.java
Outdated
Show resolved
Hide resolved
backend/molgenis-emx2-sql/src/main/java/org/molgenis/emx2/sql/SqlDatabase.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code and approach looks okay. But how to test?
...lgenis-emx2-graphql/src/main/java/org/molgenis/emx2/graphql/GraphqlDatabaseFieldFactory.java
Outdated
Show resolved
Hide resolved
this.isOidcEnabled = Boolean.parseBoolean(isOidcEnabledSetting); | ||
} else { | ||
Object envSetting = | ||
EnvironmentProperty.getParameter(Constants.MOLGENIS_OIDC_CLIENT_ID, null, STRING); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should at some point have some way to find out about oidc errors but this is probably not the way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always getting the oidc enabled via settings looks fine, but don't we want a check to see if the settings are complete before enabling it?
if (!this.isOidcEnabled) return; | ||
|
||
// check if OIDC settings are complete otherwise log error and set to false | ||
if (!isValidOidcSettings()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we don't check if OIDC settings are complete, when enabled? This is fine by me, but I made it because it was requested
@mswertz @harmbrugge this is a cross service feature, i suggest to keep the setting part as simple ( and stateless ) as possible. The combination of oo programming, globals via statics and caching makes it hard to track the state. We can extend the ci setup to test the config code ( enabling and disabling the oidc login) ( other pr ) , a service check would need some polling ( e2e on prod setup ) per service instance , we do not have a setup for this. |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locally tested:
isOidcEnabled = false:
- apps/central => SignUp, SignIn buttons
- schema level => SignUp, SignIn buttons
isOidcEnabled = true:
- apps/central => only SignIn button
- schema level => only SignIn button
What are the main changes you did
Closes #4587
How to test
Checklist