@casual-simulation/aux-records 2.0.22-alpha.1651045562

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/Utils.js ADDED
@@ -0,0 +1,206 @@
1
+ import { fromByteArray, toByteArray } from 'base64-js';
2
+ import { padStart, sortBy } from 'lodash';
3
+ import { sha256, hmac } from 'hash.js';
4
+ /**
5
+ * Converts the given string into a base64 string.
6
+ * @param str The string to convert.
7
+ */
8
+ export function toBase64String(str) {
9
+ const encoder = new TextEncoder();
10
+ const array = encoder.encode(str);
11
+ return fromByteArray(array);
12
+ }
13
+ /**
14
+ * Converts the given string from a base64 string.
15
+ * @param base64
16
+ */
17
+ export function fromBase64String(base64) {
18
+ const decoder = new TextDecoder();
19
+ const array = toByteArray(base64);
20
+ return decoder.decode(array);
21
+ }
22
+ /**
23
+ * Signs the given request and adds the related headers to it.
24
+ * @param request The request to sign.
25
+ * @param secretAccessKey The secret access key to use.
26
+ * @param accessKeyId The ID of the access key that is being used.
27
+ * @param date The date to use for signing.
28
+ * @param region The AWS region.
29
+ * @param service The AWS service.
30
+ */
31
+ export function signRequest(request, secretAccessKey, accessKeyId, date, region, service) {
32
+ const hash = request.payloadSha256Hex.toLowerCase();
33
+ request = Object.assign(Object.assign({}, request), { headers: Object.assign(Object.assign({}, request.headers), { 'x-amz-date': getAmzDateString(date), 'x-amz-content-sha256': hash }) });
34
+ let canonicalRequest = createCanonicalRequest(request);
35
+ let stringToSign = createStringToSign(canonicalRequest, date, region, service);
36
+ let signature = createAWS4Signature(stringToSign, secretAccessKey, date, region, service);
37
+ let credential = `${accessKeyId}/${getDateString(date)}/${region}/${service}/aws4_request`;
38
+ let signedHeaders = Object.keys(request.headers)
39
+ .map((header) => header.toLowerCase())
40
+ .sort()
41
+ .join(';');
42
+ let authorization = `AWS4-HMAC-SHA256 Credential=${credential},SignedHeaders=${signedHeaders},Signature=${signature}`;
43
+ let result = {
44
+ method: request.method,
45
+ uri: request.uri,
46
+ queryString: Object.assign({}, request.queryString),
47
+ headers: Object.assign(Object.assign({}, request.headers), { Authorization: authorization }),
48
+ payloadSha256Hex: hash,
49
+ };
50
+ return result;
51
+ }
52
+ /**
53
+ * Constructs a string that can be signed from the given request, date, AWS region, and AWS Service.
54
+ * @param canonicalRequest The canonical request to include.
55
+ * @param date The date that the signature is happening on.
56
+ * @param region The region that the signature is for.
57
+ * @param service The service that the signature is for.
58
+ */
59
+ export function createStringToSign(canonicalRequest, date, region, service) {
60
+ const isoDate = getDateString(date);
61
+ const isoDateTime = getAmzDateString(date);
62
+ const sha = sha256();
63
+ sha.update(canonicalRequest);
64
+ const canonicalRequestHash = sha.digest('hex');
65
+ return `AWS4-HMAC-SHA256\n${isoDateTime}\n${isoDate}/${region}/${service}/aws4_request\n${canonicalRequestHash}`;
66
+ }
67
+ /**
68
+ * Creates a signature using the given secret access key and additional info.
69
+ * @param stringToSign The string that should be signed.
70
+ * @param secretAccessKey The secret access key.
71
+ * @param date The date that the signature is happening on.
72
+ * @param region The AWS region.
73
+ * @param service The AWS Service.
74
+ */
75
+ export function createAWS4Signature(stringToSign, secretAccessKey, date, region, service) {
76
+ const dateString = date.getUTCFullYear() +
77
+ padStart((1 + date.getUTCMonth()).toString(), 2, '0') +
78
+ padStart(date.getUTCDate().toString(), 2, '0');
79
+ const dateKey = createHmac('AWS4' + secretAccessKey, dateString);
80
+ const dateRegionKey = createHmac(dateKey, region);
81
+ const dateRegionServiceKey = createHmac(dateRegionKey, service);
82
+ const signingKey = createHmac(dateRegionServiceKey, 'aws4_request');
83
+ const final = createHmac(signingKey, stringToSign, 'hex');
84
+ return final;
85
+ }
86
+ function createHmac(key, data, enc) {
87
+ const hmacSha256 = hmac(sha256, key);
88
+ hmacSha256.update(data);
89
+ if (enc) {
90
+ return hmacSha256.digest(enc);
91
+ }
92
+ else {
93
+ return hmacSha256.digest();
94
+ }
95
+ }
96
+ /**
97
+ * Creates a canonical request string that can be used to create a AWS Signature for the given request.
98
+ *
99
+ * See https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html
100
+ * @param request The request to create the canonical request for.
101
+ */
102
+ export function createCanonicalRequest(request) {
103
+ let str = '';
104
+ str += request.method + '\n';
105
+ str += canonicalUriEncode(request.uri, false) + '\n';
106
+ let queryStringParams = Object.keys(request.queryString).map((name) => [
107
+ name,
108
+ canonicalUriEncode(name, true),
109
+ ]);
110
+ queryStringParams = sortBy(queryStringParams, ([name, encodedName]) => encodedName);
111
+ let i = 0;
112
+ for (let [name, encodedName] of queryStringParams) {
113
+ let value = request.queryString[name];
114
+ str += encodedName + '=' + canonicalUriEncode(value, true);
115
+ if (i < queryStringParams.length - 1) {
116
+ str += '&';
117
+ }
118
+ i++;
119
+ }
120
+ str += '\n';
121
+ let headerNames = Object.keys(request.headers).map((name) => [
122
+ name,
123
+ name.toLowerCase(),
124
+ ]);
125
+ headerNames = sortBy(headerNames, ([name, encodedName]) => encodedName);
126
+ i = 0;
127
+ for (let [name, encodedName] of headerNames) {
128
+ let value = request.headers[name];
129
+ str += encodedName + ':' + value.trim() + '\n';
130
+ i++;
131
+ }
132
+ str +=
133
+ headerNames.map(([name, encodedName]) => encodedName).join(';') + '\n';
134
+ str += request.payloadSha256Hex.toLowerCase();
135
+ return str;
136
+ }
137
+ const A = 'A'.charCodeAt(0);
138
+ const Z = 'Z'.charCodeAt(0);
139
+ const a = 'a'.charCodeAt(0);
140
+ const z = 'z'.charCodeAt(0);
141
+ const _0 = '0'.charCodeAt(0);
142
+ const _9 = '9'.charCodeAt(0);
143
+ const __ = '_'.charCodeAt(0);
144
+ const _dash = '-'.charCodeAt(0);
145
+ const _squiggle = '~'.charCodeAt(0);
146
+ const _dot = '.'.charCodeAt(0);
147
+ const _slash = '/'.charCodeAt(0);
148
+ /**
149
+ * URI Encodes the given string according to AWS Signature Version 4.
150
+ * See https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html
151
+ * @param input The string to URI encode.
152
+ * @param encodeSlash Whether to encode slashes as %2F.
153
+ */
154
+ export function canonicalUriEncode(input, encodeSlash) {
155
+ const textEncoder = new TextEncoder();
156
+ const bytes = textEncoder.encode(input);
157
+ const textDecoder = new TextDecoder();
158
+ let result = [];
159
+ for (let i = 0; i < bytes.length; i++) {
160
+ let ch = bytes[i];
161
+ if ((ch >= A && ch <= Z) ||
162
+ (ch >= a && ch <= z) ||
163
+ (ch >= _0 && ch <= _9) ||
164
+ ch == __ ||
165
+ ch == _dash ||
166
+ ch == _squiggle ||
167
+ ch == _dot) {
168
+ result.push(ch);
169
+ }
170
+ else if (ch === _slash) {
171
+ if (encodeSlash) {
172
+ result.push(...textEncoder.encode('%2F'));
173
+ }
174
+ else {
175
+ result.push(ch);
176
+ }
177
+ }
178
+ else {
179
+ result.push(...textEncoder.encode(encodeHexUtf8(ch)));
180
+ }
181
+ }
182
+ const buffer = new Uint8Array(result);
183
+ return textDecoder.decode(buffer);
184
+ }
185
+ /**
186
+ * Encodes the given character code as a URI hex string.
187
+ * @param char The character to encode.
188
+ */
189
+ export function encodeHexUtf8(char) {
190
+ const hex = char.toString(16).toUpperCase();
191
+ return '%' + (hex.length === 1 ? '0' + hex : hex);
192
+ }
193
+ function getDateString(date) {
194
+ return (date.getUTCFullYear() +
195
+ padStart((1 + date.getUTCMonth()).toString(), 2, '0') +
196
+ padStart(date.getUTCDate().toString(), 2, '0'));
197
+ }
198
+ function getAmzDateString(date) {
199
+ return (getDateString(date) +
200
+ 'T' +
201
+ padStart(date.getUTCHours().toString(), 2, '0') +
202
+ padStart(date.getUTCMinutes().toString(), 2, '0') +
203
+ padStart(date.getUTCSeconds().toString(), 2, '0') +
204
+ 'Z');
205
+ }
206
+ //# sourceMappingURL=Utils.js.map
package/Utils.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Utils.js","sourceRoot":"","sources":["Utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;A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AS,aAAa,CAAC,IAAU;IAC7B,OAAO,CACH,IAAI,CAAC,cAAc,EAAE;QACrB,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC;QACrD,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CACjD,CAAC;AACN,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAU;IAChC,OAAO,CACH,aAAa,CAAC,IAAI,CAAC;QACnB,GAAG;QACH,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC;QAC/C,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC;QACjD,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC;QACjD,GAAG,CACN,CAAC;AACN,CAAC"}
package/index.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ export * from './RecordsController';
2
+ export * from './RecordsStore';
3
+ export * from './MemoryRecordsStore';
4
+ export * from './Utils';
5
+ export * from './DataRecordsController';
6
+ export * from './DataRecordsStore';
7
+ export * from './FileRecordsController';
8
+ export * from './FileRecordsStore';
9
+ export * from './MemoryFileRecordsStore';
10
+ //# sourceMappingURL=index.d.ts.map
package/index.js ADDED
@@ -0,0 +1,10 @@
1
+ export * from './RecordsController';
2
+ export * from './RecordsStore';
3
+ export * from './MemoryRecordsStore';
4
+ export * from './Utils';
5
+ export * from './DataRecordsController';
6
+ export * from './DataRecordsStore';
7
+ export * from './FileRecordsController';
8
+ export * from './FileRecordsStore';
9
+ export * from './MemoryFileRecordsStore';
10
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@casual-simulation/aux-records",
3
+ "version": "2.0.22-alpha.1651045562",
4
+ "description": "Helpers and managers used by the CasualOS records system.",
5
+ "keywords": [],
6
+ "author": "Casual Simulation, Inc.",
7
+ "homepage": "https://github.com/casual-simulation/casualos",
8
+ "license": "MIT",
9
+ "main": "index.js",
10
+ "types": "index.d.ts",
11
+ "module": "index",
12
+ "directories": {
13
+ "lib": "."
14
+ },
15
+ "files": [
16
+ "/README.md",
17
+ "/LICENSE.txt",
18
+ "**/*.js",
19
+ "**/*.js.map",
20
+ "**/*.d.ts"
21
+ ],
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/casual-simulation/casualos.git"
25
+ },
26
+ "scripts": {
27
+ "watch": "tsc --watch",
28
+ "watch:player": "npm run watch",
29
+ "build": "echo \"Nothing to do.\"",
30
+ "build:docs": "typedoc --mode file --excludeNotExported --out ../../api-docs/crypto .",
31
+ "test": "jest",
32
+ "test:watch": "jest --watchAll"
33
+ },
34
+ "bugs": {
35
+ "url": "https://github.com/casual-simulation/casualos/issues"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "dependencies": {
41
+ "@casual-simulation/crypto": "^2.0.22-alpha.1651045562",
42
+ "tweetnacl": "1.0.3"
43
+ },
44
+ "gitHead": "874f0a46dad3edeb703965575a0a97129ae6746c"
45
+ }