@wireapp/core 44.0.5 → 44.0.6
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/Account.d.ts.map +1 -1
- package/lib/Account.js +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts +3 -3
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.d.ts +6 -6
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts +0 -24
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts +8 -26
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.js +25 -92
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts +2 -2
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.js +5 -19
- package/package.json +2 -2
package/lib/Account.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../src/Account.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,YAAY,EAGZ,OAAO,EACP,MAAM,EAEN,SAAS,EAEV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAuB,UAAU,EAAE,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAEnG,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAC;AASxD,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAC,UAAU,EAAe,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CA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OAAO,CAAC;KACb,GAAG,MAAM,IAAI;IAgGnB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,uBAAuB;YAIjB,UAAU;IAuBxB,OAAO,CAAC,yBAAyB,CAS/B;CACH"}
|
package/lib/Account.js
CHANGED
|
@@ -196,7 +196,7 @@ class Account extends commons_1.TypedEventEmitter {
|
|
|
196
196
|
teamId,
|
|
197
197
|
id: this.userId,
|
|
198
198
|
};
|
|
199
|
-
return this.service.mls.enrollE2EI(discoveryUrl,
|
|
199
|
+
return this.service.mls.enrollE2EI(discoveryUrl, user, this.currentClient, this.options.nbPrekeys, certificateTtl, oAuthIdToken);
|
|
200
200
|
}
|
|
201
201
|
get clientId() {
|
|
202
202
|
return this.apiClient.validatedClientId;
|
package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts
CHANGED
|
@@ -27,13 +27,13 @@ export declare class AcmeService {
|
|
|
27
27
|
createNewOrder(url: AcmeDirectory['newOrder'], payload: Uint8Array): Promise<PostJoseRequestReturnValue<{
|
|
28
28
|
status: string;
|
|
29
29
|
expires: string;
|
|
30
|
+
authorizations: string[];
|
|
30
31
|
notBefore: string;
|
|
31
32
|
notAfter: string;
|
|
32
33
|
identifiers: {
|
|
33
34
|
type: string;
|
|
34
35
|
value: string;
|
|
35
36
|
}[];
|
|
36
|
-
authorizations: string[];
|
|
37
37
|
finalize: string;
|
|
38
38
|
}>>;
|
|
39
39
|
getAuthorization(url: string, payload: Uint8Array): Promise<PostJoseRequestReturnValue<{
|
|
@@ -74,13 +74,13 @@ export declare class AcmeService {
|
|
|
74
74
|
id: string;
|
|
75
75
|
status: string;
|
|
76
76
|
expires: string;
|
|
77
|
+
authorizations: string[];
|
|
77
78
|
notBefore: string;
|
|
78
79
|
notAfter: string;
|
|
79
80
|
identifiers: {
|
|
80
81
|
type: string;
|
|
81
82
|
value: string;
|
|
82
83
|
}[];
|
|
83
|
-
authorizations: string[];
|
|
84
84
|
finalize: string;
|
|
85
85
|
}>>;
|
|
86
86
|
finalizeOrder(url: string, payload: Uint8Array): Promise<PostJoseRequestReturnValue<{
|
|
@@ -88,13 +88,13 @@ export declare class AcmeService {
|
|
|
88
88
|
certificate: string;
|
|
89
89
|
status: string;
|
|
90
90
|
expires: string;
|
|
91
|
+
authorizations: string[];
|
|
91
92
|
notBefore: string;
|
|
92
93
|
notAfter: string;
|
|
93
94
|
identifiers: {
|
|
94
95
|
type: string;
|
|
95
96
|
value: string;
|
|
96
97
|
}[];
|
|
97
|
-
authorizations: string[];
|
|
98
98
|
finalize: string;
|
|
99
99
|
}>>;
|
|
100
100
|
getCertificate(url: string, payload: Uint8Array): Promise<PostJoseRequestReturnValue<string>>;
|
|
@@ -81,24 +81,24 @@ export declare const NewOrderResponseSchema: z.ZodObject<{
|
|
|
81
81
|
}, "strip", z.ZodTypeAny, {
|
|
82
82
|
status: string;
|
|
83
83
|
expires: string;
|
|
84
|
+
authorizations: string[];
|
|
84
85
|
notBefore: string;
|
|
85
86
|
notAfter: string;
|
|
86
87
|
identifiers: {
|
|
87
88
|
type: string;
|
|
88
89
|
value: string;
|
|
89
90
|
}[];
|
|
90
|
-
authorizations: string[];
|
|
91
91
|
finalize: string;
|
|
92
92
|
}, {
|
|
93
93
|
status: string;
|
|
94
94
|
expires: string;
|
|
95
|
+
authorizations: string[];
|
|
95
96
|
notBefore: string;
|
|
96
97
|
notAfter: string;
|
|
97
98
|
identifiers: {
|
|
98
99
|
type: string;
|
|
99
100
|
value: string;
|
|
100
101
|
}[];
|
|
101
|
-
authorizations: string[];
|
|
102
102
|
finalize: string;
|
|
103
103
|
}>;
|
|
104
104
|
export type NewOrderResponseData = z.infer<typeof NewOrderResponseSchema>;
|
|
@@ -247,25 +247,25 @@ export declare const CheckStatusOfOrderResponseSchema: z.ZodObject<{
|
|
|
247
247
|
id: string;
|
|
248
248
|
status: string;
|
|
249
249
|
expires: string;
|
|
250
|
+
authorizations: string[];
|
|
250
251
|
notBefore: string;
|
|
251
252
|
notAfter: string;
|
|
252
253
|
identifiers: {
|
|
253
254
|
type: string;
|
|
254
255
|
value: string;
|
|
255
256
|
}[];
|
|
256
|
-
authorizations: string[];
|
|
257
257
|
finalize: string;
|
|
258
258
|
}, {
|
|
259
259
|
id: string;
|
|
260
260
|
status: string;
|
|
261
261
|
expires: string;
|
|
262
|
+
authorizations: string[];
|
|
262
263
|
notBefore: string;
|
|
263
264
|
notAfter: string;
|
|
264
265
|
identifiers: {
|
|
265
266
|
type: string;
|
|
266
267
|
value: string;
|
|
267
268
|
}[];
|
|
268
|
-
authorizations: string[];
|
|
269
269
|
finalize: string;
|
|
270
270
|
}>;
|
|
271
271
|
export type CheckStatusOfOrderResponseData = z.infer<typeof CheckStatusOfOrderResponseSchema>;
|
|
@@ -293,26 +293,26 @@ export declare const FinalizeOrderResponseSchema: z.ZodObject<{
|
|
|
293
293
|
certificate: string;
|
|
294
294
|
status: string;
|
|
295
295
|
expires: string;
|
|
296
|
+
authorizations: string[];
|
|
296
297
|
notBefore: string;
|
|
297
298
|
notAfter: string;
|
|
298
299
|
identifiers: {
|
|
299
300
|
type: string;
|
|
300
301
|
value: string;
|
|
301
302
|
}[];
|
|
302
|
-
authorizations: string[];
|
|
303
303
|
finalize: string;
|
|
304
304
|
}, {
|
|
305
305
|
id: string;
|
|
306
306
|
certificate: string;
|
|
307
307
|
status: string;
|
|
308
308
|
expires: string;
|
|
309
|
+
authorizations: string[];
|
|
309
310
|
notBefore: string;
|
|
310
311
|
notAfter: string;
|
|
311
312
|
identifiers: {
|
|
312
313
|
type: string;
|
|
313
314
|
value: string;
|
|
314
315
|
}[];
|
|
315
|
-
authorizations: string[];
|
|
316
316
|
finalize: string;
|
|
317
317
|
}>;
|
|
318
318
|
export type FinalizeOrderResponseData = z.infer<typeof FinalizeOrderResponseSchema>;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { APIClient } from '@wireapp/api-client';
|
|
2
1
|
import { E2eiEnrollment, Ciphersuite, CoreCrypto, RotateBundle, WireIdentity, E2eiConversationState, CredentialType } from '@wireapp/core-crypto';
|
|
3
|
-
import { E2EIServiceExternal } from './E2EIServiceExternal';
|
|
4
|
-
import { NewCrlDistributionPointsPayload } from '../MLSService/MLSService.types';
|
|
5
2
|
/**
|
|
6
3
|
* Proxy types relevant to the E2EIService from CoreCrypto
|
|
7
4
|
*/
|
|
@@ -22,25 +19,4 @@ export type User = {
|
|
|
22
19
|
export type Account = Uint8Array;
|
|
23
20
|
export type Nonce = string;
|
|
24
21
|
export type KeyAuth = NewAcmeAuthzOriginal['keyauth'];
|
|
25
|
-
export interface FinishOidcChallengeParams {
|
|
26
|
-
oidcChallenge: AcmeChallenge;
|
|
27
|
-
nonce: Nonce;
|
|
28
|
-
account: Account;
|
|
29
|
-
}
|
|
30
|
-
export interface GetNewCertificateParams {
|
|
31
|
-
discoveryUrl: string;
|
|
32
|
-
}
|
|
33
|
-
export interface InitParams {
|
|
34
|
-
apiClient: APIClient;
|
|
35
|
-
coreCryptClient: CoreCrypto;
|
|
36
|
-
e2eiServiceExternal: E2EIServiceExternal;
|
|
37
|
-
user?: User;
|
|
38
|
-
clientId?: string;
|
|
39
|
-
skipInit?: boolean;
|
|
40
|
-
/** number of seconds the certificate should be valid */
|
|
41
|
-
certificateTtl: number;
|
|
42
|
-
discoveryUrl?: string;
|
|
43
|
-
keyPackagesAmount: number;
|
|
44
|
-
dispatchNewCrlDistributionPoints: (payload: NewCrlDistributionPointsPayload) => void;
|
|
45
|
-
}
|
|
46
22
|
//# sourceMappingURL=E2EIService.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2EIService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,
|
|
1
|
+
{"version":3,"file":"E2EIService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2E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B,MAAM,MAAM,OAAO,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { APIClient } from '@wireapp/api-client';
|
|
2
|
+
import { CoreCrypto, RotateBundle } from './E2EIService.types';
|
|
3
3
|
import { InitialData } from './Storage/E2EIStorage.schema';
|
|
4
4
|
export declare class E2EIServiceInternal {
|
|
5
5
|
private readonly coreCryptoClient;
|
|
6
6
|
private readonly apiClient;
|
|
7
|
-
private readonly e2eiServiceExternal;
|
|
8
7
|
/** number of seconds the certificate should be valid */
|
|
9
8
|
private readonly certificateTtl;
|
|
10
9
|
private readonly keyPackagesAmount;
|
|
11
|
-
private readonly
|
|
12
|
-
private static instance;
|
|
10
|
+
private readonly initialData;
|
|
13
11
|
private readonly logger;
|
|
14
|
-
private
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
get acmeService(): AcmeService;
|
|
19
|
-
get initialData(): InitialData;
|
|
12
|
+
private acmeService;
|
|
13
|
+
constructor(coreCryptoClient: CoreCrypto, apiClient: APIClient,
|
|
14
|
+
/** number of seconds the certificate should be valid */
|
|
15
|
+
certificateTtl: number, keyPackagesAmount: number, initialData: InitialData);
|
|
20
16
|
startCertificateProcess(hasActiveCertificate: boolean): Promise<{
|
|
21
17
|
challenge: {
|
|
22
18
|
url: string;
|
|
@@ -34,7 +30,6 @@ export declare class E2EIServiceInternal {
|
|
|
34
30
|
*/
|
|
35
31
|
renewCertificate(oAuthIdToken: string, hasActiveCertificate: boolean): Promise<RotateBundle>;
|
|
36
32
|
private initIdentity;
|
|
37
|
-
private init;
|
|
38
33
|
private getDirectory;
|
|
39
34
|
private getInitialNonce;
|
|
40
35
|
/**
|
|
@@ -52,19 +47,6 @@ export declare class E2EIServiceInternal {
|
|
|
52
47
|
* @param oAuthIdToken
|
|
53
48
|
* @returns RotateBundle
|
|
54
49
|
*/
|
|
55
|
-
private
|
|
56
|
-
/**
|
|
57
|
-
* This function starts a new ACME enrollment flow for either a new client
|
|
58
|
-
* or a client that wants to refresh its certificate but has no valid refresh token
|
|
59
|
-
*/
|
|
60
|
-
private startNewOAuthFlow;
|
|
61
|
-
/**
|
|
62
|
-
* This function continues an ACME flow for either a new client
|
|
63
|
-
* or a client that wants to refresh its certificate but has no valid refresh token
|
|
64
|
-
*
|
|
65
|
-
* @param oAuthIdToken
|
|
66
|
-
* @returns RotateBundle | undefined
|
|
67
|
-
*/
|
|
68
|
-
private continueOAuthFlow;
|
|
50
|
+
private getRotateBundle;
|
|
69
51
|
}
|
|
70
52
|
//# sourceMappingURL=E2EIServiceInternal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2EIServiceInternal.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"E2EIServiceInternal.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAG9C,OAAO,EAA6B,UAAU,EAAkB,YAAY,EAAC,MAAM,qBAAqB,CAAC;AASzG,OAAO,EAAW,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEnE,qBAAa,mBAAmB;IAK5B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,wDAAwD;IACxD,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAT9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuD;IAC9E,OAAO,CAAC,WAAW,CAAc;gBAGd,gBAAgB,EAAE,UAAU,EAC5B,SAAS,EAAE,SAAS;IACrC,wDAAwD;IACvC,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,MAAM,EACzB,WAAW,EAAE,WAAW;IAM9B,uBAAuB,CAAC,oBAAoB,EAAE,OAAO;;;;;;;;IAkBrD,0BAA0B,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAYhG;;;;;OAKG;IACU,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO;YASnE,YAAY;YAuBZ,YAAY;YAUZ,eAAe;IAQ7B;;;;;OAKG;YACW,uBAAuB;IAyCrC;;;;;;;OAOG;YACW,eAAe;CA6D9B"}
|
|
@@ -35,59 +35,38 @@ const OidcChallenge_1 = require("./Steps/OidcChallenge");
|
|
|
35
35
|
const Order_1 = require("./Steps/Order");
|
|
36
36
|
const E2EIStorage_1 = require("./Storage/E2EIStorage");
|
|
37
37
|
class E2EIServiceInternal {
|
|
38
|
-
constructor(coreCryptoClient, apiClient,
|
|
38
|
+
constructor(coreCryptoClient, apiClient,
|
|
39
39
|
/** number of seconds the certificate should be valid */
|
|
40
|
-
certificateTtl, keyPackagesAmount,
|
|
40
|
+
certificateTtl, keyPackagesAmount, initialData) {
|
|
41
41
|
this.coreCryptoClient = coreCryptoClient;
|
|
42
42
|
this.apiClient = apiClient;
|
|
43
|
-
this.e2eiServiceExternal = e2eiServiceExternal;
|
|
44
43
|
this.certificateTtl = certificateTtl;
|
|
45
44
|
this.keyPackagesAmount = keyPackagesAmount;
|
|
46
|
-
this.
|
|
45
|
+
this.initialData = initialData;
|
|
47
46
|
this.logger = (0, logdown_1.default)('@wireapp/core/E2EIdentityServiceInternal');
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
static async getInstance(params) {
|
|
51
|
-
if (!E2EIServiceInternal.instance) {
|
|
52
|
-
if (!params) {
|
|
53
|
-
throw new Error('E2EIServiceInternal is not initialized. Please call getInstance with params.');
|
|
54
|
-
}
|
|
55
|
-
const { skipInit = false, coreCryptClient, apiClient, e2eiServiceExternal, keyPackagesAmount, dispatchNewCrlDistributionPoints, certificateTtl, } = params;
|
|
56
|
-
E2EIServiceInternal.instance = new E2EIServiceInternal(coreCryptClient, apiClient, e2eiServiceExternal, certificateTtl, keyPackagesAmount, dispatchNewCrlDistributionPoints);
|
|
57
|
-
if (!skipInit) {
|
|
58
|
-
const { discoveryUrl, user, clientId } = params;
|
|
59
|
-
if (!discoveryUrl || !user || !clientId) {
|
|
60
|
-
throw new Error('discoveryUrl, user and clientId are required to initialize E2EIServiceInternal');
|
|
61
|
-
}
|
|
62
|
-
await E2EIServiceInternal.instance.init({ clientId, discoveryUrl, user });
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return E2EIServiceInternal.instance;
|
|
66
|
-
}
|
|
67
|
-
get acmeService() {
|
|
68
|
-
if (!this._acmeService) {
|
|
69
|
-
throw new Error('Error while trying to get AcmeService. E2EIServiceInternal has not been initialized');
|
|
70
|
-
}
|
|
71
|
-
return this._acmeService;
|
|
72
|
-
}
|
|
73
|
-
get initialData() {
|
|
74
|
-
if (!this._initialData) {
|
|
75
|
-
throw new Error('Error while trying to get InitialData. E2EIServiceInternal has not been initialized');
|
|
76
|
-
}
|
|
77
|
-
return this._initialData;
|
|
47
|
+
const { discoveryUrl } = initialData;
|
|
48
|
+
this.acmeService = new AcmeServer_1.AcmeService(discoveryUrl);
|
|
78
49
|
}
|
|
79
50
|
async startCertificateProcess(hasActiveCertificate) {
|
|
80
|
-
// Step 0: Check if we have a handle in local storage
|
|
81
|
-
// If we don't have a handle, we need to start a new OAuth flow
|
|
82
51
|
const identity = await this.initIdentity(hasActiveCertificate);
|
|
83
|
-
|
|
52
|
+
// Store the values in local storage for later use (e.g. in the continue flow)
|
|
53
|
+
const { orderUrl, authChallenges } = await this.getEnrollmentChallenges(identity);
|
|
54
|
+
const { authorization: { keyauth, oidcChallenge }, } = authChallenges;
|
|
55
|
+
// store auth data for continuing the flow later on
|
|
56
|
+
const handle = await this.coreCryptoClient.e2eiEnrollmentStash(identity);
|
|
57
|
+
E2EIStorage_1.E2EIStorage.store.handle(bazinga64_1.Encoder.toBase64(handle).asString);
|
|
58
|
+
E2EIStorage_1.E2EIStorage.store.authData(authChallenges);
|
|
59
|
+
E2EIStorage_1.E2EIStorage.store.orderData({ orderUrl });
|
|
60
|
+
return { challenge: oidcChallenge, keyAuth: keyauth };
|
|
84
61
|
}
|
|
85
62
|
async continueCertificateProcess(oAuthIdToken) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
63
|
+
const handle = E2EIStorage_1.E2EIStorage.get.handle();
|
|
64
|
+
const identity = await this.coreCryptoClient.e2eiEnrollmentStashPop(bazinga64_1.Decoder.fromBase64(handle).asBytes);
|
|
65
|
+
if (!identity) {
|
|
66
|
+
throw new Error('Error while trying to continue OAuth flow. No enrollment in progress found');
|
|
89
67
|
}
|
|
90
|
-
|
|
68
|
+
const authData = E2EIStorage_1.E2EIStorage.get.authData();
|
|
69
|
+
return this.getRotateBundle(identity, oAuthIdToken, authData);
|
|
91
70
|
}
|
|
92
71
|
/**
|
|
93
72
|
* This function starts a ACME refresh flow for an existing client with a valid refresh token
|
|
@@ -98,7 +77,7 @@ class E2EIServiceInternal {
|
|
|
98
77
|
async renewCertificate(oAuthIdToken, hasActiveCertificate) {
|
|
99
78
|
const identity = await this.initIdentity(hasActiveCertificate);
|
|
100
79
|
const authData = await this.getEnrollmentChallenges(identity);
|
|
101
|
-
return this.
|
|
80
|
+
return this.getRotateBundle(identity, oAuthIdToken, authData.authChallenges);
|
|
102
81
|
}
|
|
103
82
|
// ############ Internal Functions ############
|
|
104
83
|
async initIdentity(hasActiveCertificate) {
|
|
@@ -109,14 +88,6 @@ class E2EIServiceInternal {
|
|
|
109
88
|
? this.coreCryptoClient.e2eiNewRotateEnrollment(this.certificateTtl, ciphersuite, user.displayName, user.handle, user.teamId)
|
|
110
89
|
: this.coreCryptoClient.e2eiNewActivationEnrollment(user.displayName, user.handle, this.certificateTtl, ciphersuite, user.teamId);
|
|
111
90
|
}
|
|
112
|
-
async init(params) {
|
|
113
|
-
const { user, clientId, discoveryUrl } = params;
|
|
114
|
-
if (!user || !clientId) {
|
|
115
|
-
throw new Error('user and clientId are required to initialize E2eIdentityService');
|
|
116
|
-
}
|
|
117
|
-
this._initialData = { user, clientId, discoveryUrl };
|
|
118
|
-
this._acmeService = new AcmeServer_1.AcmeService(discoveryUrl);
|
|
119
|
-
}
|
|
120
91
|
async getDirectory(identity, connection) {
|
|
121
92
|
const directory = await connection.getDirectory();
|
|
122
93
|
if (directory) {
|
|
@@ -181,7 +152,7 @@ class E2EIServiceInternal {
|
|
|
181
152
|
* @param oAuthIdToken
|
|
182
153
|
* @returns RotateBundle
|
|
183
154
|
*/
|
|
184
|
-
async
|
|
155
|
+
async getRotateBundle(identity, oAuthIdToken, authData) {
|
|
185
156
|
// Step 7: Do OIDC client challenge
|
|
186
157
|
const oidcData = await (0, OidcChallenge_1.doWireOidcChallenge)({
|
|
187
158
|
oAuthIdToken,
|
|
@@ -190,7 +161,7 @@ class E2EIServiceInternal {
|
|
|
190
161
|
identity,
|
|
191
162
|
nonce: authData.nonce,
|
|
192
163
|
});
|
|
193
|
-
this.logger.log('
|
|
164
|
+
this.logger.log('oidc data', oidcData);
|
|
194
165
|
if (!oidcData.data.validated) {
|
|
195
166
|
throw new Error('Error while trying to continue OAuth flow. OIDC challenge not validated');
|
|
196
167
|
}
|
|
@@ -206,7 +177,7 @@ class E2EIServiceInternal {
|
|
|
206
177
|
expirySecs: 30,
|
|
207
178
|
nonce: oidcData.nonce,
|
|
208
179
|
});
|
|
209
|
-
this.logger.log('
|
|
180
|
+
this.logger.log('dpop data', dpopData);
|
|
210
181
|
if (!(0, Helper_1.isResponseStatusValid)(dpopData.data.status)) {
|
|
211
182
|
throw new Error('Error while trying to continue OAuth flow. DPOP challenge not validated');
|
|
212
183
|
}
|
|
@@ -232,45 +203,7 @@ class E2EIServiceInternal {
|
|
|
232
203
|
throw new Error('Error while trying to continue OAuth flow. No certificate received');
|
|
233
204
|
}
|
|
234
205
|
// Step 10: Initialize MLS with the certificate
|
|
235
|
-
|
|
236
|
-
this.dispatchNewCrlDistributionPoints(rotateBundle);
|
|
237
|
-
return rotateBundle;
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* This function starts a new ACME enrollment flow for either a new client
|
|
241
|
-
* or a client that wants to refresh its certificate but has no valid refresh token
|
|
242
|
-
*/
|
|
243
|
-
async startNewOAuthFlow(identity) {
|
|
244
|
-
if (this.e2eiServiceExternal.isEnrollmentInProgress()) {
|
|
245
|
-
throw new Error('Error while trying to start OAuth flow. There is already a flow in progress');
|
|
246
|
-
}
|
|
247
|
-
const { authChallenges, orderUrl } = await this.getEnrollmentChallenges(identity);
|
|
248
|
-
const { authorization: { oidcChallenge: wireOidcChallenge, keyauth }, } = authChallenges;
|
|
249
|
-
if (!wireOidcChallenge || !keyauth) {
|
|
250
|
-
throw new Error('missing wireOidcChallenge or keyauth');
|
|
251
|
-
}
|
|
252
|
-
// stash the identity for later use
|
|
253
|
-
const handle = await this.coreCryptoClient.e2eiEnrollmentStash(identity);
|
|
254
|
-
// Store the values in local storage for later use (e.g. in the continue flow)
|
|
255
|
-
E2EIStorage_1.E2EIStorage.store.handle(bazinga64_1.Encoder.toBase64(handle).asString);
|
|
256
|
-
E2EIStorage_1.E2EIStorage.store.authData(authChallenges);
|
|
257
|
-
E2EIStorage_1.E2EIStorage.store.orderData({ orderUrl });
|
|
258
|
-
// we need to pass back the aquired wireOidcChallenge to the UI
|
|
259
|
-
return { challenge: wireOidcChallenge, keyAuth: keyauth };
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* This function continues an ACME flow for either a new client
|
|
263
|
-
* or a client that wants to refresh its certificate but has no valid refresh token
|
|
264
|
-
*
|
|
265
|
-
* @param oAuthIdToken
|
|
266
|
-
* @returns RotateBundle | undefined
|
|
267
|
-
*/
|
|
268
|
-
async continueOAuthFlow(oAuthIdToken) {
|
|
269
|
-
const handle = E2EIStorage_1.E2EIStorage.get.handle();
|
|
270
|
-
const authData = E2EIStorage_1.E2EIStorage.get.authData();
|
|
271
|
-
const identity = await this.coreCryptoClient.e2eiEnrollmentStashPop(bazinga64_1.Decoder.fromBase64(handle).asBytes);
|
|
272
|
-
this.logger.log('retrieved identity from stash');
|
|
273
|
-
return this.getRotateBundleAndStoreCertificateData(identity, oAuthIdToken, authData);
|
|
206
|
+
return this.coreCryptoClient.e2eiRotateAll(identity, certificate, this.keyPackagesAmount);
|
|
274
207
|
}
|
|
275
208
|
}
|
|
276
209
|
exports.E2EIServiceInternal = E2EIServiceInternal;
|
|
@@ -10,7 +10,7 @@ import { MLSServiceConfig } from './MLSService.types';
|
|
|
10
10
|
import { KeyPackageClaimUser } from '../../../conversation';
|
|
11
11
|
import { CoreDatabase } from '../../../storage/CoreDB';
|
|
12
12
|
import { RecurringTaskScheduler } from '../../../util/RecurringTaskScheduler';
|
|
13
|
-
import { AcmeChallenge,
|
|
13
|
+
import { AcmeChallenge, User } from '../E2EIdentityService';
|
|
14
14
|
import { ClientId, HandlePendingProposalsParams } from '../types';
|
|
15
15
|
export declare const optionalToUint8Array: (array: Uint8Array | []) => Uint8Array;
|
|
16
16
|
type EnrollmentProcessState = {
|
|
@@ -223,7 +223,7 @@ export declare class MLSService extends TypedEventEmitter<Events> {
|
|
|
223
223
|
* @param oAuthIdToken The OAuth id token if the user is already authenticated
|
|
224
224
|
* @returns AcmeChallenge if the user is not authenticated, true if the user is authenticated
|
|
225
225
|
*/
|
|
226
|
-
enrollE2EI(discoveryUrl: string,
|
|
226
|
+
enrollE2EI(discoveryUrl: string, user: User, client: RegisteredClient, nbPrekeys: number, certificateTtl: number, oAuthIdToken?: string): Promise<EnrollmentProcessState>;
|
|
227
227
|
}
|
|
228
228
|
export {};
|
|
229
229
|
//# sourceMappingURL=MLSService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MLSService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAqB,gBAAgB,EAAC,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAC,sBAAsB,EAAE,kBAAkB,EAAC,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAAC,8BAA8B,EAAE,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAE1G,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAIzD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAW,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACL,eAAe,EAIf,cAAc,EACd,UAAU,EAEV,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAC,gBAAgB,EAAuD,MAAM,oBAAoB,CAAC;AAE1G,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAC,sBAAsB,EAAC,MAAM,sCAAsC,CAAC;AAE5E,OAAO,EAAC,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"MLSService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAqB,gBAAgB,EAAC,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAC,sBAAsB,EAAE,kBAAkB,EAAC,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAAC,8BAA8B,EAAE,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAE1G,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAIzD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAA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
664
|
* @param oAuthIdToken The OAuth id token if the user is already authenticated
|
|
665
665
|
* @returns AcmeChallenge if the user is not authenticated, true if the user is authenticated
|
|
666
666
|
*/
|
|
667
|
-
async enrollE2EI(discoveryUrl,
|
|
667
|
+
async enrollE2EI(discoveryUrl, user, client, nbPrekeys, certificateTtl, oAuthIdToken) {
|
|
668
668
|
const hasActiveCertificate = await this.coreCryptoClient.e2eiIsEnabled(this.config.cipherSuite);
|
|
669
|
-
const
|
|
670
|
-
apiClient: this.apiClient,
|
|
671
|
-
coreCryptClient: this.coreCryptoClient,
|
|
672
|
-
e2eiServiceExternal,
|
|
673
|
-
user,
|
|
674
|
-
clientId: client.id,
|
|
675
|
-
discoveryUrl,
|
|
676
|
-
keyPackagesAmount: nbPrekeys,
|
|
677
|
-
dispatchNewCrlDistributionPoints: payload => this.dispatchNewCrlDistributionPoints(payload),
|
|
678
|
-
certificateTtl,
|
|
679
|
-
});
|
|
669
|
+
const e2eiServiceInternal = new E2EIServiceInternal_1.E2EIServiceInternal(this.coreCryptoClient, this.apiClient, certificateTtl, nbPrekeys, { user, clientId: client.id, discoveryUrl });
|
|
680
670
|
// If we don't have an OAuth id token, we need to start the certificate process with Oauth
|
|
681
671
|
if (!oAuthIdToken) {
|
|
682
|
-
const data = await
|
|
683
|
-
const oidcChallenge = data.challenge;
|
|
684
|
-
if (!oidcChallenge) {
|
|
685
|
-
throw new Error('Not oidc challenge found');
|
|
686
|
-
}
|
|
672
|
+
const data = await e2eiServiceInternal.startCertificateProcess(hasActiveCertificate);
|
|
687
673
|
return { status: 'authentication', authenticationChallenge: data };
|
|
688
674
|
}
|
|
689
675
|
// If we have an OAuth id token, we can continue the certificate process / start a refresh
|
|
690
676
|
const rotateBundle = !hasActiveCertificate
|
|
691
677
|
? // If we are not refreshing the active certificate, we need to continue the certificate process with Oauth
|
|
692
|
-
await
|
|
678
|
+
await e2eiServiceInternal.continueCertificateProcess(oAuthIdToken)
|
|
693
679
|
: // If we are refreshing the active certificate, can start the refresh process
|
|
694
|
-
await
|
|
680
|
+
await e2eiServiceInternal.renewCertificate(oAuthIdToken, hasActiveCertificate);
|
|
695
681
|
if (rotateBundle === undefined) {
|
|
696
682
|
throw new Error('Could not get the rotate bundle');
|
|
697
683
|
}
|
package/package.json
CHANGED