@workos-inc/node 7.48.0 → 7.50.0
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/common/interfaces/event.interface.d.ts +11 -2
- package/lib/common/serializers/event.serializer.js +3 -0
- package/lib/user-management/interfaces/authentication-radar-risk-detected-event.interface.d.ts +20 -0
- package/lib/user-management/interfaces/authentication-radar-risk-detected-event.interface.js +2 -0
- package/lib/user-management/interfaces/authorization-url-options.interface.d.ts +4 -0
- package/lib/user-management/interfaces/index.d.ts +1 -0
- package/lib/user-management/interfaces/index.js +1 -0
- package/lib/user-management/serializers/authentication-radar-risk-event-serializer.d.ts +2 -0
- package/lib/user-management/serializers/authentication-radar-risk-event-serializer.js +14 -0
- package/lib/user-management/user-management.js +4 -0
- package/lib/vault/cryptography/decrypt.d.ts +1 -1
- package/lib/vault/cryptography/decrypt.js +5 -3
- package/lib/vault/cryptography/encrypt.d.ts +1 -1
- package/lib/vault/cryptography/encrypt.js +4 -2
- package/lib/vault/vault-live-test.spec.js +15 -0
- package/lib/vault/vault.d.ts +2 -2
- package/lib/vault/vault.js +4 -4
- package/lib/workos.js +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import { AuthenticationEvent, AuthenticationEventResponse, EmailVerificationEven
|
|
|
5
5
|
import { OrganizationMembership, OrganizationMembershipResponse } from '../../user-management/interfaces/organization-membership.interface';
|
|
6
6
|
import { RoleEvent, RoleEventResponse } from '../../roles/interfaces/role.interface';
|
|
7
7
|
import { OrganizationDomain, OrganizationDomainResponse } from '../../organization-domains/interfaces';
|
|
8
|
+
import { AuthenticationRadarRiskDetectedEventData, AuthenticationRadarRiskDetectedEventResponseData } from '../../user-management/interfaces/authentication-radar-risk-detected-event.interface';
|
|
8
9
|
export interface EventBase {
|
|
9
10
|
id: string;
|
|
10
11
|
createdAt: string;
|
|
@@ -77,6 +78,14 @@ export interface AuthenticationPasswordSucceededEventResponse extends EventRespo
|
|
|
77
78
|
event: 'authentication.password_succeeded';
|
|
78
79
|
data: AuthenticationEventResponse;
|
|
79
80
|
}
|
|
81
|
+
export interface AuthenticationRadarRiskDetectedEvent extends EventBase {
|
|
82
|
+
event: 'authentication.radar_risk_detected';
|
|
83
|
+
data: AuthenticationRadarRiskDetectedEventData;
|
|
84
|
+
}
|
|
85
|
+
export interface AuthenticationRadarRiskDetectedEventResponse extends EventResponseBase {
|
|
86
|
+
event: 'authentication.radar_risk_detected';
|
|
87
|
+
data: AuthenticationRadarRiskDetectedEventResponseData;
|
|
88
|
+
}
|
|
80
89
|
export interface AuthenticationSSOFailedEvent extends EventBase {
|
|
81
90
|
event: 'authentication.sso_failed';
|
|
82
91
|
data: AuthenticationEvent;
|
|
@@ -409,7 +418,7 @@ export interface OrganizationDomainVerificationFailedEventResponse extends Event
|
|
|
409
418
|
event: 'organization_domain.verification_failed';
|
|
410
419
|
data: OrganizationDomainResponse;
|
|
411
420
|
}
|
|
412
|
-
export type Event = AuthenticationEmailVerificationSucceededEvent | AuthenticationMfaSucceededEvent | AuthenticationOAuthFailedEvent | AuthenticationOAuthSucceededEvent | AuthenticationSSOFailedEvent | AuthenticationSSOSucceededEvent | AuthenticationPasswordFailedEvent | AuthenticationPasswordSucceededEvent | AuthenticationMagicAuthFailedEvent | AuthenticationMagicAuthSucceededEvent | ConnectionActivatedEvent | ConnectionDeactivatedEvent | ConnectionDeletedEvent | DsyncActivatedEvent | DsyncDeactivatedEvent | DsyncDeletedEvent | DsyncGroupCreatedEvent | DsyncGroupUpdatedEvent | DsyncGroupDeletedEvent | DsyncGroupUserAddedEvent | DsyncGroupUserRemovedEvent | DsyncUserCreatedEvent | DsyncUserUpdatedEvent | DsyncUserDeletedEvent | EmailVerificationCreatedEvent | InvitationCreatedEvent | MagicAuthCreatedEvent | PasswordResetCreatedEvent | PasswordResetSucceededEvent | UserCreatedEvent | UserUpdatedEvent | UserDeletedEvent | OrganizationMembershipAdded | OrganizationMembershipCreated | OrganizationMembershipDeleted | OrganizationMembershipUpdated | OrganizationMembershipRemoved | RoleCreatedEvent | RoleDeletedEvent | RoleUpdatedEvent | SessionCreatedEvent | OrganizationCreatedEvent | OrganizationUpdatedEvent | OrganizationDeletedEvent | OrganizationDomainVerifiedEvent | OrganizationDomainVerificationFailedEvent;
|
|
413
|
-
export type EventResponse = AuthenticationEmailVerificationSucceededEventResponse | AuthenticationMagicAuthFailedEventResponse | AuthenticationMagicAuthSucceededEventResponse | AuthenticationMfaSucceededEventResponse | AuthenticationOAuthFailedEventResponse | AuthenticationOAuthSucceededEventResponse | AuthenticationPasswordFailedEventResponse | AuthenticationPasswordSucceededEventResponse | AuthenticationSSOFailedEventResponse | AuthenticationSSOSucceededEventResponse | ConnectionActivatedEventResponse | ConnectionDeactivatedEventResponse | ConnectionDeletedEventResponse | DsyncActivatedEventResponse | DsyncDeactivatedEventResponse | DsyncDeletedEventResponse | DsyncGroupCreatedEventResponse | DsyncGroupUpdatedEventResponse | DsyncGroupDeletedEventResponse | DsyncGroupUserAddedEventResponse | DsyncGroupUserRemovedEventResponse | DsyncUserCreatedEventResponse | DsyncUserUpdatedEventResponse | DsyncUserDeletedEventResponse | EmailVerificationCreatedEventResponse | InvitationCreatedEventResponse | MagicAuthCreatedEventResponse | PasswordResetCreatedEventResponse | PasswordResetSucceededEventResponse | UserCreatedEventResponse | UserUpdatedEventResponse | UserDeletedEventResponse | OrganizationMembershipAddedResponse | OrganizationMembershipCreatedResponse | OrganizationMembershipDeletedResponse | OrganizationMembershipUpdatedResponse | OrganizationMembershipRemovedResponse | RoleCreatedEventResponse | RoleDeletedEventResponse | RoleUpdatedEventResponse | SessionCreatedEventResponse | OrganizationCreatedResponse | OrganizationUpdatedResponse | OrganizationDeletedResponse | OrganizationDomainVerifiedEventResponse | OrganizationDomainVerificationFailedEventResponse;
|
|
421
|
+
export type Event = AuthenticationEmailVerificationSucceededEvent | AuthenticationMfaSucceededEvent | AuthenticationOAuthFailedEvent | AuthenticationOAuthSucceededEvent | AuthenticationSSOFailedEvent | AuthenticationSSOSucceededEvent | AuthenticationPasswordFailedEvent | AuthenticationPasswordSucceededEvent | AuthenticationMagicAuthFailedEvent | AuthenticationMagicAuthSucceededEvent | AuthenticationRadarRiskDetectedEvent | ConnectionActivatedEvent | ConnectionDeactivatedEvent | ConnectionDeletedEvent | DsyncActivatedEvent | DsyncDeactivatedEvent | DsyncDeletedEvent | DsyncGroupCreatedEvent | DsyncGroupUpdatedEvent | DsyncGroupDeletedEvent | DsyncGroupUserAddedEvent | DsyncGroupUserRemovedEvent | DsyncUserCreatedEvent | DsyncUserUpdatedEvent | DsyncUserDeletedEvent | EmailVerificationCreatedEvent | InvitationCreatedEvent | MagicAuthCreatedEvent | PasswordResetCreatedEvent | PasswordResetSucceededEvent | UserCreatedEvent | UserUpdatedEvent | UserDeletedEvent | OrganizationMembershipAdded | OrganizationMembershipCreated | OrganizationMembershipDeleted | OrganizationMembershipUpdated | OrganizationMembershipRemoved | RoleCreatedEvent | RoleDeletedEvent | RoleUpdatedEvent | SessionCreatedEvent | OrganizationCreatedEvent | OrganizationUpdatedEvent | OrganizationDeletedEvent | OrganizationDomainVerifiedEvent | OrganizationDomainVerificationFailedEvent;
|
|
422
|
+
export type EventResponse = AuthenticationEmailVerificationSucceededEventResponse | AuthenticationMagicAuthFailedEventResponse | AuthenticationMagicAuthSucceededEventResponse | AuthenticationMfaSucceededEventResponse | AuthenticationOAuthFailedEventResponse | AuthenticationOAuthSucceededEventResponse | AuthenticationPasswordFailedEventResponse | AuthenticationPasswordSucceededEventResponse | AuthenticationSSOFailedEventResponse | AuthenticationSSOSucceededEventResponse | AuthenticationRadarRiskDetectedEventResponse | ConnectionActivatedEventResponse | ConnectionDeactivatedEventResponse | ConnectionDeletedEventResponse | DsyncActivatedEventResponse | DsyncDeactivatedEventResponse | DsyncDeletedEventResponse | DsyncGroupCreatedEventResponse | DsyncGroupUpdatedEventResponse | DsyncGroupDeletedEventResponse | DsyncGroupUserAddedEventResponse | DsyncGroupUserRemovedEventResponse | DsyncUserCreatedEventResponse | DsyncUserUpdatedEventResponse | DsyncUserDeletedEventResponse | EmailVerificationCreatedEventResponse | InvitationCreatedEventResponse | MagicAuthCreatedEventResponse | PasswordResetCreatedEventResponse | PasswordResetSucceededEventResponse | UserCreatedEventResponse | UserUpdatedEventResponse | UserDeletedEventResponse | OrganizationMembershipAddedResponse | OrganizationMembershipCreatedResponse | OrganizationMembershipDeletedResponse | OrganizationMembershipUpdatedResponse | OrganizationMembershipRemovedResponse | RoleCreatedEventResponse | RoleDeletedEventResponse | RoleUpdatedEventResponse | SessionCreatedEventResponse | OrganizationCreatedResponse | OrganizationUpdatedResponse | OrganizationDeletedResponse | OrganizationDomainVerifiedEventResponse | OrganizationDomainVerificationFailedEventResponse;
|
|
414
423
|
export type EventName = Event['event'];
|
|
415
424
|
export {};
|
|
@@ -9,6 +9,7 @@ const organization_domain_serializer_1 = require("../../organization-domains/ser
|
|
|
9
9
|
const organization_membership_serializer_1 = require("../../user-management/serializers/organization-membership.serializer");
|
|
10
10
|
const role_serializer_1 = require("../../user-management/serializers/role.serializer");
|
|
11
11
|
const session_serializer_1 = require("../../user-management/serializers/session.serializer");
|
|
12
|
+
const authentication_radar_risk_event_serializer_1 = require("../../user-management/serializers/authentication-radar-risk-event-serializer");
|
|
12
13
|
const deserializeEvent = (event) => {
|
|
13
14
|
const eventBase = {
|
|
14
15
|
id: event.id,
|
|
@@ -26,6 +27,8 @@ const deserializeEvent = (event) => {
|
|
|
26
27
|
case 'authentication.sso_failed':
|
|
27
28
|
case 'authentication.sso_succeeded':
|
|
28
29
|
return Object.assign(Object.assign({}, eventBase), { event: event.event, data: (0, serializers_4.deserializeAuthenticationEvent)(event.data) });
|
|
30
|
+
case 'authentication.radar_risk_detected':
|
|
31
|
+
return Object.assign(Object.assign({}, eventBase), { event: event.event, data: (0, authentication_radar_risk_event_serializer_1.deserializeAuthenticationRadarRiskDetectedEvent)(event.data) });
|
|
29
32
|
case 'connection.activated':
|
|
30
33
|
case 'connection.deactivated':
|
|
31
34
|
case 'connection.deleted':
|
package/lib/user-management/interfaces/authentication-radar-risk-detected-event.interface.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type AuthenticationRadarRiskDetectedEventData = {
|
|
2
|
+
authMethod: string;
|
|
3
|
+
action: 'signup' | 'login';
|
|
4
|
+
control: string | null;
|
|
5
|
+
blocklistType: string | null;
|
|
6
|
+
ipAddress: string | null;
|
|
7
|
+
userAgent: string | null;
|
|
8
|
+
userId: string;
|
|
9
|
+
email: string;
|
|
10
|
+
};
|
|
11
|
+
export interface AuthenticationRadarRiskDetectedEventResponseData {
|
|
12
|
+
auth_method: string;
|
|
13
|
+
action: 'signup' | 'login';
|
|
14
|
+
control: string | null;
|
|
15
|
+
blocklist_type: string | null;
|
|
16
|
+
ip_address: string | null;
|
|
17
|
+
user_agent: string | null;
|
|
18
|
+
user_id: string;
|
|
19
|
+
email: string;
|
|
20
|
+
}
|
|
@@ -3,6 +3,10 @@ export interface AuthorizationURLOptions {
|
|
|
3
3
|
codeChallenge?: string;
|
|
4
4
|
codeChallengeMethod?: 'S256';
|
|
5
5
|
connectionId?: string;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated We previously required initiate login endpoints to return the `context`
|
|
8
|
+
* query parameter when getting the authorization URL. This is no longer necessary.
|
|
9
|
+
*/
|
|
6
10
|
context?: string;
|
|
7
11
|
organizationId?: string;
|
|
8
12
|
domainHint?: string;
|
|
@@ -9,6 +9,7 @@ export * from './authenticate-with-session-cookie.interface';
|
|
|
9
9
|
export * from './authenticate-with-totp-options.interface';
|
|
10
10
|
export * from './authentication-event.interface';
|
|
11
11
|
export * from './authentication-response.interface';
|
|
12
|
+
export * from './authentication-radar-risk-detected-event.interface';
|
|
12
13
|
export * from './create-magic-auth-options.interface';
|
|
13
14
|
export * from './create-organization-membership-options.interface';
|
|
14
15
|
export * from './create-password-reset-options.interface';
|
|
@@ -25,6 +25,7 @@ __exportStar(require("./authenticate-with-session-cookie.interface"), exports);
|
|
|
25
25
|
__exportStar(require("./authenticate-with-totp-options.interface"), exports);
|
|
26
26
|
__exportStar(require("./authentication-event.interface"), exports);
|
|
27
27
|
__exportStar(require("./authentication-response.interface"), exports);
|
|
28
|
+
__exportStar(require("./authentication-radar-risk-detected-event.interface"), exports);
|
|
28
29
|
__exportStar(require("./create-magic-auth-options.interface"), exports);
|
|
29
30
|
__exportStar(require("./create-organization-membership-options.interface"), exports);
|
|
30
31
|
__exportStar(require("./create-password-reset-options.interface"), exports);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { AuthenticationRadarRiskDetectedEventData, AuthenticationRadarRiskDetectedEventResponseData } from '../interfaces';
|
|
2
|
+
export declare const deserializeAuthenticationRadarRiskDetectedEvent: (authenticationRadarRiskDetectedEvent: AuthenticationRadarRiskDetectedEventResponseData) => AuthenticationRadarRiskDetectedEventData;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeAuthenticationRadarRiskDetectedEvent = void 0;
|
|
4
|
+
const deserializeAuthenticationRadarRiskDetectedEvent = (authenticationRadarRiskDetectedEvent) => ({
|
|
5
|
+
authMethod: authenticationRadarRiskDetectedEvent.auth_method,
|
|
6
|
+
action: authenticationRadarRiskDetectedEvent.action,
|
|
7
|
+
control: authenticationRadarRiskDetectedEvent.control,
|
|
8
|
+
blocklistType: authenticationRadarRiskDetectedEvent.blocklist_type,
|
|
9
|
+
ipAddress: authenticationRadarRiskDetectedEvent.ip_address,
|
|
10
|
+
userAgent: authenticationRadarRiskDetectedEvent.user_agent,
|
|
11
|
+
userId: authenticationRadarRiskDetectedEvent.user_id,
|
|
12
|
+
email: authenticationRadarRiskDetectedEvent.email,
|
|
13
|
+
});
|
|
14
|
+
exports.deserializeAuthenticationRadarRiskDetectedEvent = deserializeAuthenticationRadarRiskDetectedEvent;
|
|
@@ -526,6 +526,10 @@ class UserManagement {
|
|
|
526
526
|
if (provider !== 'authkit' && screenHint) {
|
|
527
527
|
throw new TypeError(`'screenHint' is only supported for 'authkit' provider`);
|
|
528
528
|
}
|
|
529
|
+
if (context) {
|
|
530
|
+
this.workos.emitWarning(`\`context\` is deprecated. We previously required initiate login endpoints to return the
|
|
531
|
+
\`context\` query parameter when getting the authorization URL. This is no longer necessary.`);
|
|
532
|
+
}
|
|
529
533
|
const query = toQueryString({
|
|
530
534
|
connection_id: connectionId,
|
|
531
535
|
code_challenge: codeChallenge,
|
|
@@ -5,5 +5,5 @@ export interface Decoded {
|
|
|
5
5
|
keys: string;
|
|
6
6
|
ciphertext: Buffer;
|
|
7
7
|
}
|
|
8
|
-
export declare const decrypt: (payload: string | Decoded, dataKey: string) => string;
|
|
8
|
+
export declare const decrypt: (payload: string | Decoded, dataKey: string, aad: string) => string;
|
|
9
9
|
export declare const decode: (payload: string) => Decoded;
|
|
@@ -6,14 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.decode = exports.decrypt = void 0;
|
|
7
7
|
const crypto_1 = __importDefault(require("crypto"));
|
|
8
8
|
const leb_1 = require("leb");
|
|
9
|
-
const decrypt = (payload, dataKey) => {
|
|
9
|
+
const decrypt = (payload, dataKey, aad) => {
|
|
10
10
|
if (typeof payload === 'string') {
|
|
11
11
|
payload = (0, exports.decode)(payload);
|
|
12
12
|
}
|
|
13
13
|
const { iv, tag, ciphertext } = payload;
|
|
14
14
|
const key = Buffer.from(dataKey, 'base64');
|
|
15
|
-
const decipher = crypto_1.default
|
|
16
|
-
|
|
15
|
+
const decipher = crypto_1.default
|
|
16
|
+
.createDecipheriv('aes-256-gcm', key, iv)
|
|
17
|
+
.setAAD(Buffer.from(aad))
|
|
18
|
+
.setAuthTag(tag);
|
|
17
19
|
const decrypted = decipher.update(ciphertext, undefined, 'utf-8') + decipher.final('utf-8');
|
|
18
20
|
return decrypted;
|
|
19
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const encrypt: (data: string, dataKey: string, encryptedKeys: string) => string;
|
|
1
|
+
export declare const encrypt: (data: string, dataKey: string, encryptedKeys: string, aad: string) => string;
|
|
@@ -6,13 +6,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.encrypt = void 0;
|
|
7
7
|
const crypto_1 = __importDefault(require("crypto"));
|
|
8
8
|
const leb_1 = require("leb");
|
|
9
|
-
const encrypt = (data, dataKey, encryptedKeys) => {
|
|
9
|
+
const encrypt = (data, dataKey, encryptedKeys, aad) => {
|
|
10
10
|
// encrypt using the returned data key
|
|
11
11
|
const key = Buffer.from(dataKey, 'base64');
|
|
12
12
|
const keyBlob = Buffer.from(encryptedKeys, 'base64');
|
|
13
13
|
const prefixLen = (0, leb_1.encodeUInt32)(keyBlob.length);
|
|
14
14
|
const iv = crypto_1.default.randomBytes(32);
|
|
15
|
-
const cipher = crypto_1.default
|
|
15
|
+
const cipher = crypto_1.default
|
|
16
|
+
.createCipheriv('aes-256-gcm', key, iv)
|
|
17
|
+
.setAAD(Buffer.from(aad));
|
|
16
18
|
const ciphertext = Buffer.concat([
|
|
17
19
|
cipher.update(data, 'utf8'),
|
|
18
20
|
cipher.final(),
|
|
@@ -241,5 +241,20 @@ describe.skip('Vault Live Test', () => {
|
|
|
241
241
|
const decrypted = yield workos.vault.decrypt(encrypted);
|
|
242
242
|
expect(decrypted).toBe(superObject);
|
|
243
243
|
}));
|
|
244
|
+
it('authenticates additional data', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
245
|
+
const data = 'hot water freezes faster than cold water';
|
|
246
|
+
const keyContext = { everything: 'everywhere' };
|
|
247
|
+
const aad = 'seq1';
|
|
248
|
+
const encrypted = yield workos.vault.encrypt(data, keyContext, aad);
|
|
249
|
+
const decrypted = yield workos.vault.decrypt(encrypted, aad);
|
|
250
|
+
expect(decrypted).toBe(data);
|
|
251
|
+
}));
|
|
252
|
+
it('fails with invalid AD', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
253
|
+
const data = 'hot water freezes faster than cold water';
|
|
254
|
+
const keyContext = { everything: 'everywhere' };
|
|
255
|
+
const aad = 'seq1';
|
|
256
|
+
const encrypted = yield workos.vault.encrypt(data, keyContext, aad);
|
|
257
|
+
yield expect(() => workos.vault.decrypt(encrypted)).rejects.toThrow('unable to authenticate data');
|
|
258
|
+
}));
|
|
244
259
|
});
|
|
245
260
|
});
|
package/lib/vault/vault.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ export declare class Vault {
|
|
|
14
14
|
deleteObject(options: DeleteObjectOptions): Promise<void>;
|
|
15
15
|
createDataKey(options: CreateDataKeyOptions): Promise<DataKeyPair>;
|
|
16
16
|
decryptDataKey(options: DecryptDataKeyOptions): Promise<DataKey>;
|
|
17
|
-
encrypt(data: string, context: KeyContext): Promise<string>;
|
|
18
|
-
decrypt(encryptedData: string): Promise<string>;
|
|
17
|
+
encrypt(data: string, context: KeyContext, associatedData?: string): Promise<string>;
|
|
18
|
+
decrypt(encryptedData: string, associatedData?: string): Promise<string>;
|
|
19
19
|
createSecret: (options: CreateObjectOptions) => Promise<ObjectMetadata>;
|
|
20
20
|
listSecrets: (options?: PaginationOptions | undefined) => Promise<List<ObjectDigest>>;
|
|
21
21
|
listSecretVersions: (options: ReadObjectOptions) => Promise<ObjectVersion[]>;
|
package/lib/vault/vault.js
CHANGED
|
@@ -106,19 +106,19 @@ class Vault {
|
|
|
106
106
|
return (0, vault_key_serializer_1.deserializeDecryptDataKeyResponse)(data);
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
encrypt(data, context) {
|
|
109
|
+
encrypt(data, context, associatedData) {
|
|
110
110
|
return __awaiter(this, void 0, void 0, function* () {
|
|
111
111
|
const { dataKey, encryptedKeys } = yield this.createDataKey({
|
|
112
112
|
context,
|
|
113
113
|
});
|
|
114
|
-
return (0, encrypt_1.encrypt)(data, dataKey.key, encryptedKeys);
|
|
114
|
+
return (0, encrypt_1.encrypt)(data, dataKey.key, encryptedKeys, associatedData || '');
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
decrypt(encryptedData) {
|
|
117
|
+
decrypt(encryptedData, associatedData) {
|
|
118
118
|
return __awaiter(this, void 0, void 0, function* () {
|
|
119
119
|
const decoded = (0, decrypt_1.decode)(encryptedData);
|
|
120
120
|
const dataKey = yield this.decryptDataKey({ keys: decoded.keys });
|
|
121
|
-
return (0, decrypt_1.decrypt)(decoded, dataKey.key);
|
|
121
|
+
return (0, decrypt_1.decrypt)(decoded, dataKey.key, associatedData || '');
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
}
|
package/lib/workos.js
CHANGED
|
@@ -31,7 +31,7 @@ const widgets_1 = require("./widgets/widgets");
|
|
|
31
31
|
const actions_1 = require("./actions/actions");
|
|
32
32
|
const vault_1 = require("./vault/vault");
|
|
33
33
|
const conflict_exception_1 = require("./common/exceptions/conflict.exception");
|
|
34
|
-
const VERSION = '7.
|
|
34
|
+
const VERSION = '7.50.0';
|
|
35
35
|
const DEFAULT_HOSTNAME = 'api.workos.com';
|
|
36
36
|
const HEADER_AUTHORIZATION = 'Authorization';
|
|
37
37
|
const HEADER_IDEMPOTENCY_KEY = 'Idempotency-Key';
|
package/package.json
CHANGED