Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
31419adc
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
31419adc
编写于
10月 12, 2020
作者:
R
Rachel Macfarlane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polish onDidChangePassword changes
上级
9910c380
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
15 addition
and
22 deletion
+15
-22
extensions/github-authentication/src/common/keychain.ts
extensions/github-authentication/src/common/keychain.ts
+0
-6
extensions/github-authentication/src/extension.ts
extensions/github-authentication/src/extension.ts
+1
-1
extensions/github-authentication/src/github.ts
extensions/github-authentication/src/github.ts
+2
-2
extensions/microsoft-authentication/src/AADHelper.ts
extensions/microsoft-authentication/src/AADHelper.ts
+8
-2
extensions/microsoft-authentication/src/extension.ts
extensions/microsoft-authentication/src/extension.ts
+1
-0
extensions/microsoft-authentication/src/keychain.ts
extensions/microsoft-authentication/src/keychain.ts
+0
-6
src/vs/workbench/api/common/extHostAuthentication.ts
src/vs/workbench/api/common/extHostAuthentication.ts
+1
-3
src/vs/workbench/services/credentials/browser/credentialsService.ts
...kbench/services/credentials/browser/credentialsService.ts
+1
-1
src/vs/workbench/services/credentials/common/credentials.ts
src/vs/workbench/services/credentials/common/credentials.ts
+1
-1
未找到文件。
extensions/github-authentication/src/common/keychain.ts
浏览文件 @
31419adc
...
...
@@ -84,12 +84,6 @@ export class Keychain {
return
Promise
.
resolve
(
undefined
);
}
}
onDidChangePassword
(
listener
:
()
=>
void
)
{
vscode
.
authentication
.
onDidChangePassword
(
_
=>
{
listener
();
});
}
}
export
const
keychain
=
new
Keychain
();
extensions/github-authentication/src/extension.ts
浏览文件 @
31419adc
...
...
@@ -16,7 +16,7 @@ export async function activate(context: vscode.ExtensionContext) {
context
.
subscriptions
.
push
(
vscode
.
window
.
registerUriHandler
(
uriHandler
));
const
loginService
=
new
GitHubAuthenticationProvider
();
await
loginService
.
initialize
();
await
loginService
.
initialize
(
context
);
context
.
subscriptions
.
push
(
vscode
.
commands
.
registerCommand
(
'
github.provide-token
'
,
()
=>
{
return
loginService
.
manuallyProvideToken
();
...
...
extensions/github-authentication/src/github.ts
浏览文件 @
31419adc
...
...
@@ -26,14 +26,14 @@ export class GitHubAuthenticationProvider {
private
_sessions
:
vscode
.
AuthenticationSession
[]
=
[];
private
_githubServer
=
new
GitHubServer
();
public
async
initialize
():
Promise
<
void
>
{
public
async
initialize
(
context
:
vscode
.
ExtensionContext
):
Promise
<
void
>
{
try
{
this
.
_sessions
=
await
this
.
readSessions
();
}
catch
(
e
)
{
// Ignore, network request failed
}
keychain
.
onDidChangePassword
(()
=>
this
.
checkForUpdates
(
));
context
.
subscriptions
.
push
(
vscode
.
authentication
.
onDidChangePassword
(()
=>
this
.
checkForUpdates
()
));
}
private
async
checkForUpdates
()
{
...
...
extensions/microsoft-authentication/src/AADHelper.ts
浏览文件 @
31419adc
...
...
@@ -93,10 +93,11 @@ export class AzureActiveDirectoryService {
private
_tokens
:
IToken
[]
=
[];
private
_refreshTimeouts
:
Map
<
string
,
NodeJS
.
Timeout
>
=
new
Map
<
string
,
NodeJS
.
Timeout
>
();
private
_uriHandler
:
UriEventHandler
;
private
_disposables
:
vscode
.
Disposable
[]
=
[];
constructor
()
{
this
.
_uriHandler
=
new
UriEventHandler
();
vscode
.
window
.
registerUriHandler
(
this
.
_uriHandler
);
this
.
_disposables
.
push
(
vscode
.
window
.
registerUriHandler
(
this
.
_uriHandler
)
);
}
public
async
initialize
():
Promise
<
void
>
{
...
...
@@ -140,7 +141,7 @@ export class AzureActiveDirectoryService {
}
}
keychain
.
onDidChangePassword
(()
=>
this
.
checkForUpdates
);
this
.
_disposables
.
push
(
vscode
.
authentication
.
onDidChangePassword
(()
=>
this
.
checkForUpdates
)
);
}
private
parseStoredData
(
data
:
string
):
IStoredSession
[]
{
...
...
@@ -340,6 +341,11 @@ export class AzureActiveDirectoryService {
});
}
public
dispose
():
void
{
this
.
_disposables
.
forEach
(
disposable
=>
disposable
.
dispose
());
this
.
_disposables
=
[];
}
private
getCallbackEnvironment
(
callbackUri
:
vscode
.
Uri
):
string
{
if
(
callbackUri
.
authority
.
endsWith
(
'
.workspaces.github.com
'
)
||
callbackUri
.
authority
.
endsWith
(
'
.github.dev
'
))
{
return
`
${
callbackUri
.
authority
}
,`
;
...
...
extensions/microsoft-authentication/src/extension.ts
浏览文件 @
31419adc
...
...
@@ -14,6 +14,7 @@ export async function activate(context: vscode.ExtensionContext) {
const
telemetryReporter
=
new
TelemetryReporter
(
name
,
version
,
aiKey
);
const
loginService
=
new
AzureActiveDirectoryService
();
context
.
subscriptions
.
push
(
loginService
);
await
loginService
.
initialize
();
...
...
extensions/microsoft-authentication/src/keychain.ts
浏览文件 @
31419adc
...
...
@@ -101,12 +101,6 @@ export class Keychain {
return
Promise
.
resolve
(
null
);
}
}
onDidChangePassword
(
listener
:
()
=>
void
)
{
vscode
.
authentication
.
onDidChangePassword
(
_
=>
{
listener
();
});
}
}
export
const
keychain
=
new
Keychain
();
src/vs/workbench/api/common/extHostAuthentication.ts
浏览文件 @
31419adc
...
...
@@ -24,7 +24,6 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape {
private
_onDidChangeSessions
=
new
Emitter
<
vscode
.
AuthenticationSessionsChangeEvent
>
();
readonly
onDidChangeSessions
:
Event
<
vscode
.
AuthenticationSessionsChangeEvent
>
=
this
.
_onDidChangeSessions
.
event
;
private
_onDidChangePassword
=
new
Emitter
<
void
>
();
readonly
onDidChangePassword
:
Event
<
void
>
=
this
.
_onDidChangePassword
.
event
;
...
...
@@ -208,9 +207,8 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape {
return
Promise
.
resolve
();
}
$onDidChangePassword
():
Promise
<
void
>
{
async
$onDidChangePassword
():
Promise
<
void
>
{
this
.
_onDidChangePassword
.
fire
();
return
Promise
.
resolve
();
}
getPassword
(
requestingExtension
:
IExtensionDescription
,
key
:
string
):
Promise
<
string
|
undefined
>
{
...
...
src/vs/workbench/services/credentials/browser/credentialsService.ts
浏览文件 @
31419adc
...
...
@@ -13,7 +13,7 @@ export class BrowserCredentialsService implements ICredentialsService {
declare
readonly
_serviceBrand
:
undefined
;
private
_onDidChangePassword
:
Emitter
<
void
>
=
new
Emitter
();
onDidChangePassword
=
this
.
_onDidChangePassword
.
event
;
readonly
onDidChangePassword
=
this
.
_onDidChangePassword
.
event
;
private
credentialsProvider
:
ICredentialsProvider
;
...
...
src/vs/workbench/services/credentials/common/credentials.ts
浏览文件 @
31419adc
...
...
@@ -18,5 +18,5 @@ export interface ICredentialsProvider {
export
interface
ICredentialsService
extends
ICredentialsProvider
{
readonly
_serviceBrand
:
undefined
;
onDidChangePassword
:
Event
<
void
>
;
readonly
onDidChangePassword
:
Event
<
void
>
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录