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

feat: Add Device Authentication flow support #260

Merged
merged 5 commits into from
Oct 27, 2023
Merged

Conversation

RomanNikitenko
Copy link
Contributor

@RomanNikitenko RomanNikitenko commented Jul 24, 2023

What does this PR do?

device.auth.mp4
  • Adds a logger to the Eclipse Che API and Che Github Authentication extensions, so logs are available in the corresponding channels of the Output view
image

What issues does this PR fix?

eclipse-che/che#22139

How to test this PR?

Use case 1 - an extension authorization

  • Start a workspace
  • Install an extension for testing that requires Device Authentication flow for authorization
  • F1 => Device Authentication => follow the flow
  • Reload the window to clean up cached sessions
  • Sign In
  • Try to use the extension

Use case 2 - Git related operations should work correctly when a Device Authentication token is used

  • Steps from the use case 1
  • F1 => Git Clone => follow the flow
  • check that a project is cloned successfully

Use case 3 - Git related operations should work correctly after removing a Device Authentication token

  • Steps from the use case 1
  • F1 => Github: Remove Device Authentication Token
  • Click the button Accounts on the left panel => Github Sign Out
  • Try to test use case 2 - the Git Clone command should work correctly, using a token from the .git-credential/credentials file (if it's present)

Use case 4 - the changes should fix Error: Invalid character in header content problem when there are few tokens

  • Create a workspace from the gitlab repo - the gitlab token should be added to the .git-credential/credentials file
  • Stop the workspace ^.
  • Create a workspace from the github repo - the github token should be added to the .git-credential/credentials file
  • Check that .git-credential/credentials file contains both tokens
  • F1 => Git Clone => follow the flow
  • check that a project is cloned successfully
  • so, the following issue should be fixed Error: Invalid character in header content ["Authorization"] when sign in using GitHub eclipse-che/che#22433

Use case 5 - Device Authentication flow can be used for authentication when there is no git-credential secrets/tokens

  • Delete all git-credential secrets
  • Start a workspace without authentication on the Github at the starting workspace step
  • Check that the .git-credential/credentials file is empty
  • F1 => Git Clone => follow the flow => you should get an error - there is no token
  • F1 => Device Authentication => follow the flow
  • Try to use F1 => Git Clone again - now the Github Service should use Device Authentication token and the operation should be completed successfully

@github-actions
Copy link

github-actions bot commented Jul 24, 2023

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

@RomanNikitenko RomanNikitenko changed the title Add Device Activation flow support Add Device Authentication flow support Aug 12, 2023
@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

4 similar comments
@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

1 similar comment
@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

2 similar comments
@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-260-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-260-dev-amd64

@RomanNikitenko RomanNikitenko marked this pull request as ready for review October 26, 2023 08:00
@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

Build 3.11 :: sync-to-downstream_3.x/5110: SUCCESS

Build container: devspaces-operator-bundle synced; /DS_CI/get-sources-rhpkg-container-build_3.x/4958 triggered; /job/DS_CI/job/dsc_3.x triggered;

@devstudio-release
Copy link

Build 3.11 :: operator-bundle_3.x/2228: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/5110 triggered

@devstudio-release
Copy link

Build 3.11 :: copyIIBsToQuay/2021: Console, Changes, Git Data

@devstudio-release
Copy link

Build 3.11 :: update-digests_3.x/4716: SUCCESS

Detected new images: rebuild operator-bundle
* devfileregistry; /DS_CI/operator-bundle_3.x/2228 triggered

@devstudio-release
Copy link

Build 3.11 :: dsc_3.x/1494: Console, Changes, Git Data

@RomanNikitenko
Copy link
Contributor Author

Did you forget to regen yarn.lock? Or do we need to use a newer version of node than v18.15.0 ?

I see such error from time to time and usually restarting of build helps.

@devstudio-release
Copy link

Build 3.11 :: code_3.x/965: Console, Changes, Git Data

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

Build 3.11 :: code_3.x/965: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/5124 triggered

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

Build 3.11 :: copyIIBsToQuay/2029: Console, Changes, Git Data

@devstudio-release
Copy link

Build 3.11 :: sync-to-downstream_3.x/5128: SUCCESS

Build container: devspaces-operator-bundle synced; /DS_CI/get-sources-rhpkg-container-build_3.x/4978 triggered; /job/DS_CI/job/dsc_3.x triggered;

@devstudio-release
Copy link

Build 3.11 :: operator-bundle_3.x/2233: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/5128 triggered

@devstudio-release
Copy link

Build 3.11 :: dsc_3.x/1499: Console, Changes, Git Data

@devstudio-release
Copy link

Build 3.11 :: update-digests_3.x/4738: SUCCESS

Detected new images: rebuild operator-bundle
* code; /DS_CI/operator-bundle_3.x/2233 triggered

@devstudio-release
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants