eclipse-che / che-theia

Eclipse Public License 2.0
125 stars 111 forks source link

chore: Rework GitHub authentication flow #1293

Closed vinokurig closed 2 years ago

vinokurig commented 2 years ago

Signed-off-by: Igor Vinokur ivinokur@redhat.com

What does this PR do?

Exclude che-server requests from the GitHub authentication flow, instead read credentials file, mounted from the github-credentials-secret and extract the GitHub token.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

fixes https://github.com/eclipse/che/issues/20995 fixes https://github.com/eclipse/che/issues/20788

How to test this PR?

  1. Make sure that the GitHub is configured: https://www.eclipse.org/che/docs/next/administration-guide/configuring-authorization/#enabling-authentication-with-social-accounts-and-brokering_che
  2. Create a factory with a private repo e.g. <che-url>/#https://github.com/vinokurig/test-extension/tree/devfile2 to authenticate GitHub for the user namespace.
  3. Run Git: Clone and input a git url to a private repo e.g. https://github.com/vinokurig/test-extension.git: screenshot-192 168 64 128 nip io-2022 01 17-13_37_02
  4. Choose a folder to clone and click `Allow' button in the notification: screenshot-192 168 64 128 nip io-2022 01 17-13_37_44

    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.

Happy Path Channel

HAPPY_PATH_CHANNEL=stable

vinokurig commented 2 years ago

depends on https://github.com/eclipse/che/issues/21025

codecov[bot] commented 2 years ago

Codecov Report

Merging #1293 (e471754) into main (c299f59) will increase coverage by 3.50%. The diff coverage is 42.43%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1293      +/-   ##
==========================================
+ Coverage   32.78%   36.29%   +3.50%     
==========================================
  Files         290      325      +35     
  Lines        9885    10600     +715     
  Branches     1457     1432      -25     
==========================================
+ Hits         3241     3847     +606     
- Misses       6641     6748     +107     
- Partials        3        5       +2     
Impacted Files Coverage Δ
...theia-about/src/browser/about-che-theia-dialog.tsx 0.00% <0.00%> (ø)
...credentials/src/browser/che-credentials-service.ts 0.00% <0.00%> (ø)
...entials/src/browser/credentials-frontend-module.ts 0.00% <0.00%> (ø)
...eia-credentials/src/common/credentials-protocol.ts 0.00% <0.00%> (ø)
...eia-credentials/src/node/che-credentials-server.ts 0.00% <0.00%> (ø)
...s/src/node/che-theia-credentials-backend-module.ts 0.00% <0.00%> (ø)
...ashboard/src/browser/che-theia-dashboard-module.ts 0.00% <0.00%> (ø)
...ia-dashboard/src/browser/theia-dashboard-client.ts 0.00% <0.00%> (ø)
...rowser/src/browser/che-mini-browser-environment.ts 0.00% <0.00%> (ø)
...in-ext/src/browser/che-sidecar-file-system-main.ts 100.00% <ø> (ø)
... and 293 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 9c6d63b...e471754. Read the comment docs.