fix: add support for dynamic config url#1565
Conversation
|
@akoserwal @Rajagopalan-Ranganathan I think this PR is going to solve all issues we would have and it can be merged instantly once we get ssoProviders api public into production. |
|
I actually added ability to do conditional login considering that users do not update CLI that often as we can update UI |
|
I have verified this change with mock to test all cases. |
The sso provider api is there in prod already: https://api.openshift.com/?urls.primaryName=kafka%20service%20fleet%20manager%20service#/security/getSsoProviders |
pkg/shared/hacks/temp.go
Outdated
| return true | ||
| } | ||
|
|
||
| return provider.GetBaseUrl() == "https://identity.api.redhat.com" |
There was a problem hiding this comment.
Is the https://identity.api.redhat.com the same for both environments?
@wtrocki @akoserwal
There was a problem hiding this comment.
I also think the sso url will be something like https://sso.redhat.com... and not https://identity.api.redhat.com. @akoserwal is this correct?
There was a problem hiding this comment.
Amazing question. I do not know.
There was a problem hiding this comment.
I would love to have some flag on that API.
Like useLegacyAuth: true.
While it might look like pouting API, but it would in fact make things
That will be much easier for us to pick up dynamic behaviour rather than assert urls
My ideas for that flag:
useLegacyAuth: true
usePluralAuth: true
multiSSOLogin: true
customSSO: true
There was a problem hiding this comment.
SsoProvider: MAS SSO/RED Hat SSO (Enum) could it be used?
There was a problem hiding this comment.
For this change I think it is fine because the values are not going to change e.g a rename or a removal of one etc
Extending an enum is fine and should never ever be a breaking change IMO.
There was a problem hiding this comment.
Adding a bool flag-like useLegacyAuth: true would be confusing to other clients that are consuming this end-point. I am planning to add a name: mas_sso or name: redhat_sso.
@wtrocki @Rajagopalan-Ranganathan @carlesarnal @machi1990 wdty?
There was a problem hiding this comment.
I do not have strong opinion. I need value for if statement that we can rely on in CLI and UI and this proposal meets it.
There was a problem hiding this comment.
About the name makes sense. I don't have a strong opinion about the flag, but I would like to use whatever value is returned by the sso_providers call.
There was a problem hiding this comment.
the name is absolutely fine and looks to be extensible in the future.
|
I realized that we need support for calling stage API as well - Current PR does call production only |
|
Ideally it will be good to test migration 3-4 times on stage before we go to prod with already released UI and CLI that can switch dynamically |
|
Fixed problem with not using stage/prod env. Looking to test this with real API :D |
|
LGTM! |
af096a4 to
cce629f
Compare
We are migrating to the single auth provider (removing infamous mas-sso). This PR targets to enable us to do it.
This PR:
What this does
Assumptions
Both are based on following assumptions: