Skip to content

Remove an old authorization flow with Keycloak - #524

Merged
olexii4 merged 5 commits into
mainfrom
unauthorized_error
May 16, 2022
Merged

olexii4 merged 5 commits into
mainfrom
unauthorized_error

Conversation

@olexii4

@olexii4 olexii4 commented May 11, 2022 •

Copy link
Copy Markdown
Contributor

Signed-off-by: Oleksii Orel [email protected]

What does this PR do?

Remove an old authorization flow with Keycloak.

What issues does this PR fix or reference?

fixes https://issues.redhat.com/browse/CRW-2875
fixes eclipse-che/che#21376
fixes eclipse-che/che#21289

Is it tested? How?

It could be tested by deploying Eclipse Che on OpenShift.

  1. Deploy Che.
chectl server:deploy \
    --installer=operator \
    --platform=openshift \
    --che-operator-cr-patch-yaml=./custom.yaml

File custom.yaml

spec:
  server:
    dashboardImage: quay.io/eclipse/che-dashboard:pr-524
  1. Configure 5 minutes timeout in OCP cluster settings
oc patch OAuth/cluster -p '{ "spec": { "tokenConfig": { "accessTokenInactivityTimeout": "5m" }}}' --type merge
  1. Go to the Dashboard page and login into as an OpenShift user.

  2. Wait 5 minutes on OpenShift login session to be expired.

  3. Go to the Dashboard page again and refresh it.

  4. Dashboard should redirect to OCP OAuth page.

@openshift-ci

openshift-ci Bot commented May 11, 2022

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@che-bot

che-bot commented May 11, 2022

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@codecov

codecov Bot commented May 11, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #524 (6fc78d0) into main (b16d601) will increase coverage by 0.66%.
The diff coverage is 20.75%.

@@            Coverage Diff             @@
##             main     #524      +/-   ##
==========================================
+ Coverage   54.66%   55.32%   +0.66%     
==========================================
  Files         235      233       -2     
  Lines        8088     7933     -155     
  Branches     1393     1373      -20     
==========================================
- Hits         4421     4389      -32     
+ Misses       3448     3326     -122     
+ Partials      219      218       -1     
Flag Coverage Δ
unittests 55.32% <20.75%> (+0.66%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/dashboard-frontend/src/Layout/index.tsx 0.00% <0.00%> (ø)
...rd-frontend/src/containers/FactoryLoader/index.tsx 81.35% <ø> (+0.29%) ⬆️
...dashboard-frontend/src/services/bootstrap/index.ts 0.00% <ø> (ø)
...rvices/dashboard-backend-client/websocketClient.ts 18.18% <ø> (-0.57%) ⬇️
...ges/dashboard-frontend/src/store/Branding/index.ts 0.00% <0.00%> (ø)
...ontend/src/store/Workspaces/cheWorkspaces/index.ts 10.75% <ø> (-1.05%) ⬇️
...rd-frontend/src/services/workspace-client/index.ts 25.00% <17.24%> (-15.75%) ⬇️
...orkspace-client/cheworkspace/cheWorkspaceClient.ts 59.37% <50.00%> (+1.48%) ⬆️
...rontend/src/Layout/Header/Tools/UserMenu/index.tsx 77.96% <100.00%> (+5.50%) ⬆️
...dashboard-frontend/src/pages/UserAccount/index.tsx 95.00% <100.00%> (+16.42%) ⬆️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b16d601...6fc78d0. Read the comment docs.

@github-actions

Copy link
Copy Markdown
Contributor

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-524

@che-bot

che-bot commented May 12, 2022

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@github-actions

Copy link
Copy Markdown
Contributor

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-524

@olexii4
olexii4 marked this pull request as ready for review May 12, 2022 15:36
@olexii4
olexii4 requested a review from akurinnoy as a code owner May 12, 2022 15:36
@olexii4
olexii4 requested a review from ibuziuk May 12, 2022 15:37
@che-bot

che-bot commented May 12, 2022

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@olexii4
olexii4 force-pushed the unauthorized_error branch from cb4fda7 to 0baf85f Compare May 12, 2022 22:26
@che-bot

che-bot commented May 12, 2022

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

1 similar comment
@che-bot

che-bot commented May 12, 2022

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@olexii4
olexii4 force-pushed the unauthorized_error branch from 2861177 to a2197df Compare May 12, 2022 22:51
@che-bot

che-bot commented May 12, 2022

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

1 similar comment
@che-bot

che-bot commented May 13, 2022

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

Signed-off-by: Oleksii Orel <[email protected]>
@olexii4
olexii4 force-pushed the unauthorized_error branch from a374a63 to 99c8ca4 Compare May 13, 2022 11:48
@che-bot

che-bot commented May 13, 2022

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@ibuziuk ibuziuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olexii4 thanks for the fix, however I was not able to verify against dogfooding 🤷

ERROR in ./src/index.ts
Module not found: Error: Can't resolve './api/kubeConfigAPI' in '/home/ibuziuk/git/che-dashboard/packages/dashboard-backend/src'
 @ ./src/index.ts 33:24-54

@che-bot

che-bot commented May 13, 2022

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@olexii4

olexii4 commented May 13, 2022 •

Copy link
Copy Markdown
Contributor Author

@olexii4 thanks for the fix, however, I was not able to verify against dogfooding 🤷

ERROR in ./src/index.ts
Module not found: Error: Can't resolve './api/kubeConfigAPI' in '/home/ibuziuk/git/che-dashboard/packages/dashboard-backend/src'
 @ ./src/index.ts 33:24-54

@ibuziuk I have fixed it.

@github-actions

Copy link
Copy Markdown
Contributor

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-524

@olexii4
olexii4 force-pushed the unauthorized_error branch from 536a4c1 to cfef2a3 Compare May 13, 2022 12:41
@che-bot

che-bot commented May 13, 2022

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@olexii4
olexii4 force-pushed the unauthorized_error branch from cfef2a3 to 46dc722 Compare May 13, 2022 12:47
@che-bot

che-bot commented May 13, 2022

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@olexii4
olexii4 force-pushed the unauthorized_error branch from dc6856d to 9115654 Compare May 13, 2022 19:41
@che-bot

che-bot commented May 13, 2022

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@olexii4

olexii4 commented May 13, 2022 •

Copy link
Copy Markdown
Contributor Author

@olexii4 thanks, but still does not work for me against dogfooding - the UD has been started but the loader is shown forever when accessing 8000:

Static server's serving "/home/ibuziuk/git/che-dashboard/packages/dashboard-frontend/lib/public" on 0.0.0.0:8080/
Che Dashboard swagger is running on "dashboard/api/swagger".
├── * (OPTIONS)
└── / (-)
    ├── * (HEAD, GET)
    ├── api (-)
    │   ├── / (DELETE, GET, HEAD, PATCH, POST, PUT, OPTIONS)
    │   │   └── / (DELETE, GET, HEAD, PATCH, POST, PUT, OPTIONS)
    │   ├── /* (DELETE, GET, HEAD, PATCH, POST, PUT, OPTIONS)
    │   └── /websocket (GET)
    ├── dashboard (-)
    │   ├── /api (-)
    │   │   ├── /cluster-config (GET)
    │   │   ├── /cluster-info (GET)
    │   │   ├── /namespace/:namespace (-)
    │   │   │   ├── /devworkspaceId/:devworkspaceId/kubeconfig (POST)
    │   │   │   ├── /devworkspaces (POST, GET)
    │   │   │   │   └── /:workspaceName (PATCH, GET, DELETE)
    │   │   │   ├── /devworkspacetemplates (POST, GET)
    │   │   │   │   └── /:templateName (PATCH)
    │   │   │   └── /dockerconfig (PUT, GET)
    │   │   ├── /server-config/default-plugins (GET)
    │   │   ├── /swagger (GET)
    │   │   │   ├── / (GET)
    │   │   │   ├── /* (GET)
    │   │   │   ├── /initOAuth (GET)
    │   │   │   ├── /json (GET)
    │   │   │   ├── /static/* (HEAD, GET)
    │   │   │   ├── /uiConfig (GET)
    │   │   │   └── /yaml (GET)
    │   │   └── /websocket (GET)
    │   └── /f (GET)
    └── f (GET)

(node:14866) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Server listening at http://localhost:8080/

There are no errors in the logs 🤷

image

@ibuziuk Please, try the latest version. I successfully tested it with the latest changes(OpenShift).
I am using the next docker image: docker.io/olexii4dockerid/che-dashboard:keycloakNew

Note: It works differently in the case with local development flow because we are using a different OAuth client for local development.

@github-actions

Copy link
Copy Markdown
Contributor

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-524

Signed-off-by: Oleksii Orel <[email protected]>
@che-bot

che-bot commented May 15, 2022

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@github-actions

Copy link
Copy Markdown
Contributor

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-524

@openshift-ci

openshift-ci Bot commented May 15, 2022

Copy link
Copy Markdown

@olexii4: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v8-dashboard-happy-path faf045c link true /test v8-dashboard-happy-path

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@ibuziuk ibuziuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olexii4 thanks for update, however now there is a different situation when I run the UD locally against dogfooding locally all works fine, but the remote is not loading anymore and failing with 403:

image

@ibuziuk

ibuziuk commented May 16, 2022

Copy link
Copy Markdown
Member

also on logout locally I got the following error:

{"message":"Route GET:/oauth/sign_out not found","error":"Not Found","statusCode":404}

@ibuziuk

ibuziuk commented May 16, 2022

Copy link
Copy Markdown
Member

@olexii4 once merged could you please cherry-pick to 7.46.x

@akurinnoy akurinnoy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openshift-ci

openshift-ci Bot commented May 16, 2022

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: akurinnoy, ibuziuk, olexii4

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot removed the lgtm label May 16, 2022
@openshift-ci

openshift-ci Bot commented May 16, 2022

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@che-bot

che-bot commented May 16, 2022

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@github-actions

Copy link
Copy Markdown
Contributor

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-524

@olexii4
olexii4 merged commit 073c0be into main May 16, 2022
@olexii4
olexii4 deleted the unauthorized_error branch May 16, 2022 11:19
olexii4 added a commit that referenced this pull request May 16, 2022
* fix: remove an old authorization flow with Keycloak

Signed-off-by: Oleksii Orel <[email protected]>

* fix: Code refactoring

Signed-off-by: Oleksii Orel <[email protected]>

* fix: update dependencies list

Signed-off-by: Oleksii Orel <[email protected]>
@che-bot che-bot added this to the 7.48 milestone May 16, 2022
olexii4 added a commit that referenced this pull request May 16, 2022
* fix: remove an old authorization flow with Keycloak

Signed-off-by: Oleksii Orel <[email protected]>

* fix: Code refactoring

Signed-off-by: Oleksii Orel <[email protected]>

* fix: update dependencies list

Signed-off-by: Oleksii Orel <[email protected]>
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.

JWT token is not refreshing Eclipse Che Dashboard is not showing with error OPTIONS request to "/api/" failed, reason: "500 ".

4 participants