Skip to content
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

Merged
merged 6 commits into from
Sep 30, 2021
Merged

Conversation

metlos
Copy link
Contributor

@metlos metlos commented Sep 23, 2021

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:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

@metlos metlos changed the title Token validity check fix: Token validity check Sep 23, 2021
@metlos metlos requested a review from sparkoo September 23, 2021 12:20
…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>
@metlos metlos force-pushed the token-validity-check branch from bafa1d9 to 11f75dd Compare September 23, 2021 12:45
@dmytro-ndp
Copy link
Contributor

[crw-ci-test --rebuild]

@che-bot
Copy link
Contributor

che-bot commented Sep 23, 2021

✅ E2E Happy path tests succeed 🎉

See Details

Test product:

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

…thod

getCurrentUser

Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
@che-bot
Copy link
Contributor

che-bot commented Sep 24, 2021

❌ E2E Happy path tests failed ❗

See Details

Test product:

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
@che-bot
Copy link
Contributor

che-bot commented Sep 24, 2021

✅ E2E Happy path tests succeed 🎉

See Details

Test product:

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

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>
@che-bot
Copy link
Contributor

che-bot commented Sep 29, 2021

✅ E2E Happy path tests succeed 🎉

See Details

Test product:

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

@metlos metlos merged commit 697253e into eclipse-che:main Sep 30, 2021
@metlos metlos deleted the token-validity-check branch September 30, 2021 10:24
@che-bot che-bot added this to the 7.38 milestone Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants