-
Notifications
You must be signed in to change notification settings - Fork 472
✨(helm) redirecting system #1697
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
base: main
Are you sure you want to change the base?
Conversation
|
🚀 Preview will be available at https://1697-docs.ppr-docs.beta.numerique.gouv.fr/ You can use the existing account with these credentials:
You can also create a new account if you want to. Once this Pull Request is merged, the preview will be destroyed.
When clicking on "Se Connecter", the url is the production one (https://docs.numerique.gouv.fr/api/v1.0/authenticate/). If you want to go inside the preview app, here is the url: https://1697-docs.ppr-docs.beta.numerique.gouv.fr/api/v1.0/authenticate/ |
|
Size Change: -23 B (0%) Total Size: 4.14 MB
|
a458cf8 to
77adea5
Compare
59917b3 to
ab1b179
Compare
dbba4a3 to
3b0cfce
Compare
3b0cfce to
54dd83c
Compare
| nginx.ingress.kubernetes.io/configuration-snippet: | | ||
| return {{ $r.code }} {{ $to }}; |
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.
Why not using nginx.ingress.kubernetes.io/temporal-redirect annotation ? We would like to avoid usage of configuration-snippet annotation
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 agree with @lunika
You should manage the return code with the specific annotation instead of using configuration-snippet
| nginx.ingress.kubernetes.io/configuration-snippet: | | ||
| return {{ $r.code }} {{ $to }}; |
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 agree with @lunika
You should manage the return code with the specific annotation instead of using configuration-snippet
| name: {{ include "impress.frontend.fullname" $ }} | ||
| port: | ||
| number: {{ $.Values.frontend.service.port }} | ||
| --- |
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 prefer when the TLS configuration is explicit, because right now HTTPS is working thanks to other ingress.
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.
Have a look in the fixup commits if it seems ok. Feel free to improve if it needs. 🙏
54dd83c to
21f51b2
Compare
To be intercepted by ingress redirects, we need to redirect using window.location instead of using Next.js router. The Next.js router does not trigger a full page reload, so the ingress redirect logic is not executed.
Create a new Helm template for ingress redirects and update the values.yaml file accordingly. We will be able to manage ingress redirects through Helm charts easily.
f3d32c3 to
dc4f84a
Compare
5590418 to
bddada1
Compare
Add OIDC_REDIRECT_ALLOWED_HOSTS setting to dev and feature environments to properly allow Keycloak redirect callbacks after authentication.
Replace custom OIDC scopes with standard OpenID Connect scopes to fix Keycloak authentication flow. Changes: - Replace OIDC_RP_SCOPES from "openid email given_name usual_name" to "openid email profile" - Update OIDC_USERINFO_FULLNAME_FIELDS from "given_name,usual_name" to "given_name,family_name" - Add OIDC_REDIRECT_ALLOWED_HOSTS to allow Keycloak callback redirects The previous configuration used custom scopes (given_name, usual_name) that were not configured in Keycloak, causing authentication to fail with "invalid_scope" error. Using the standard "profile" scope includes all necessary user claims (given_name, family_name, etc.) and works with default Keycloak configuration. This fixes the issue where users were redirected to /home after authentication instead of staying logged in, because the OIDC flow was failing and session cookies were not being set properly.
bddada1 to
e9ef806
Compare
| nginx.ingress.kubernetes.io/proxy-send-timeout: "86400" | ||
| nginx.ingress.kubernetes.io/upstream-hash-by: $arg_room | ||
|
|
||
| ingressRedirects: |
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.
You have to add the documentation before thisblock (take a look at the other) and then run
$ cd src/helm/impress
$ ./generate-readme.sh

Purpose
We want to replace the
LaSuiteDocs landing page (https://docs.numerique.gouv.fr/home/) by the new one (https://lasuite.numerique.gouv.fr/produits/docs).We will redirect to it if the app targets
/home/page.To target only our instance it will be configurable thanks to the helm charts.
How to use
In your
env.dfolder set theingressRedirectsas you want, it can be a array of redirections, redirecting with a special code (default code 301):example:
./src/helm/env.d/feature/values.impress.yaml.gotmpl