Skip to content

Commit a6c47be

Browse files
author
Rachel Macfarlane
committed
Remove unused code in github auth provider
1 parent 70e414b commit a6c47be

6 files changed

Lines changed: 10 additions & 337 deletions

File tree

build/azure-pipelines/product-compile.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -72,29 +72,6 @@ steps:
7272
vstsFeed: 'npm-vscode'
7373
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'), ne(variables['CacheRestored'], 'true'))
7474

75-
- script: |
76-
set -e
77-
yarn generate-github-config
78-
displayName: Generate GitHub config
79-
env:
80-
OSS_GITHUB_ID: "a5d3c261b032765a78de"
81-
OSS_GITHUB_SECRET: $(oss-github-client-secret)
82-
INSIDERS_GITHUB_ID: "31f02627809389d9f111"
83-
INSIDERS_GITHUB_SECRET: $(insiders-github-client-secret)
84-
STABLE_GITHUB_ID: "baa8a44b5e861d918709"
85-
STABLE_GITHUB_SECRET: $(stable-github-client-secret)
86-
EXPLORATION_GITHUB_ID: "94e8376d3a90429aeaea"
87-
EXPLORATION_GITHUB_SECRET: $(exploration-github-client-secret)
88-
VSO_GITHUB_ID: "3d4be8f37a0325b5817d"
89-
VSO_GITHUB_SECRET: $(vso-github-client-secret)
90-
VSO_PPE_GITHUB_ID: "eabf35024dc2e891a492"
91-
VSO_PPE_GITHUB_SECRET: $(vso-ppe-github-client-secret)
92-
VSO_DEV_GITHUB_ID: "84383ebd8a7c5f5efc5c"
93-
VSO_DEV_GITHUB_SECRET: $(vso-dev-github-client-secret)
94-
GITHUB_APP_ID: "Iv1.ae51e546bef24ff1"
95-
GITHUB_APP_SECRET: $(github-app-client-secret)
96-
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'), ne(variables['CacheRestored'], 'true'))
97-
9875
- script: |
9976
set -e
10077
yarn postinstall

extensions/github-authentication/build/generateconfig.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

extensions/github-authentication/src/common/clientRegistrar.ts

Lines changed: 0 additions & 102 deletions
This file was deleted.

extensions/github-authentication/src/github.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ export class GitHubAuthenticationProvider {
4444
// Ignore, network request failed
4545
}
4646

47-
// TODO revert Cannot validate tokens from auth server, no available clientId
48-
// await this.validateSessions();
4947
this.pollForChange();
5048
}
5149

@@ -144,22 +142,12 @@ export class GitHubAuthenticationProvider {
144142
}
145143

146144
public async login(scopes: string): Promise<vscode.AuthenticationSession2> {
147-
const token = scopes === 'vso' ? await this.loginAndInstallApp(scopes) : await this._githubServer.login(scopes);
145+
const token = await this._githubServer.login(scopes);
148146
const session = await this.tokenToSession(token, scopes.split(' '));
149147
await this.setToken(session);
150148
return session;
151149
}
152150

153-
public async loginAndInstallApp(scopes: string): Promise<string> {
154-
const token = await this._githubServer.login(scopes);
155-
const hasUserInstallation = await this._githubServer.hasUserInstallation(token);
156-
if (hasUserInstallation) {
157-
return token;
158-
} else {
159-
return this._githubServer.installApp();
160-
}
161-
}
162-
163151
public async manuallyProvideToken(): Promise<void> {
164152
this._githubServer.manuallyProvideToken();
165153
}
@@ -184,14 +172,6 @@ export class GitHubAuthenticationProvider {
184172
const sessionIndex = this._sessions.findIndex(session => session.id === id);
185173
if (sessionIndex > -1) {
186174
this._sessions.splice(sessionIndex, 1);
187-
// TODO revert
188-
// Cannot revoke tokens from auth server, no clientId available
189-
// const token = await session.getAccessToken();
190-
// try {
191-
// await this._githubServer.revokeToken(token);
192-
// } catch (_) {
193-
// // ignore, should still remove from keychain
194-
// }
195175
}
196176

197177
await this.storeSessions();

0 commit comments

Comments
 (0)