feat: Allow multiple extenal URLs for SSO access#14208
feat: Allow multiple extenal URLs for SSO access#14208tjamet wants to merge 10 commits intoargoproj:masterfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #14208 +/- ##
==========================================
- Coverage 49.89% 49.88% -0.01%
==========================================
Files 263 263
Lines 45219 45254 +35
==========================================
+ Hits 22563 22577 +14
- Misses 20439 20460 +21
Partials 2217 2217 ☔ View full report in Codecov by Sentry. |
|
Alternatively, we can make the configuration field be |
|
This is very useful PR @tjamet 👍 |
|
+1 for using |
|
Any progress on this PR. We could really use this feature. |
|
Hi! I will post a reminder in the CNCF slack in a few days. |
With argoproj#4780, were introduced security measures to ensure the `return_url` is pointing to the current ArgoCD instance. In several occasions, an ArgoCD isntance could be exposed through multiple network connections. Internal addresses and restricted public addresses. Currently, a single base URL can be configured in the the argocd configmap, preventing from exposing ArgoCD on several access paths. This change allows to define multiple hosts on which ArgoCD can be exposed, keeping backward compatibility by adding a field `additionalUrls` accepting a list of additional URLS on which argoCD can be exposed Fixes argoproj#5388 Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
codeql restricts logging fields from user input. Remove log to avoid complex escapes Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Currently, the documented configmap is invalid and raises error at the time of applying it. Ensure the configmap is valid with a unit test Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
With HTTP servers, the `url` field of `http.Requests` does not contain the host nor the protocol. To work around this, consider `request.Host` and `request.URL.RequestURI()` Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Currently, while login is correctly handled, when logging out from an alternate URL, we are redirected to the main URL. Fix this by applying the same principles as for the login part Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
|
@trc-ikeskin I have pushed a build of this branch on my github container registry, if you want to take a look and provide feedback: It is built from tjamet/master that has an additional commit to allow this build |
|
Can we merge this, please? |
|
@BulatSaif I guess if you want to see progress on this one you will have to do some actual testing on the feature. Unfortunately we had to move on to other customers. |
|
How can I help test this functionality to help get it merged? |
|
Also eager to see this PR merged and ready to help with any additional testing or changes needed. Please let us know how we can help! |
agaudreault
left a comment
There was a problem hiding this comment.
I think the feature should be documented in the ArgoCD https://argo-cd.readthedocs.io/en/stable/operator-manual/user-management/ documentation.
Is url deprecated? are urls valid on their own or only additional urls? Is this feature supported by all identity providers, or only by OIDC?
| } | ||
|
|
||
| func (a *ClientApp) oauth2Config(scopes []string) (*oauth2.Config, error) { | ||
| func (a *ClientApp) oauth2Config(r *http.Request, scopes []string) (*oauth2.Config, error) { |
There was a problem hiding this comment.
If only the url is necessary to find the config, pass only the URL instead of the whole request object.
| func (a *ClientApp) oauth2Config(r *http.Request, scopes []string) (*oauth2.Config, error) { | |
| func (a *ClientApp) oauth2Config(request *url.URL, scopes []string) (*oauth2.Config, error) { |
| } | ||
| if argoCDCM.Data[settingURLsKey] != "" { | ||
| if err := yaml.Unmarshal([]byte(argoCDCM.Data[settingURLsKey]), &settings.URLs); err != nil { | ||
| log.Warnf("Failed decode all UI banner URLs in configmap: %v", err) |
There was a problem hiding this comment.
The error message does not seem accurate
|
|
||
| func (a *ArgoCDSettings) IsDexConfigured() bool { | ||
| if a.URL == "" { | ||
| if a.URL == "" && len(a.URLs) == 0 { |
There was a problem hiding this comment.
Is Dex using this new URLs setting? It seems unclear if Dex should be valid if there are only URLs configured.
|
+1, this would be super useful. Happy to help add some testing/documentation if needed. |
|
Any news on that? |
|
As @tjamet does not seem active, @vinelias, @KojoRising, @avo-sepp, @tabathad you can fork @tjamet's work and submit a new PR with the require code changes, tests and answers for the questions above. |
|
@tjamet @vinelias @KojoRising @avo-sepp @tabathad: I'm going to marshal this across the finish line, if I can. New PR here: #18927 |
|
Closing in favor of #18927 |
|
Sorry, I missed the latest updates and comments on this PR |
With #4780, were introduced security measures to ensure the
return_urlis pointing to the current ArgoCD instance.In several occasions, an ArgoCD isntance could be exposed through multiple network connections. Internal addresses and restricted public addresses.
Currently, a single base URL can be configured in the the argocd configmap, preventing from exposing ArgoCD on several access paths.
This change allows to define multiple hosts on which ArgoCD can be exposed, keeping backward compatibility by adding a field
additionalUrlsaccepting a list of additional URLS on which argoCD can be exposedFixes #5388
Note on DCO:
If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.
Checklist:
Please see Contribution FAQs if you have questions about your pull-request.