@theia/core 1.66.0-next.44 → 1.66.0-next.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/authentication-service.d.ts +14 -10
- package/lib/browser/authentication-service.d.ts.map +1 -1
- package/lib/browser/authentication-service.js +23 -11
- package/lib/browser/authentication-service.js.map +1 -1
- package/lib/browser/catalog.json +17 -9
- package/lib/browser/credentials-service.d.ts +2 -0
- package/lib/browser/credentials-service.d.ts.map +1 -1
- package/lib/browser/credentials-service.js +6 -0
- package/lib/browser/credentials-service.js.map +1 -1
- package/lib/browser/frontend-application-module.d.ts.map +1 -1
- package/lib/browser/frontend-application-module.js +3 -0
- package/lib/browser/frontend-application-module.js.map +1 -1
- package/lib/browser/symbol-icon-color-contribution.d.ts +6 -0
- package/lib/browser/symbol-icon-color-contribution.d.ts.map +1 -0
- package/lib/browser/symbol-icon-color-contribution.js +212 -0
- package/lib/browser/symbol-icon-color-contribution.js.map +1 -0
- package/lib/browser/tree/tree-widget.d.ts +6 -0
- package/lib/browser/tree/tree-widget.d.ts.map +1 -1
- package/lib/browser/tree/tree-widget.js +23 -6
- package/lib/browser/tree/tree-widget.js.map +1 -1
- package/lib/browser-only/frontend-only-application-module.d.ts.map +1 -1
- package/lib/browser-only/frontend-only-application-module.js +2 -1
- package/lib/browser-only/frontend-only-application-module.js.map +1 -1
- package/lib/common/color.d.ts +17 -1
- package/lib/common/color.d.ts.map +1 -1
- package/lib/common/color.js +62 -1
- package/lib/common/color.js.map +1 -1
- package/lib/common/content-replacer-v2-impl.d.ts +70 -0
- package/lib/common/content-replacer-v2-impl.d.ts.map +1 -0
- package/lib/common/content-replacer-v2-impl.js +407 -0
- package/lib/common/content-replacer-v2-impl.js.map +1 -0
- package/lib/common/content-replacer-v2-impl.spec.d.ts +2 -0
- package/lib/common/content-replacer-v2-impl.spec.d.ts.map +1 -0
- package/lib/common/content-replacer-v2-impl.spec.js +319 -0
- package/lib/common/content-replacer-v2-impl.spec.js.map +1 -0
- package/lib/common/content-replacer.d.ts +13 -1
- package/lib/common/content-replacer.d.ts.map +1 -1
- package/lib/common/content-replacer.js +3 -3
- package/lib/common/content-replacer.js.map +1 -1
- package/lib/common/content-replacer.spec.js +2 -2
- package/lib/common/content-replacer.spec.js.map +1 -1
- package/lib/common/key-store.d.ts +1 -0
- package/lib/common/key-store.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-menu-contribution.js +1 -1
- package/lib/electron-browser/menu/electron-menu-contribution.js.map +1 -1
- package/lib/node/key-store-server.d.ts +1 -0
- package/lib/node/key-store-server.d.ts.map +1 -1
- package/lib/node/key-store-server.js +4 -0
- package/lib/node/key-store-server.js.map +1 -1
- package/lib/node/key-store-server.spec.d.ts +2 -0
- package/lib/node/key-store-server.spec.d.ts.map +1 -0
- package/lib/node/key-store-server.spec.js +226 -0
- package/lib/node/key-store-server.spec.js.map +1 -0
- package/package.json +4 -4
- package/src/browser/authentication-service.ts +57 -18
- package/src/browser/credentials-service.ts +9 -0
- package/src/browser/frontend-application-module.ts +3 -0
- package/src/browser/style/index.css +1 -0
- package/src/browser/style/symbol-icon.css +258 -0
- package/src/browser/symbol-icon-color-contribution.ts +242 -0
- package/src/browser/tree/tree-widget.tsx +25 -6
- package/src/browser-only/frontend-only-application-module.ts +2 -1
- package/src/common/color.ts +51 -1
- package/src/common/content-replacer-v2-impl.spec.ts +344 -0
- package/src/common/content-replacer-v2-impl.ts +471 -0
- package/src/common/content-replacer.spec.ts +4 -4
- package/src/common/content-replacer.ts +11 -1
- package/src/common/key-store.ts +1 -0
- package/src/electron-browser/menu/electron-menu-contribution.ts +1 -1
- package/src/node/key-store-server.spec.ts +262 -0
- package/src/node/key-store-server.ts +5 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2025 STMicroelectronics and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const chai_1 = require("chai");
|
|
19
|
+
const key_store_server_1 = require("./key-store-server");
|
|
20
|
+
describe('KeyStoreServiceImpl', () => {
|
|
21
|
+
let keyStoreService;
|
|
22
|
+
let inMemoryProvider;
|
|
23
|
+
beforeEach(() => {
|
|
24
|
+
keyStoreService = new key_store_server_1.KeyStoreServiceImpl();
|
|
25
|
+
inMemoryProvider = new key_store_server_1.InMemoryCredentialsProvider();
|
|
26
|
+
// Force the service to use the in-memory provider for testing
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
keyStoreService.keytarImplementation = inMemoryProvider;
|
|
29
|
+
});
|
|
30
|
+
describe('keys', () => {
|
|
31
|
+
it('should return an empty array when no credentials exist for the service', async () => {
|
|
32
|
+
const result = await keyStoreService.keys('test-service');
|
|
33
|
+
(0, chai_1.expect)(result).to.be.an('array');
|
|
34
|
+
(0, chai_1.expect)(result).to.be.empty;
|
|
35
|
+
});
|
|
36
|
+
it('should return a single account key when one credential exists', async () => {
|
|
37
|
+
await keyStoreService.setPassword('test-service', 'account1', 'password1');
|
|
38
|
+
const result = await keyStoreService.keys('test-service');
|
|
39
|
+
(0, chai_1.expect)(result).to.deep.equal(['account1']);
|
|
40
|
+
});
|
|
41
|
+
it('should return multiple account keys when multiple credentials exist', async () => {
|
|
42
|
+
await keyStoreService.setPassword('test-service', 'account1', 'password1');
|
|
43
|
+
await keyStoreService.setPassword('test-service', 'account2', 'password2');
|
|
44
|
+
await keyStoreService.setPassword('test-service', 'account3', 'password3');
|
|
45
|
+
const result = await keyStoreService.keys('test-service');
|
|
46
|
+
(0, chai_1.expect)(result).to.have.lengthOf(3);
|
|
47
|
+
(0, chai_1.expect)(result).to.include.members(['account1', 'account2', 'account3']);
|
|
48
|
+
});
|
|
49
|
+
it('should only return keys for the specified service', async () => {
|
|
50
|
+
await keyStoreService.setPassword('service1', 'account1', 'password1');
|
|
51
|
+
await keyStoreService.setPassword('service2', 'account2', 'password2');
|
|
52
|
+
await keyStoreService.setPassword('service1', 'account3', 'password3');
|
|
53
|
+
const result = await keyStoreService.keys('service1');
|
|
54
|
+
(0, chai_1.expect)(result).to.have.lengthOf(2);
|
|
55
|
+
(0, chai_1.expect)(result).to.include.members(['account1', 'account3']);
|
|
56
|
+
(0, chai_1.expect)(result).to.not.include('account2');
|
|
57
|
+
});
|
|
58
|
+
it('should return updated keys after a credential is deleted', async () => {
|
|
59
|
+
await keyStoreService.setPassword('test-service', 'account1', 'password1');
|
|
60
|
+
await keyStoreService.setPassword('test-service', 'account2', 'password2');
|
|
61
|
+
await keyStoreService.deletePassword('test-service', 'account1');
|
|
62
|
+
const result = await keyStoreService.keys('test-service');
|
|
63
|
+
(0, chai_1.expect)(result).to.deep.equal(['account2']);
|
|
64
|
+
});
|
|
65
|
+
it('should return updated keys after a credential password is updated', async () => {
|
|
66
|
+
await keyStoreService.setPassword('test-service', 'account1', 'password1');
|
|
67
|
+
await keyStoreService.setPassword('test-service', 'account1', 'password2');
|
|
68
|
+
const result = await keyStoreService.keys('test-service');
|
|
69
|
+
(0, chai_1.expect)(result).to.deep.equal(['account1']);
|
|
70
|
+
});
|
|
71
|
+
it('should handle services with special characters in the name', async () => {
|
|
72
|
+
const specialService = 'test-service@#$%^&*()';
|
|
73
|
+
await keyStoreService.setPassword(specialService, 'account1', 'password1');
|
|
74
|
+
const result = await keyStoreService.keys(specialService);
|
|
75
|
+
(0, chai_1.expect)(result).to.deep.equal(['account1']);
|
|
76
|
+
});
|
|
77
|
+
it('should handle accounts with special characters in the name', async () => {
|
|
78
|
+
await keyStoreService.setPassword('test-service', 'user@example.com', 'password1');
|
|
79
|
+
await keyStoreService.setPassword('test-service', 'user-name_123', 'password2');
|
|
80
|
+
const result = await keyStoreService.keys('test-service');
|
|
81
|
+
(0, chai_1.expect)(result).to.have.lengthOf(2);
|
|
82
|
+
(0, chai_1.expect)(result).to.include.members(['user@example.com', 'user-name_123']);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
describe('setPassword', () => {
|
|
86
|
+
it('should set a password for an account', async () => {
|
|
87
|
+
await keyStoreService.setPassword('test-service', 'account1', 'password1');
|
|
88
|
+
const password = await keyStoreService.getPassword('test-service', 'account1');
|
|
89
|
+
(0, chai_1.expect)(password).to.equal('password1');
|
|
90
|
+
});
|
|
91
|
+
it('should update an existing password', async () => {
|
|
92
|
+
await keyStoreService.setPassword('test-service', 'account1', 'password1');
|
|
93
|
+
await keyStoreService.setPassword('test-service', 'account1', 'password2');
|
|
94
|
+
const password = await keyStoreService.getPassword('test-service', 'account1');
|
|
95
|
+
(0, chai_1.expect)(password).to.equal('password2');
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
describe('getPassword', () => {
|
|
99
|
+
it('should return undefined when password does not exist', async () => {
|
|
100
|
+
const password = await keyStoreService.getPassword('test-service', 'nonexistent');
|
|
101
|
+
(0, chai_1.expect)(password).to.be.undefined;
|
|
102
|
+
});
|
|
103
|
+
it('should retrieve a stored password', async () => {
|
|
104
|
+
await keyStoreService.setPassword('test-service', 'account1', 'password1');
|
|
105
|
+
const password = await keyStoreService.getPassword('test-service', 'account1');
|
|
106
|
+
(0, chai_1.expect)(password).to.equal('password1');
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
describe('deletePassword', () => {
|
|
110
|
+
it('should return false when deleting a non-existent password', async () => {
|
|
111
|
+
const result = await keyStoreService.deletePassword('test-service', 'nonexistent');
|
|
112
|
+
(0, chai_1.expect)(result).to.be.false;
|
|
113
|
+
});
|
|
114
|
+
it('should return true when deleting an existing password', async () => {
|
|
115
|
+
await keyStoreService.setPassword('test-service', 'account1', 'password1');
|
|
116
|
+
const result = await keyStoreService.deletePassword('test-service', 'account1');
|
|
117
|
+
(0, chai_1.expect)(result).to.be.true;
|
|
118
|
+
});
|
|
119
|
+
it('should remove the password after deletion', async () => {
|
|
120
|
+
await keyStoreService.setPassword('test-service', 'account1', 'password1');
|
|
121
|
+
await keyStoreService.deletePassword('test-service', 'account1');
|
|
122
|
+
const password = await keyStoreService.getPassword('test-service', 'account1');
|
|
123
|
+
(0, chai_1.expect)(password).to.be.undefined;
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
describe('findPassword', () => {
|
|
127
|
+
it('should return undefined when service has no credentials', async () => {
|
|
128
|
+
const result = await keyStoreService.findPassword('nonexistent-service');
|
|
129
|
+
(0, chai_1.expect)(result).to.be.undefined;
|
|
130
|
+
});
|
|
131
|
+
it('should return the service credentials as JSON string', async () => {
|
|
132
|
+
await keyStoreService.setPassword('test-service', 'account1', 'password1');
|
|
133
|
+
const result = await keyStoreService.findPassword('test-service');
|
|
134
|
+
(0, chai_1.expect)(result).to.be.a('string');
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
describe('findCredentials', () => {
|
|
138
|
+
it('should return an empty array when no credentials exist', async () => {
|
|
139
|
+
const result = await keyStoreService.findCredentials('test-service');
|
|
140
|
+
(0, chai_1.expect)(result).to.be.an('array');
|
|
141
|
+
(0, chai_1.expect)(result).to.be.empty;
|
|
142
|
+
});
|
|
143
|
+
it('should return all credentials for a service', async () => {
|
|
144
|
+
await keyStoreService.setPassword('test-service', 'account1', 'password1');
|
|
145
|
+
await keyStoreService.setPassword('test-service', 'account2', 'password2');
|
|
146
|
+
const result = await keyStoreService.findCredentials('test-service');
|
|
147
|
+
(0, chai_1.expect)(result).to.have.lengthOf(2);
|
|
148
|
+
(0, chai_1.expect)(result).to.deep.include({ account: 'account1', password: 'password1' });
|
|
149
|
+
(0, chai_1.expect)(result).to.deep.include({ account: 'account2', password: 'password2' });
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
describe('InMemoryCredentialsProvider', () => {
|
|
154
|
+
let provider;
|
|
155
|
+
beforeEach(() => {
|
|
156
|
+
provider = new key_store_server_1.InMemoryCredentialsProvider();
|
|
157
|
+
});
|
|
158
|
+
describe('setPassword and getPassword', () => {
|
|
159
|
+
it('should store and retrieve a password', async () => {
|
|
160
|
+
await provider.setPassword('service1', 'account1', 'password1');
|
|
161
|
+
const result = await provider.getPassword('service1', 'account1');
|
|
162
|
+
(0, chai_1.expect)(result).to.equal('password1');
|
|
163
|
+
});
|
|
164
|
+
it('should return null for non-existent password', async () => {
|
|
165
|
+
const result = await provider.getPassword('service1', 'account1');
|
|
166
|
+
(0, chai_1.expect)(result).to.be.null;
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
describe('deletePassword', () => {
|
|
170
|
+
it('should return false when deleting non-existent password', async () => {
|
|
171
|
+
const result = await provider.deletePassword('service1', 'account1');
|
|
172
|
+
(0, chai_1.expect)(result).to.be.false;
|
|
173
|
+
});
|
|
174
|
+
it('should delete an existing password and return true', async () => {
|
|
175
|
+
await provider.setPassword('service1', 'account1', 'password1');
|
|
176
|
+
const result = await provider.deletePassword('service1', 'account1');
|
|
177
|
+
(0, chai_1.expect)(result).to.be.true;
|
|
178
|
+
const password = await provider.getPassword('service1', 'account1');
|
|
179
|
+
(0, chai_1.expect)(password).to.be.null;
|
|
180
|
+
});
|
|
181
|
+
it('should remove service entry when all accounts are deleted', async () => {
|
|
182
|
+
await provider.setPassword('service1', 'account1', 'password1');
|
|
183
|
+
await provider.deletePassword('service1', 'account1');
|
|
184
|
+
const credentials = await provider.findCredentials('service1');
|
|
185
|
+
(0, chai_1.expect)(credentials).to.be.empty;
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
describe('findPassword', () => {
|
|
189
|
+
it('should return null for non-existent service', async () => {
|
|
190
|
+
const result = await provider.findPassword('service1');
|
|
191
|
+
(0, chai_1.expect)(result).to.be.null;
|
|
192
|
+
});
|
|
193
|
+
it('should return JSON string of service credentials', async () => {
|
|
194
|
+
await provider.setPassword('service1', 'account1', 'password1');
|
|
195
|
+
const result = await provider.findPassword('service1');
|
|
196
|
+
(0, chai_1.expect)(result).to.be.a('string');
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
describe('findCredentials', () => {
|
|
200
|
+
it('should return empty array for non-existent service', async () => {
|
|
201
|
+
const result = await provider.findCredentials('service1');
|
|
202
|
+
(0, chai_1.expect)(result).to.be.an('array');
|
|
203
|
+
(0, chai_1.expect)(result).to.be.empty;
|
|
204
|
+
});
|
|
205
|
+
it('should return all credentials for a service', async () => {
|
|
206
|
+
await provider.setPassword('service1', 'account1', 'password1');
|
|
207
|
+
await provider.setPassword('service1', 'account2', 'password2');
|
|
208
|
+
const result = await provider.findCredentials('service1');
|
|
209
|
+
(0, chai_1.expect)(result).to.have.lengthOf(2);
|
|
210
|
+
(0, chai_1.expect)(result).to.deep.include({ account: 'account1', password: 'password1' });
|
|
211
|
+
(0, chai_1.expect)(result).to.deep.include({ account: 'account2', password: 'password2' });
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
describe('clear', () => {
|
|
215
|
+
it('should remove all stored credentials', async () => {
|
|
216
|
+
await provider.setPassword('service1', 'account1', 'password1');
|
|
217
|
+
await provider.setPassword('service2', 'account2', 'password2');
|
|
218
|
+
await provider.clear();
|
|
219
|
+
const credentials1 = await provider.findCredentials('service1');
|
|
220
|
+
const credentials2 = await provider.findCredentials('service2');
|
|
221
|
+
(0, chai_1.expect)(credentials1).to.be.empty;
|
|
222
|
+
(0, chai_1.expect)(credentials2).to.be.empty;
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
//# sourceMappingURL=key-store-server.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-store-server.spec.js","sourceRoot":"","sources":["../../src/node/key-store-server.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,+BAA8B;AAC9B,yDAAsF;AAEtF,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACjC,IAAI,eAAoC,CAAC;IACzC,IAAI,gBAA6C,CAAC;IAElD,UAAU,CAAC,GAAG,EAAE;QACZ,eAAe,GAAG,IAAI,sCAAmB,EAAE,CAAC;QAC5C,gBAAgB,GAAG,IAAI,8CAA2B,EAAE,CAAC;QACrD,8DAA8D;QAC9D,8DAA8D;QAC7D,eAAuB,CAAC,oBAAoB,GAAG,gBAAgB,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;QAClB,EAAE,CAAC,wEAAwE,EAAE,KAAK,IAAI,EAAE;YACpF,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC1D,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;YACjC,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+DAA+D,EAAE,KAAK,IAAI,EAAE;YAC3E,MAAM,eAAe,CAAC,WAAW,CAAC,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C,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;QACnB,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;YAClD,MAAM,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;YAChE,MAAM,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;YAChE,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;YACvB,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;YAChE,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;YAChE,IAAA,aAAM,EAAC,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;YACjC,IAAA,aAAM,EAAC,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/core",
|
|
3
|
-
"version": "1.66.0-next.
|
|
3
|
+
"version": "1.66.0-next.73+6d82794da",
|
|
4
4
|
"description": "Theia is a cloud & desktop IDE framework implemented in TypeScript.",
|
|
5
5
|
"main": "lib/common/index.js",
|
|
6
6
|
"typings": "lib/common/index.d.ts",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"@lumino/virtualdom": "^2.0.2",
|
|
18
18
|
"@lumino/widgets": "2.5.0",
|
|
19
19
|
"@parcel/watcher": "^2.5.0",
|
|
20
|
-
"@theia/application-package": "1.66.0-next.
|
|
21
|
-
"@theia/request": "1.66.0-next.
|
|
20
|
+
"@theia/application-package": "1.66.0-next.73+6d82794da",
|
|
21
|
+
"@theia/request": "1.66.0-next.73+6d82794da",
|
|
22
22
|
"@types/body-parser": "^1.16.4",
|
|
23
23
|
"@types/express": "^4.17.21",
|
|
24
24
|
"@types/fs-extra": "^4.0.2",
|
|
@@ -216,5 +216,5 @@
|
|
|
216
216
|
"nyc": {
|
|
217
217
|
"extends": "../../configs/nyc.json"
|
|
218
218
|
},
|
|
219
|
-
"gitHead": "
|
|
219
|
+
"gitHead": "6d82794da24e16f75d70eaac3a4178a29e822e82"
|
|
220
220
|
}
|
|
@@ -52,6 +52,18 @@ export interface AuthenticationProviderInformation {
|
|
|
52
52
|
label: string;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
export interface AuthenticationWwwAuthenticateRequest {
|
|
56
|
+
readonly wwwAuthenticate: string;
|
|
57
|
+
readonly fallbackScopes?: readonly string[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function isAuthenticationWwwAuthenticateRequest(obj: unknown): obj is AuthenticationWwwAuthenticateRequest {
|
|
61
|
+
return !!(obj
|
|
62
|
+
&& typeof obj === 'object'
|
|
63
|
+
&& 'wwwAuthenticate' in obj
|
|
64
|
+
&& (typeof obj.wwwAuthenticate === 'string'));
|
|
65
|
+
}
|
|
66
|
+
|
|
55
67
|
/** Should match the definition from the theia/vscode types */
|
|
56
68
|
export interface AuthenticationProviderAuthenticationSessionsChangeEvent {
|
|
57
69
|
readonly added: readonly AuthenticationSession[] | undefined;
|
|
@@ -59,6 +71,9 @@ export interface AuthenticationProviderAuthenticationSessionsChangeEvent {
|
|
|
59
71
|
readonly changed: readonly AuthenticationSession[] | undefined;
|
|
60
72
|
}
|
|
61
73
|
|
|
74
|
+
// OAuth2 spec prohibits space in a scope, so use that to join them.
|
|
75
|
+
const SCOPESLIST_SEPARATOR = ' ';
|
|
76
|
+
|
|
62
77
|
export interface SessionRequest {
|
|
63
78
|
disposables: Disposable[];
|
|
64
79
|
requestingExtensionIds: string[];
|
|
@@ -97,20 +112,25 @@ export interface AuthenticationProvider {
|
|
|
97
112
|
|
|
98
113
|
/**
|
|
99
114
|
* Get a list of sessions.
|
|
100
|
-
* @param
|
|
101
|
-
* these permissions, otherwise all sessions should be returned.
|
|
115
|
+
* @param scopeListOrRequest Optional scope list of permissions requested or WWW-Authenticate request.
|
|
102
116
|
* @param account The optional account that you would like to get the session for
|
|
103
117
|
* @returns A promise that resolves to an array of authentication sessions.
|
|
104
118
|
*/
|
|
105
|
-
getSessions(
|
|
119
|
+
getSessions(
|
|
120
|
+
scopeListOrRequest?: ReadonlyArray<string> | AuthenticationWwwAuthenticateRequest,
|
|
121
|
+
account?: AuthenticationSessionAccountInformation
|
|
122
|
+
): Thenable<ReadonlyArray<AuthenticationSession>>;
|
|
106
123
|
|
|
107
124
|
/**
|
|
108
125
|
* Prompts a user to login.
|
|
109
|
-
* @param
|
|
126
|
+
* @param scopeListOrRequest A scope list of permissions requested or a WWW-Authenticate request.
|
|
110
127
|
* @param options The options for createing the session
|
|
111
128
|
* @returns A promise that resolves to an authentication session.
|
|
112
129
|
*/
|
|
113
|
-
createSession(
|
|
130
|
+
createSession(
|
|
131
|
+
scopeListOrRequest: ReadonlyArray<string> | AuthenticationWwwAuthenticateRequest,
|
|
132
|
+
options: AuthenticationProviderSessionOptions
|
|
133
|
+
): Thenable<AuthenticationSession>;
|
|
114
134
|
|
|
115
135
|
/**
|
|
116
136
|
* Removes the session corresponding to session id.
|
|
@@ -125,7 +145,7 @@ export interface AuthenticationService {
|
|
|
125
145
|
getProviderIds(): string[];
|
|
126
146
|
registerAuthenticationProvider(id: string, provider: AuthenticationProvider): void;
|
|
127
147
|
unregisterAuthenticationProvider(id: string): void;
|
|
128
|
-
requestNewSession(id: string,
|
|
148
|
+
requestNewSession(id: string, scopeListOrRequest: ReadonlyArray<string> | AuthenticationWwwAuthenticateRequest, extensionId: string, extensionName: string): void;
|
|
129
149
|
updateSessions(providerId: string, event: AuthenticationProviderAuthenticationSessionsChangeEvent): void;
|
|
130
150
|
|
|
131
151
|
readonly onDidRegisterAuthenticationProvider: Event<AuthenticationProviderInformation>;
|
|
@@ -133,10 +153,18 @@ export interface AuthenticationService {
|
|
|
133
153
|
|
|
134
154
|
readonly onDidChangeSessions: Event<{ providerId: string, label: string, event: AuthenticationProviderAuthenticationSessionsChangeEvent }>;
|
|
135
155
|
readonly onDidUpdateSignInCount: Event<number>;
|
|
136
|
-
getSessions(
|
|
156
|
+
getSessions(
|
|
157
|
+
providerId: string,
|
|
158
|
+
scopeListOrRequest?: ReadonlyArray<string> | AuthenticationWwwAuthenticateRequest,
|
|
159
|
+
user?: AuthenticationSessionAccountInformation
|
|
160
|
+
): Promise<ReadonlyArray<AuthenticationSession>>;
|
|
137
161
|
getLabel(providerId: string): string;
|
|
138
162
|
supportsMultipleAccounts(providerId: string): boolean;
|
|
139
|
-
login(
|
|
163
|
+
login(
|
|
164
|
+
providerId: string,
|
|
165
|
+
scopeListOrRequest: ReadonlyArray<string> | AuthenticationWwwAuthenticateRequest,
|
|
166
|
+
options?: AuthenticationProviderSessionOptions
|
|
167
|
+
): Promise<AuthenticationSession>;
|
|
140
168
|
logout(providerId: string, sessionId: string): Promise<void>;
|
|
141
169
|
|
|
142
170
|
signOutOfAccount(providerId: string, accountName: string): Promise<void>;
|
|
@@ -328,7 +356,12 @@ export class AuthenticationServiceImpl implements AuthenticationService {
|
|
|
328
356
|
}
|
|
329
357
|
}
|
|
330
358
|
|
|
331
|
-
async requestNewSession(
|
|
359
|
+
async requestNewSession(
|
|
360
|
+
providerId: string,
|
|
361
|
+
scopeListOrRequest: ReadonlyArray<string> | AuthenticationWwwAuthenticateRequest,
|
|
362
|
+
extensionId: string,
|
|
363
|
+
extensionName: string
|
|
364
|
+
): Promise<void> {
|
|
332
365
|
let provider = this.authenticationProviders.get(providerId);
|
|
333
366
|
if (!provider) {
|
|
334
367
|
// Activate has already been called for the authentication provider, but it cannot block on registering itself
|
|
@@ -346,10 +379,12 @@ export class AuthenticationServiceImpl implements AuthenticationService {
|
|
|
346
379
|
|
|
347
380
|
if (provider) {
|
|
348
381
|
const providerRequests = this.signInRequestItems.get(providerId);
|
|
349
|
-
const
|
|
382
|
+
const signInRequestKey = isAuthenticationWwwAuthenticateRequest(scopeListOrRequest)
|
|
383
|
+
? `${scopeListOrRequest.wwwAuthenticate}:${scopeListOrRequest.fallbackScopes?.join(SCOPESLIST_SEPARATOR) ?? ''}`
|
|
384
|
+
: `${scopeListOrRequest.join(SCOPESLIST_SEPARATOR)}`;
|
|
350
385
|
const extensionHasExistingRequest = providerRequests
|
|
351
|
-
&& providerRequests[
|
|
352
|
-
&& providerRequests[
|
|
386
|
+
&& providerRequests[signInRequestKey]
|
|
387
|
+
&& providerRequests[signInRequestKey].requestingExtensionIds.indexOf(extensionId) > -1;
|
|
353
388
|
|
|
354
389
|
if (extensionHasExistingRequest) {
|
|
355
390
|
return;
|
|
@@ -363,7 +398,7 @@ export class AuthenticationServiceImpl implements AuthenticationService {
|
|
|
363
398
|
|
|
364
399
|
const signInCommand = this.commands.registerCommand({ id: `${extensionId}signIn` }, {
|
|
365
400
|
execute: async () => {
|
|
366
|
-
const session = await this.login(providerId,
|
|
401
|
+
const session = await this.login(providerId, scopeListOrRequest);
|
|
367
402
|
|
|
368
403
|
// Add extension to allow list since user explicitly signed in on behalf of it
|
|
369
404
|
const allowList = await readAllowedExtensions(this.storageService, providerId, session.account.label);
|
|
@@ -379,16 +414,16 @@ export class AuthenticationServiceImpl implements AuthenticationService {
|
|
|
379
414
|
|
|
380
415
|
const previousSize = this.signInRequestItems.size;
|
|
381
416
|
if (providerRequests) {
|
|
382
|
-
const existingRequest = providerRequests[
|
|
417
|
+
const existingRequest = providerRequests[signInRequestKey] || { disposables: [], requestingExtensionIds: [] };
|
|
383
418
|
|
|
384
|
-
providerRequests[
|
|
419
|
+
providerRequests[signInRequestKey] = {
|
|
385
420
|
disposables: [...existingRequest.disposables, menuItem, signInCommand],
|
|
386
421
|
requestingExtensionIds: [...existingRequest.requestingExtensionIds, extensionId]
|
|
387
422
|
};
|
|
388
423
|
this.signInRequestItems.set(providerId, providerRequests);
|
|
389
424
|
} else {
|
|
390
425
|
this.signInRequestItems.set(providerId, {
|
|
391
|
-
[
|
|
426
|
+
[signInRequestKey]: {
|
|
392
427
|
disposables: [menuItem, signInCommand],
|
|
393
428
|
requestingExtensionIds: [extensionId]
|
|
394
429
|
}
|
|
@@ -427,10 +462,14 @@ export class AuthenticationServiceImpl implements AuthenticationService {
|
|
|
427
462
|
}
|
|
428
463
|
}
|
|
429
464
|
|
|
430
|
-
async login(
|
|
465
|
+
async login(
|
|
466
|
+
id: string,
|
|
467
|
+
scopeListOrRequest: ReadonlyArray<string> | AuthenticationWwwAuthenticateRequest,
|
|
468
|
+
options?: AuthenticationProviderSessionOptions
|
|
469
|
+
): Promise<AuthenticationSession> {
|
|
431
470
|
const authProvider = this.authenticationProviders.get(id);
|
|
432
471
|
if (authProvider) {
|
|
433
|
-
return authProvider.createSession(
|
|
472
|
+
return authProvider.createSession(scopeListOrRequest, options || {});
|
|
434
473
|
} else {
|
|
435
474
|
throw new Error(`No authentication provider '${id}' is currently registered.`);
|
|
436
475
|
}
|
|
@@ -30,6 +30,7 @@ export interface CredentialsProvider {
|
|
|
30
30
|
deletePassword(service: string, account: string): Promise<boolean>;
|
|
31
31
|
findPassword(service: string): Promise<string | undefined>;
|
|
32
32
|
findCredentials(service: string): Promise<Array<{ account: string, password: string }>>;
|
|
33
|
+
keys(service: string): Promise<string[]>;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
export const CredentialsService = Symbol('CredentialsService');
|
|
@@ -78,6 +79,10 @@ export class CredentialsServiceImpl implements CredentialsService {
|
|
|
78
79
|
findCredentials(service: string): Promise<Array<{ account: string, password: string; }>> {
|
|
79
80
|
return this.credentialsProvider.findCredentials(service);
|
|
80
81
|
}
|
|
82
|
+
|
|
83
|
+
async keys(service: string): Promise<string[]> {
|
|
84
|
+
return this.credentialsProvider.keys(service);
|
|
85
|
+
}
|
|
81
86
|
}
|
|
82
87
|
|
|
83
88
|
class KeytarCredentialsProvider implements CredentialsProvider {
|
|
@@ -103,4 +108,8 @@ class KeytarCredentialsProvider implements CredentialsProvider {
|
|
|
103
108
|
setPassword(service: string, account: string, password: string): Promise<void> {
|
|
104
109
|
return this.keytarService.setPassword(service, account, password);
|
|
105
110
|
}
|
|
111
|
+
|
|
112
|
+
keys(service: string): Promise<string[]> {
|
|
113
|
+
return this.keytarService.keys(service);
|
|
114
|
+
}
|
|
106
115
|
}
|
|
@@ -141,6 +141,7 @@ import { OpenWithService } from './open-with-service';
|
|
|
141
141
|
import { ViewColumnService } from './shell/view-column-service';
|
|
142
142
|
import { DomInputUndoRedoHandler, UndoRedoHandler, UndoRedoHandlerService } from './undo-redo-handler';
|
|
143
143
|
import { WidgetStatusBarContribution, WidgetStatusBarService } from './widget-status-bar-service';
|
|
144
|
+
import { SymbolIconColorContribution } from './symbol-icon-color-contribution';
|
|
144
145
|
import { CorePreferences, bindCorePreferences } from '../common/core-preferences';
|
|
145
146
|
|
|
146
147
|
export { bindResourceProvider, bindMessageService, bindPreferenceService };
|
|
@@ -296,6 +297,8 @@ export const frontendApplicationModule = new ContainerModule((bind, _unbind, _is
|
|
|
296
297
|
[FrontendApplicationContribution, CommandContribution, KeybindingContribution, MenuContribution, ColorContribution].forEach(serviceIdentifier =>
|
|
297
298
|
bind(serviceIdentifier).toService(CommonFrontendContribution)
|
|
298
299
|
);
|
|
300
|
+
bind(SymbolIconColorContribution).toSelf().inSingletonScope();
|
|
301
|
+
bind(ColorContribution).toService(SymbolIconColorContribution);
|
|
299
302
|
|
|
300
303
|
bindCommonStylingParticipants(bind);
|
|
301
304
|
|