Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Prompt users when cloning Git repositories using an invalid SSH key #995

Merged
merged 16 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@ export class CheGithubMainImpl implements CheGithubMain {
}

async $uploadPublicSshKey(publicKey: string): Promise<void> {
await this.fetchToken();
try {
await this.fetchToken();
await this.uploadKey(publicKey);
} catch (error) {
console.error(error.message);
throw error;
}
}

async uploadKey(publicKey: string): Promise<void> {
await this.axiosInstance.post(
'https://api.github.com/user/keys',
{
Expand Down Expand Up @@ -76,6 +85,7 @@ export class CheGithubMainImpl implements CheGithubMain {
await this.oAuthUtils.authenticate(oAuthProvider, ['repo', 'user', 'write:public_key']);
this.token = await this.oAuthUtils.getToken(oAuthProvider);
};

if (await this.oAuthUtils.isAuthenticated(oAuthProvider)) {
try {
// Validate the GitHub token.
Expand Down
121 changes: 0 additions & 121 deletions plugins/ssh-plugin/src/node/ssh-key-manager.ts

This file was deleted.

Loading