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: create new GitHub Authentication Provider extension #5400
base: main
Are you sure you want to change the base?
feat: create new GitHub Authentication Provider extension #5400
Conversation
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
@benoitf The SonarCloud is giving an error for the build.js script located in the build folder for the extension created, it is a copy/past of the script used in the other extension, any clue ? |
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
@axel7083 we need to review in SonarCloud UI the issues and we can flag them as 'safe' (which is the case there) I've applied the change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- There is not need for global var to store disposable, just use extensionContext.subscriptions
- Refactoring for king and compose should be in additional PR.
Co-authored-by: Denis Golovin <dgolovin@users.noreply.github.com> Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Co-authored-by: Denis Golovin <dgolovin@users.noreply.github.com> Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Co-authored-by: Denis Golovin <dgolovin@users.noreply.github.com> Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Co-authored-by: Denis Golovin <dgolovin@users.noreply.github.com> Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Co-authored-by: Denis Golovin <dgolovin@users.noreply.github.com> Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
I created a separate branch https://github.com/axel7083/podman-desktop/tree/refactor/kind-compose-github-provider I will open a PR when this one this be merged CC @dgolovin |
// If we have a defined GitHub preference access token, let's create the session | ||
if (getGitHubAccessToken()) { | ||
try { | ||
await authProvider.createSession([]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it does not need any scopes ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see we could scope it ?
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
} | ||
|
||
export function getGitHubAccessToken(): string | undefined { | ||
return extensionApi.configuration.getConfiguration('github').get('token'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A github token should be treated the same way as username/password pair. It cannot be stored in configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benoitf do you have an idea on the way to proceed because I am a bit lost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extension context should have secrets
property to store secrets and that should be encrypted storage.
safeStorage
and safeStorageElectron
in electron that can help with encryption.
Example how to use it from VS Code https://vscode.dev/github/microsoft/vscode/blob/main/src/vs/platform/encryption/electron-main/encryptionMainService.ts#L32
What does this PR do?
Adding a GitHub Authentication Provider Extension to fix the rate limit when using GitHub api.
Screenshot / video of UI
Screenshots
preference configuration
sign in
LOGGED IN
configured invalid token on startup
What issues does this PR fix or reference?
Closing #4079
How to test this PR?