-
Notifications
You must be signed in to change notification settings - Fork 73
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: Token validity check #136
Conversation
…f 500 with OpenShift OAuth the same as it is already done with Keycloak. Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
bafa1d9
to
11f75dd
Compare
[crw-ci-test --rebuild] |
✅ E2E Happy path tests succeed 🎉 See Details
Test product:
Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe |
...he/multiuser/api/authentication/commons/filter/MultiUserEnvironmentInitializationFilter.java
Outdated
Show resolved
Hide resolved
...e/workspace/infrastructure/openshift/multiuser/oauth/OpenshiftTokenInitializationFilter.java
Outdated
Show resolved
Hide resolved
...e/workspace/infrastructure/openshift/multiuser/oauth/OpenshiftTokenInitializationFilter.java
Outdated
Show resolved
Hide resolved
…thod getCurrentUser Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
❌ E2E Happy path tests failed ❗ See Details
Test product:
Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe |
Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
✅ E2E Happy path tests succeed 🎉 See Details
Test product:
Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe |
...e/workspace/infrastructure/openshift/multiuser/oauth/OpenshiftTokenInitializationFilter.java
Outdated
Show resolved
Hide resolved
...he/multiuser/api/authentication/commons/filter/MultiUserEnvironmentInitializationFilter.java
Outdated
Show resolved
Hide resolved
...he/multiuser/api/authentication/commons/filter/MultiUserEnvironmentInitializationFilter.java
Show resolved
Hide resolved
It should not return null under normal operation, but I'm not sure about the abnormal operation :) Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
raw token in any implementation, so let's remove it from the method sig. Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
✅ E2E Happy path tests succeed 🎉 See Details
Test product:
Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe |
What does this PR do?
This changes the HTTP status code from 500 to 401 when we encounter an invalid token in an authenticated request while using the native user mode on OpenShift.
The implemented fix slightly refactors the way the user information is processed from the token such that it is processed just once.
Note that this is only a partial fix for the issue eclipse-che/che#20304. We also need changes in the che-gateway (deployed by the che-operator) for this to be bullet-proof and caught as early as possible.
Screenshot/screencast of this PR
N/A
What issues does this PR fix or reference?
eclipse-che/che#20304
How to test this PR?
Follow the instructions in the issue eclipse-che/che#20304. The HTTP status code of the response should now be 401.
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.