@cubist-labs/cubesigner-sdk 0.3.23 → 0.3.25
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/dist/cjs/package.json +1 -1
- package/dist/cjs/src/api.d.ts +4 -4
- package/dist/cjs/src/api.js +5 -4
- package/dist/cjs/src/client.d.ts +4 -4
- package/dist/cjs/src/client.js +2 -2
- package/dist/cjs/src/index.d.ts +0 -2
- package/dist/cjs/src/index.js +1 -3
- package/dist/cjs/src/org.d.ts +22 -1
- package/dist/cjs/src/org.js +1 -1
- package/dist/cjs/src/role.d.ts +2 -1
- package/dist/cjs/src/role.js +1 -1
- package/dist/cjs/src/schema.d.ts +29 -29
- package/dist/cjs/src/schema.js +1 -1
- package/dist/cjs/src/schema_types.d.ts +3 -1
- package/dist/cjs/src/schema_types.js +1 -1
- package/dist/esm/package.json +1 -1
- package/dist/esm/src/api.d.ts +4 -4
- package/dist/esm/src/api.js +5 -4
- package/dist/esm/src/client.d.ts +4 -4
- package/dist/esm/src/client.js +2 -2
- package/dist/esm/src/index.d.ts +0 -2
- package/dist/esm/src/index.js +1 -3
- package/dist/esm/src/org.d.ts +22 -1
- package/dist/esm/src/org.js +1 -1
- package/dist/esm/src/role.d.ts +2 -1
- package/dist/esm/src/role.js +1 -1
- package/dist/esm/src/schema.d.ts +29 -29
- package/dist/esm/src/schema.js +1 -1
- package/dist/esm/src/schema_types.d.ts +3 -1
- package/dist/esm/src/schema_types.js +1 -1
- package/package.json +1 -1
- package/src/api.ts +7 -6
- package/src/client.ts +3 -3
- package/src/index.ts +0 -2
- package/src/org.ts +23 -1
- package/src/role.ts +4 -3
- package/src/schema.ts +29 -29
- package/src/schema_types.ts +3 -1
- package/tsconfig.json +1 -0
- package/src/org_event_processor.ts +0 -173
|
@@ -29,7 +29,7 @@ export type MemberRole = schemas["MemberRole"];
|
|
|
29
29
|
export type SchemaKeyType = schemas["KeyType"];
|
|
30
30
|
export type ListKeysResponse = schemas["PaginatedListKeysResponse"];
|
|
31
31
|
export type UpdateKeyRequest = schemas["UpdateKeyRequest"];
|
|
32
|
-
export type
|
|
32
|
+
export type KeyProperties = schemas["CreateAndUpdateKeyProperties"];
|
|
33
33
|
export type CreateKeyRequest = schemas["CreateKeyRequest"];
|
|
34
34
|
export type KeyInfoApi = schemas["KeyInfo"];
|
|
35
35
|
export type KeyInRoleInfo = schemas["KeyInRoleInfo"];
|
|
@@ -83,6 +83,8 @@ export type UserExportKeyMaterial = schemas["JsonKeyPackage"];
|
|
|
83
83
|
export type Empty = schemas["EmptyImpl"];
|
|
84
84
|
/** Options for a new OIDC user */
|
|
85
85
|
export interface CreateOidcUserOptions {
|
|
86
|
+
/** Optional name */
|
|
87
|
+
name?: string | null;
|
|
86
88
|
/** The role of an OIDC user, default is "Alien" */
|
|
87
89
|
memberRole?: MemberRole;
|
|
88
90
|
/** Optional MFA policy to associate with the user account */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NoZW1hX3R5cGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3NjaGVtYV90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTWZhUG9saWN5IH0gZnJvbSBcIi4vcm9sZVwiO1xuaW1wb3J0IHsgY29tcG9uZW50cyB9IGZyb20gXCIuL3NjaGVtYVwiO1xuaW1wb3J0IHsgSnNvbk1hcCB9IGZyb20gXCIuL3V0aWxcIjtcblxudHlwZSBzY2hlbWFzID0gY29tcG9uZW50c1tcInNjaGVtYXNcIl07XG5cbmV4cG9ydCB0eXBlIFVzZXJJbmZvID0gc2NoZW1hc1tcIlVzZXJJbmZvXCJdO1xuZXhwb3J0IH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HggfSB8IHsgWDogQXZhWENoYWluVHggfTtcblxuLyoqIEF2YSBQLWNoYWluIHRyYW5zYWN0aW9uICovXG5leHBvcnQgdHlwZSBBdmFQQ2hhaW5UeCA9XG4gIHwgeyBBZGRQZXJtaXNzaW9ubGVzc1ZhbGlkYXRvcjogSnNvbk1hcCB9XG4gIHwgeyBBZGRTdWJuZXRWYWxpZGF0b3I6IEpzb25NYXAgfVxuICB8IHsgQWRkVmFsaWRhdG9yOiBKc29uTWFwIH1cbiAgfCB7IENyZWF0ZUNoYWluOiBKc29uTWFwIH1cbiAgfCB7IENyZWF0ZVN1Ym5ldDogSnNvbk1hcCB9XG4gIHwgeyBFeHBvcnQ6IEpzb25NYXAgfVxuICB8IHsgSW1wb3J0OiBKc29uTWFwIH07XG5cbi8qKiBBdmEgWC1jaGFpbiB0cmFuc2FjdGlvbiAqL1xuZXhwb3J0IHR5cGUgQXZhWENoYWluVHggPSB7IEJhc2U6IEpzb25NYXAgfSB8IHsgRXhwb3J0OiBKc29uTWFwIH0gfCB7IEltcG9ydDogSnNvbk1hcCB9O1xuIl19
|
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -74,7 +74,7 @@ import { KeyPolicy } from "./role";
|
|
|
74
74
|
import { EnvInterface } from "./env";
|
|
75
75
|
import { loadSubtleCrypto } from "./user_export";
|
|
76
76
|
import { EventEmitter } from "./events";
|
|
77
|
-
import { NAME,
|
|
77
|
+
import { NAME, KeyProperties, VERSION } from "./index";
|
|
78
78
|
|
|
79
79
|
/** @internal */
|
|
80
80
|
export type Client = ReturnType<typeof createClient<paths>>;
|
|
@@ -610,7 +610,7 @@ export class CubeSignerApi {
|
|
|
610
610
|
*/
|
|
611
611
|
async orgUserCreateOidc(
|
|
612
612
|
identity: OidcIdentity,
|
|
613
|
-
email
|
|
613
|
+
email?: string | null,
|
|
614
614
|
opts: CreateOidcUserOptions = {},
|
|
615
615
|
): Promise<string> {
|
|
616
616
|
const client = await this.client("createOidcUser");
|
|
@@ -619,8 +619,9 @@ export class CubeSignerApi {
|
|
|
619
619
|
body: {
|
|
620
620
|
identity,
|
|
621
621
|
role: opts.memberRole ?? "Alien",
|
|
622
|
-
email
|
|
623
|
-
|
|
622
|
+
email,
|
|
623
|
+
name: opts.name,
|
|
624
|
+
mfa_policy: opts.mfaPolicy,
|
|
624
625
|
},
|
|
625
626
|
});
|
|
626
627
|
return data.user_id;
|
|
@@ -712,14 +713,14 @@ export class CubeSignerApi {
|
|
|
712
713
|
* @param {KeyType} keyType The type of key to create.
|
|
713
714
|
* @param {number} count The number of keys to create.
|
|
714
715
|
* @param {string?} ownerId The owner of the keys. Defaults to the session's user.
|
|
715
|
-
* @param {
|
|
716
|
+
* @param {KeyProperties?} props Additional key properties
|
|
716
717
|
* @return {KeyInfoApi[]} The new keys.
|
|
717
718
|
*/
|
|
718
719
|
async keysCreate(
|
|
719
720
|
keyType: KeyType,
|
|
720
721
|
count: number,
|
|
721
722
|
ownerId?: string,
|
|
722
|
-
props?:
|
|
723
|
+
props?: KeyProperties,
|
|
723
724
|
): Promise<KeyInfoApi[]> {
|
|
724
725
|
const chain_id = 0; // not used anymore
|
|
725
726
|
const client = await this.client("createKey");
|
package/src/client.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
OrgInfo,
|
|
7
7
|
PublicKeyCredential,
|
|
8
8
|
RatchetConfig,
|
|
9
|
-
|
|
9
|
+
KeyProperties,
|
|
10
10
|
} from "./schema_types";
|
|
11
11
|
import { MfaReceipt } from "./mfa";
|
|
12
12
|
import { PageOpts } from "./paginator";
|
|
@@ -74,10 +74,10 @@ export class CubeSignerClient extends CubeSignerApi {
|
|
|
74
74
|
* Create a new signing key.
|
|
75
75
|
* @param {KeyType} type The type of key to create.
|
|
76
76
|
* @param {string?} ownerId The owner of the key. Defaults to the session's user.
|
|
77
|
-
* @param {
|
|
77
|
+
* @param {KeyProperties?} props Additional key properties
|
|
78
78
|
* @return {Key[]} The new keys.
|
|
79
79
|
*/
|
|
80
|
-
async createKey(type: KeyType, ownerId?: string, props?:
|
|
80
|
+
async createKey(type: KeyType, ownerId?: string, props?: KeyProperties): Promise<Key> {
|
|
81
81
|
const keys = await this.keysCreate(type, 1, ownerId, props);
|
|
82
82
|
return new Key(this, keys[0]);
|
|
83
83
|
}
|
package/src/index.ts
CHANGED
|
@@ -298,8 +298,6 @@ export * from "./role";
|
|
|
298
298
|
export * from "./env";
|
|
299
299
|
/** Fido */
|
|
300
300
|
export * from "./mfa";
|
|
301
|
-
/** Utils for processing org events */
|
|
302
|
-
export * from "./org_event_processor";
|
|
303
301
|
/** Pagination */
|
|
304
302
|
export * from "./paginator";
|
|
305
303
|
/** Response */
|
package/src/org.ts
CHANGED
|
@@ -14,7 +14,29 @@ export type OrgPolicy =
|
|
|
14
14
|
| SourceIpAllowlistPolicy
|
|
15
15
|
| OidcAuthSourcesPolicy
|
|
16
16
|
| OriginAllowlistPolicy
|
|
17
|
-
| MaxDailyUnstakePolicy
|
|
17
|
+
| MaxDailyUnstakePolicy
|
|
18
|
+
| WebAuthnRelyingPartiesPolicy
|
|
19
|
+
| ExclusiveKeyAccessPolicy;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Whether to enforce exclusive access to keys. Concretely,
|
|
23
|
+
* - if "LimitToKeyOwner" is set, only key owners are permitted to access
|
|
24
|
+
* their keys for signing: a user session (not a role session) is required
|
|
25
|
+
* for signing, and adding a key to a role is not permitted.
|
|
26
|
+
* - if "LimitToSingleRole" is set, each key is permitted to be in at most
|
|
27
|
+
* one role, and signing is only allowed when authenticating using a role session token.
|
|
28
|
+
*/
|
|
29
|
+
export interface ExclusiveKeyAccessPolicy {
|
|
30
|
+
ExclusiveKeyAccess: "LimitToKeyOwner" | "LimitToSingleRole";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The set of relying parties to allow for webauthn registration
|
|
35
|
+
* These correspond to domains from which browsers can successfully create credentials.
|
|
36
|
+
*/
|
|
37
|
+
export interface WebAuthnRelyingPartiesPolicy {
|
|
38
|
+
WebAuthnRelyingParties: { id?: string; name: string }[];
|
|
39
|
+
}
|
|
18
40
|
|
|
19
41
|
/**
|
|
20
42
|
* Provides an allowlist of OIDC Issuers and audiences that are allowed to authenticate into this org.
|
package/src/role.ts
CHANGED
|
@@ -142,12 +142,13 @@ type KeyDenyPolicy = TxReceiver | TxDeposit | SourceIpAllowlist | RequireMfa;
|
|
|
142
142
|
* }
|
|
143
143
|
* ]
|
|
144
144
|
*/
|
|
145
|
-
export type KeyPolicy =
|
|
145
|
+
export type KeyPolicy = KeyPolicyRule[];
|
|
146
|
+
|
|
147
|
+
export type KeyPolicyRule =
|
|
146
148
|
| KeyDenyPolicy
|
|
147
149
|
| AllowRawBlobSigning
|
|
148
150
|
| AllowEip191Signing
|
|
149
|
-
| AllowEip712Signing
|
|
150
|
-
)[];
|
|
151
|
+
| AllowEip712Signing;
|
|
151
152
|
|
|
152
153
|
/** Role policy */
|
|
153
154
|
export type RolePolicy = KeyDenyPolicy[];
|
package/src/schema.ts
CHANGED
|
@@ -835,10 +835,10 @@ export interface components {
|
|
|
835
835
|
};
|
|
836
836
|
AddThirdPartyUserRequest: {
|
|
837
837
|
/**
|
|
838
|
-
* @description
|
|
838
|
+
* @description Optional user email
|
|
839
839
|
* @example alice@example.com
|
|
840
840
|
*/
|
|
841
|
-
email
|
|
841
|
+
email?: string | null;
|
|
842
842
|
identity: components["schemas"]["OIDCIdentity"];
|
|
843
843
|
/** @description Optional login MFA policy */
|
|
844
844
|
mfa_policy?: unknown;
|
|
@@ -1205,6 +1205,31 @@ export interface components {
|
|
|
1205
1205
|
/** @enum {string} */
|
|
1206
1206
|
type: "fido";
|
|
1207
1207
|
};
|
|
1208
|
+
CreateAndUpdateKeyProperties: {
|
|
1209
|
+
/**
|
|
1210
|
+
* @description Set this key's metadata. Validation regex: ^[A-Za-z0-9_=+/ \-\.\,]{0,1024}$
|
|
1211
|
+
* @example Contract admin key
|
|
1212
|
+
*/
|
|
1213
|
+
metadata?: string | null;
|
|
1214
|
+
/**
|
|
1215
|
+
* @description Specify a user other than themselves to be the (potentially new) owner of the key.
|
|
1216
|
+
* The specified owner must be an existing user who is a member of the same org.
|
|
1217
|
+
* @example User#c3b9379c-4e8c-4216-bd0a-65ace53cf98f
|
|
1218
|
+
*/
|
|
1219
|
+
owner?: string | null;
|
|
1220
|
+
/**
|
|
1221
|
+
* @description Set this key's policies. For an existing key, this overwrites all its policies.
|
|
1222
|
+
* @example [
|
|
1223
|
+
* "AllowRawBlobSigning",
|
|
1224
|
+
* {
|
|
1225
|
+
* "RequireMfa": {
|
|
1226
|
+
* "count": 1
|
|
1227
|
+
* }
|
|
1228
|
+
* }
|
|
1229
|
+
* ]
|
|
1230
|
+
*/
|
|
1231
|
+
policy?: Record<string, never>[] | null;
|
|
1232
|
+
};
|
|
1208
1233
|
CreateKeyImportKeyResponse: components["schemas"]["KeyImportKey"] & {
|
|
1209
1234
|
/**
|
|
1210
1235
|
* @description An attestation document from a secure enclave, including an
|
|
@@ -1217,7 +1242,7 @@ export interface components {
|
|
|
1217
1242
|
*/
|
|
1218
1243
|
enclave_signature: string;
|
|
1219
1244
|
};
|
|
1220
|
-
CreateKeyRequest: components["schemas"]["
|
|
1245
|
+
CreateKeyRequest: components["schemas"]["CreateAndUpdateKeyProperties"] & {
|
|
1221
1246
|
/**
|
|
1222
1247
|
* Format: int64
|
|
1223
1248
|
* @description Chain id for which the key is allowed to sign messages
|
|
@@ -3181,32 +3206,7 @@ export interface components {
|
|
|
3181
3206
|
*/
|
|
3182
3207
|
signature: string;
|
|
3183
3208
|
};
|
|
3184
|
-
|
|
3185
|
-
/**
|
|
3186
|
-
* @description If set, update this key's metadata. Validation regex: ^[A-Za-z0-9_=+/ \-\.\,]{0,1024}$
|
|
3187
|
-
* @example Contract admin key
|
|
3188
|
-
*/
|
|
3189
|
-
metadata?: string | null;
|
|
3190
|
-
/**
|
|
3191
|
-
* @description Allows users to specify a user other than themselves to receive the key
|
|
3192
|
-
* The new owner must be an existing user who is a member of the same org.
|
|
3193
|
-
* @example User#c3b9379c-4e8c-4216-bd0a-65ace53cf98f
|
|
3194
|
-
*/
|
|
3195
|
-
owner?: string | null;
|
|
3196
|
-
/**
|
|
3197
|
-
* @description If set, update this key's policies (old policies will be overwritten!).
|
|
3198
|
-
* @example [
|
|
3199
|
-
* "AllowRawBlobSigning",
|
|
3200
|
-
* {
|
|
3201
|
-
* "RequireMfa": {
|
|
3202
|
-
* "count": 1
|
|
3203
|
-
* }
|
|
3204
|
-
* }
|
|
3205
|
-
* ]
|
|
3206
|
-
*/
|
|
3207
|
-
policy?: Record<string, never>[] | null;
|
|
3208
|
-
};
|
|
3209
|
-
UpdateKeyRequest: components["schemas"]["UpdateKeyProperties"] & {
|
|
3209
|
+
UpdateKeyRequest: components["schemas"]["CreateAndUpdateKeyProperties"] & {
|
|
3210
3210
|
/**
|
|
3211
3211
|
* @description If set, updates the keys's `enabled` property to this value.
|
|
3212
3212
|
* Once disabled, a key cannot be used for signing.
|
package/src/schema_types.ts
CHANGED
|
@@ -37,7 +37,7 @@ export type SchemaKeyType = schemas["KeyType"];
|
|
|
37
37
|
|
|
38
38
|
export type ListKeysResponse = schemas["PaginatedListKeysResponse"];
|
|
39
39
|
export type UpdateKeyRequest = schemas["UpdateKeyRequest"];
|
|
40
|
-
export type
|
|
40
|
+
export type KeyProperties = schemas["CreateAndUpdateKeyProperties"];
|
|
41
41
|
export type CreateKeyRequest = schemas["CreateKeyRequest"];
|
|
42
42
|
export type KeyInfoApi = schemas["KeyInfo"];
|
|
43
43
|
export type KeyInRoleInfo = schemas["KeyInRoleInfo"];
|
|
@@ -100,6 +100,8 @@ export type Empty = schemas["EmptyImpl"];
|
|
|
100
100
|
|
|
101
101
|
/** Options for a new OIDC user */
|
|
102
102
|
export interface CreateOidcUserOptions {
|
|
103
|
+
/** Optional name */
|
|
104
|
+
name?: string | null;
|
|
103
105
|
/** The role of an OIDC user, default is "Alien" */
|
|
104
106
|
memberRole?: MemberRole;
|
|
105
107
|
/** Optional MFA policy to associate with the user account */
|
package/tsconfig.json
CHANGED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { X509Certificate, createVerify } from "crypto";
|
|
2
|
-
import { Environment, envs } from ".";
|
|
3
|
-
|
|
4
|
-
// URLs that are safe to retrieve certificates from
|
|
5
|
-
const SNS_CERTIFICATE_URL_HOSTS = ["sns.us-east-1.amazonaws.com"];
|
|
6
|
-
|
|
7
|
-
const SNS_CERTIFICATE_HOST = "sns.amazonaws.com";
|
|
8
|
-
|
|
9
|
-
/** The common fields of SNS messages */
|
|
10
|
-
export interface SnsMessage {
|
|
11
|
-
Type: string;
|
|
12
|
-
MessageId: string;
|
|
13
|
-
TopicArn: string;
|
|
14
|
-
Message: string;
|
|
15
|
-
Timestamp: string;
|
|
16
|
-
SignatureVersion: string;
|
|
17
|
-
Signature: string;
|
|
18
|
-
SigningCertURL: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/** The format of a subscription confirmation sent by SNS */
|
|
22
|
-
export interface SubscriptionConfirmationMessage extends SnsMessage {
|
|
23
|
-
Token: string;
|
|
24
|
-
SubscribeURL: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** Common fields for an org event */
|
|
28
|
-
export interface OrgEventBase {
|
|
29
|
-
org: string;
|
|
30
|
-
utc_timestamp: number;
|
|
31
|
-
org_event: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** The format of an event message sent by SNS */
|
|
35
|
-
export interface OrgEventMessage extends SnsMessage {
|
|
36
|
-
Subject?: string;
|
|
37
|
-
UnsubscribeURL: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** Options for the processor */
|
|
41
|
-
export interface OrgEventProcessorOptions {
|
|
42
|
-
env: Environment;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/** A utility for processing org event messages */
|
|
46
|
-
export class OrgEventProcessor {
|
|
47
|
-
readonly #topicArn: string;
|
|
48
|
-
readonly #orgId: string;
|
|
49
|
-
#cachedCertificates: Map<URL, X509Certificate>;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Constructor.
|
|
53
|
-
* @param {string} orgId The org id
|
|
54
|
-
* @param {OrgEventProcessorOptions} options Additional options for the processor
|
|
55
|
-
*/
|
|
56
|
-
constructor(orgId: string, options?: OrgEventProcessorOptions) {
|
|
57
|
-
this.#topicArn = envs[options?.env ?? "prod"].OrgEventsTopicArn;
|
|
58
|
-
this.#orgId = orgId;
|
|
59
|
-
this.#cachedCertificates = new Map();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Checks an SNS message and its signature. Throws an error if the message
|
|
64
|
-
* invalid or the signature is invalid.
|
|
65
|
-
*
|
|
66
|
-
* @param {SnsMessage} message The SNS message to check
|
|
67
|
-
*/
|
|
68
|
-
async checkMessage(message: SnsMessage) {
|
|
69
|
-
// Check the topic ARN
|
|
70
|
-
if (message.TopicArn !== this.#topicArn) {
|
|
71
|
-
throw new Error(`Expected topic ARN '${this.#topicArn}', found '${message.TopicArn}'`);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Both subscription confirmations and org event messages should have no subject
|
|
75
|
-
if ("Subject" in message) {
|
|
76
|
-
throw new Error("Expected a message without a subject");
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// The org events topic uses signature version 2 (SHA256)
|
|
80
|
-
if (message.SignatureVersion !== "2") {
|
|
81
|
-
throw new Error("Expected signature version 2");
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Retrieve the certificate and sanity check it
|
|
85
|
-
const certificate = await this.#fetchAndValidateCertificate(new URL(message.SigningCertURL));
|
|
86
|
-
|
|
87
|
-
// Extract fields specific to subscription confirmations
|
|
88
|
-
const subscribeUrl = (message as SubscriptionConfirmationMessage).SubscribeURL;
|
|
89
|
-
const token = (message as SubscriptionConfirmationMessage).Token;
|
|
90
|
-
|
|
91
|
-
// Check the signature
|
|
92
|
-
const fields = ["Message", message.Message, "MessageId", message.MessageId]
|
|
93
|
-
.concat(subscribeUrl !== undefined ? ["SubscribeURL", subscribeUrl] : [])
|
|
94
|
-
.concat(["Timestamp", message.Timestamp])
|
|
95
|
-
.concat(token !== undefined ? ["Token", token] : [])
|
|
96
|
-
.concat(["TopicArn", message.TopicArn, "Type", message.Type]);
|
|
97
|
-
const verify = createVerify("RSA-SHA256");
|
|
98
|
-
verify.update(fields.join("\n") + "\n");
|
|
99
|
-
const isValid = verify.verify(certificate.publicKey, message.Signature, "base64");
|
|
100
|
-
if (!isValid) {
|
|
101
|
-
throw new Error("The org event has an invalid signature");
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Parse an org event and check its signature. Throws an error if the
|
|
107
|
-
* message is not a valid org event or the signature is invalid.
|
|
108
|
-
*
|
|
109
|
-
* @param {OrgEventMessage} message The org event message to check
|
|
110
|
-
* @return {OrgEventBase} The org event
|
|
111
|
-
*/
|
|
112
|
-
async parse(message: OrgEventMessage): Promise<OrgEventBase> {
|
|
113
|
-
await this.checkMessage(message);
|
|
114
|
-
|
|
115
|
-
// Check that the event is for the expected org
|
|
116
|
-
const orgEvent: OrgEventBase = JSON.parse(message.Message);
|
|
117
|
-
if (orgEvent.org !== this.#orgId) {
|
|
118
|
-
throw new Error(`Expected org to be '${this.#orgId}', found '${orgEvent.org}'`);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return orgEvent;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Fetches a certificate from a given URL or from the certificate cache.
|
|
126
|
-
* Throws an error if the URL does not correspond to an SNS certificate URL.
|
|
127
|
-
*
|
|
128
|
-
* Note: Ideally, this method would verify the certificate chain, but there
|
|
129
|
-
* is no obvious chain. Instead, this method only fetches certificates from
|
|
130
|
-
* a small set of allowlisted URLs.
|
|
131
|
-
*
|
|
132
|
-
* @param {URL} url The URL of the certificate
|
|
133
|
-
* @return {X509Certificate} The certificate
|
|
134
|
-
*/
|
|
135
|
-
async #fetchAndValidateCertificate(url: URL): Promise<X509Certificate> {
|
|
136
|
-
const currTime = new Date().getTime();
|
|
137
|
-
const cachedCertificate = this.#cachedCertificates.get(url);
|
|
138
|
-
if (cachedCertificate && currTime < new Date(cachedCertificate.validTo).getTime()) {
|
|
139
|
-
return cachedCertificate;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Only fetch certificates from HTTPS URLs
|
|
143
|
-
if (url.protocol !== "https:") {
|
|
144
|
-
throw new Error("Expected signing certificate URL to use HTTPS");
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// Only fetch certificate URLs for SNS
|
|
148
|
-
if (SNS_CERTIFICATE_URL_HOSTS.indexOf(url.host) === -1) {
|
|
149
|
-
throw new Error("Expected signing certificate URL for SNS in us-east-1");
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const response = await fetch(url);
|
|
153
|
-
if (!response.ok) {
|
|
154
|
-
throw new Error(`Unable to download certificate. Status: ${response.status}`);
|
|
155
|
-
}
|
|
156
|
-
const blob = await response.blob();
|
|
157
|
-
const certificate = new X509Certificate(await blob.text());
|
|
158
|
-
if (!certificate.checkHost(SNS_CERTIFICATE_HOST)) {
|
|
159
|
-
throw new Error(`Expected certificate to be for '${SNS_CERTIFICATE_HOST}'`);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// Check validity times
|
|
163
|
-
if (currTime < new Date(certificate.validFrom).getTime()) {
|
|
164
|
-
throw new Error("Certificate not valid yet");
|
|
165
|
-
}
|
|
166
|
-
if (new Date(certificate.validTo).getTime() < currTime) {
|
|
167
|
-
throw new Error("Certificate expired");
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
this.#cachedCertificates.set(url, certificate);
|
|
171
|
-
return certificate;
|
|
172
|
-
}
|
|
173
|
-
}
|