authentication implicit activation events (#166715)

* `authentication` implicit activation events

* More safety accessing `.id`
This commit is contained in:
Joyce Er 2022-11-19 08:30:48 -08:00 committed by GitHub
parent 63f8550155
commit 3bdea7784d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 7 deletions

View file

@ -17,10 +17,7 @@
"ui", "ui",
"workspace" "workspace"
], ],
"activationEvents": [ "activationEvents": [],
"onAuthenticationRequest:github",
"onAuthenticationRequest:github-enterprise"
],
"capabilities": { "capabilities": {
"virtualWorkspaces": true, "virtualWorkspaces": true,
"untrustedWorkspaces": { "untrustedWorkspaces": {

View file

@ -12,9 +12,7 @@
"categories": [ "categories": [
"Other" "Other"
], ],
"activationEvents": [ "activationEvents": [],
"onAuthenticationRequest:microsoft"
],
"enabledApiProposals": [ "enabledApiProposals": [
"telemetryLogger", "telemetryLogger",
"idToken" "idToken"

View file

@ -152,6 +152,13 @@ const authenticationExtPoint = ExtensionsRegistry.registerExtensionPoint<Authent
description: nls.localize({ key: 'authenticationExtensionPoint', comment: [`'Contributes' means adds here`] }, 'Contributes authentication'), description: nls.localize({ key: 'authenticationExtensionPoint', comment: [`'Contributes' means adds here`] }, 'Contributes authentication'),
type: 'array', type: 'array',
items: authenticationDefinitionSchema items: authenticationDefinitionSchema
},
activationEventsGenerator: (authenticationProviders, result) => {
for (const authenticationProvider of authenticationProviders) {
if (authenticationProvider.id) {
result.push(`onAuthenticationRequest:${authenticationProvider.id}`);
}
}
} }
}); });