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

Authentication Plugin API fixes #8725

Merged
merged 1 commit into from
Nov 12, 2020
Merged

Authentication Plugin API fixes #8725

merged 1 commit into from
Nov 12, 2020

Conversation

vinokurig
Copy link
Contributor

What it does

  • Do not add a sign out menu if a session from given authentication provider is already exists in the authentication menu.
  • Fix a bug of duplicating new session requests if more then one authentication session is present.
  • Fix the sign out message if an authentication session is not stored in the account usages

How to test

  1. Remove "@theia/git": "^1.5.0" from examples/browser/package.json file.
  2. Download vscode-git-1.49.3 and copy it to the plugins folder.
  3. Download vscode built-in github plugin and copy it to the plugins folder.
  4. Download vscode GitHub Pull request plugin and copy it to the plugins folder.
  5. Apply GitHub authentication provider:
  1. Start Theia and check the accounts menu:
    screenshot-serverg0cevid1-che-dev-server-3010 192 168 99 253 nip io-2020 09 23-11_42_23
  2. Run Publish to GitHub command and allow the authentication session:
    screenshot-localhost_3000-2020 11 06-12_41_49
  3. Check the accounts menu:
    screenshot-localhost_3000-2020 11 06-12_43_31
  4. Sign in the GitHub Pull Requests plugin:
    screenshot-newtab-2020 11 06-13_01_45
  5. Check the accounts menu and click the sign out item:
    screenshot-localhost_3000-2020 11 06-13_03_24
  6. See the notification:
    screenshot-localhost_3000-2020 11 06-13_05_29
  7. Click Yes and check the accounts menu, it must reset to the initial state:
    screenshot-serverg0cevid1-che-dev-server-3010 192 168 99 253 nip io-2020 09 23-11_42_23

Review checklist

Reminder for reviewers

@vinokurig vinokurig added plug-in system issues related to the plug-in system Team: Che-Plugins issues related to the che-plugins team vscode issues related to VSCode compatibility labels Nov 6, 2020
Copy link
Contributor

@RomanNikitenko RomanNikitenko left a comment

Choose a reason for hiding this comment

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

Tested the changes - it works as described in the PR description:

github_auth

@RomanNikitenko
Copy link
Contributor

btw: where it should be handled if a token is not valid?
I revoked my token to test such case:

revoke_token

bad_credentials

Maybe some notification should be displayed for user...
Is it responsibility of VS Code plugin or should be handled on Theia side?

@vinokurig
Copy link
Contributor Author

@RomanNikitenko
Thank you for your review. This use-case is handled by authentication provider which is registered in the GitHub authentication plugin. This is a demo plugin for theia, in Che-theia we have our own GitHub authentication provider plugin which is using Che oAuth API to retrieve tokens, instead of manually generating a token in GitHub. So even if we revoke the Che oAuth application in GitHub, the token would be stored in keycloak and would be valid for the GitHub plugins.

Copy link
Member

@azatsarynnyy azatsarynnyy left a comment

Choose a reason for hiding this comment

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

What the command Publish to GitHub does? Publish the repository? I can't find where it's contributed from.

BTW, after executing Publish to GitHub command, there's always running "Activating ..." message

Peek 2020-11-11 12-12

Is it expected?

@vinokurig
Copy link
Contributor Author

@azatsarynnyy

What the command Publish to GitHub does? Publish the repository? I can't find where it's contributed from.

Publish to GitHub comes from github built-in vscode extension and it creates a repository from the workspace folder, see https://stackoverflow.com/questions/46877667/how-to-add-a-new-project-to-github-using-vs-code

BTW, after executing Publish to GitHub command, there's always running "Activating ..." message

It is expected, to make the GitHub Pull Requests plugin work you need to authenticate it separately, see item 9 of the How to test section.

Copy link
Member

@azatsarynnyy azatsarynnyy left a comment

Choose a reason for hiding this comment

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

Thanks for the explanation @vinokurig
Everything works as described.

@vinokurig vinokurig merged commit a64e9d2 into master Nov 12, 2020
@vinokurig vinokurig deleted the che-18227 branch November 12, 2020 09:11
@github-actions github-actions bot added this to the 1.8.0 milestone Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plug-in system issues related to the plug-in system Team: Che-Plugins issues related to the che-plugins team vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants