-
Notifications
You must be signed in to change notification settings - Fork 44
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
gateway: add an authenticating reverse proxy #4876
Conversation
e752721
to
fb47cd1
Compare
ca804fb
to
dd2d73c
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev #4876 +/- ##
============================================
- Coverage 19.58% 19.46% -0.12%
Complexity 2326 2326
============================================
Files 886 907 +21
Lines 106098 106817 +719
Branches 2576 2579 +3
============================================
+ Hits 20777 20796 +19
- Misses 83812 84509 +697
- Partials 1509 1512 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Here is an intermediate review.
ea49934
to
037d31d
Compare
9f8c6a1
to
93221a0
Compare
d89cb9d
to
7a8ed49
Compare
7a8ed49
to
04ebbb9
Compare
334ad70
to
05fe267
Compare
4b9fcd9
to
3d41e4d
Compare
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.
We should add a |
7fa74d2
to
cab9177
Compare
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.
Very impressive PR. Thanks!
Note: Reviewed and tested with different config files on NixOS.
3c5a098
to
457916e
Compare
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.
Reviewed all the code in /front, I still need to test but it will wait till Monday :) Left 2 small comments !
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.
gateway timeout results in 500. 5s should ne be enough for multiple configurations
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.
LGTM, tested in local (with docker and with the front+gateway+editoast in local) ✅
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 tested it while running all services locally, the proxy works fine !
When running with the mock auth provider, I can't logout from the front however, I get [2023-11-14T16:48:50Z WARN actix_proxy] proxy: error forwarding request: authentication required
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.
Tested on mac arm using Safari and Chrome, both locally and with docker.
e155a35
to
5e93dd9
Compare
Before this change, we relied on an authenticating reverse proxy called gateway. It's been in use since the inception of the project, as part of a package of services we got from SNCF Réseau. The front-end was responsible for authenticating with keycloak, and providing a Bearer token for the reverse proxy to check. This change introduces an authenticating reverse proxy, which replaces the previous gateway. The front-end now entirely delegates authentication to the backend. On startup, gateway/auth/login is called, which either returns an username if the client is authenticated, or a redirection URL if the user needs to log in. There are three authentication backends supported by the new gateway: - A default mock backend, which return all users to be authentificated with the same username - An OpenID Connect backend, which is used to authenticate interactive users. The application does not support session refresh, and does not forward logout events to the identity provider. - A static Bearer token backend, which is not meant to be used by interactive users This change also introduces unstable builds, which are pushed to ghcr.io. Co-Authored-By: Valentin Chanas <[email protected]> Co-Authored-By: =?UTF-8?q?=C3=89lys=C3=A6?= <[email protected]>
5e93dd9
to
727b03f
Compare
Before this change, we relied on an authenticating reverse proxy called gateway. It's been in use since the inception of the project, as part of a package of services we got from SNCF Réseau.
The front-end was responsible for authenticating with keycloak, and providing a Bearer token for the reverse proxy to check.
This change introduces an authenticating reverse proxy, which replaces the previous gateway.
The front-end now entirely delegates authentication to the backend.
On startup,
gateway/auth/login
is called, which either returns an usernameif the client is authenticated, or a redirection URL if the user needs to log in.
There are three authentication backends supported by the new gateway:
username
The application does not support session refresh, and does not forward logout events to the
identity provider.
Fixes #1524
Fixes #2349
Fixes #5339