@sudoplatform/sudo-common 8.1.0 → 8.2.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.
@@ -184,19 +184,19 @@ yarn outdated --json | jq -r -s -c 'map(select(.type == "table").data.body) | .[
184
184
  echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${outdated_diff_type} suppression expired]"
185
185
  new=1
186
186
  else
187
- echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${outdated_diff_type} suppressed]"
187
+ echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${outdated_diff_type} suppressed until $(dateFromSeconds "${suppression}")]"
188
188
  fi
189
189
  done
190
190
 
191
191
  # If we're not within cadence and there are new outdated dependencies
192
192
  # then fail
193
- if [ -z "${within_cadence}" -a -n "${new}" ]; then
193
+ if [ -z "${within_cadence}" ] && [ -n "${new}" ]; then
194
194
  exit 1
195
195
  fi
196
196
 
197
197
  # If there a no outdated dependencies and we're tracking last success then
198
198
  # refresh the last success timestamp.
199
- if [ -z "${new}" -a -n "${last}" ]; then
199
+ if [ -z "${new}" ] && [ -n "${last}" ]; then
200
200
  mkdir -p "${last}"
201
201
  date +%s > "${last}/last_success"
202
202
  fi
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ListOperationResultStatus = exports.EncryptionAlgorithm = exports.CachePolicy = void 0;
3
+ exports.ListOperationResultStatus = exports.SignatureAlgorithm = exports.EncryptionAlgorithm = exports.CachePolicy = void 0;
4
4
  /**
5
5
  * Cache policy that determines how data is accessed when performing a query method
6
6
  * from the Email Service.
@@ -23,6 +23,15 @@ var EncryptionAlgorithm;
23
23
  EncryptionAlgorithm["AesGcmNoPadding"] = "AES/GCM/NoPadding";
24
24
  EncryptionAlgorithm["RsaOaepSha1"] = "RSA/OAEPWithSHA-1";
25
25
  })(EncryptionAlgorithm = exports.EncryptionAlgorithm || (exports.EncryptionAlgorithm = {}));
26
+ /**
27
+ * Signature algorithm names that are
28
+ * supported by the Sudo Platform and can be used
29
+ * between devices.
30
+ */
31
+ var SignatureAlgorithm;
32
+ (function (SignatureAlgorithm) {
33
+ SignatureAlgorithm["RsaPkcs15Sha256"] = "RSA/SSAPKCS15withSHA-256";
34
+ })(SignatureAlgorithm = exports.SignatureAlgorithm || (exports.SignatureAlgorithm = {}));
26
35
  /**
27
36
  * Status of the list operation result.
28
37
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":";;;AAQA;;;GAGG;AACH,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,8BAA8B;IAC9B,uCAAwB,CAAA;IACxB,wCAAwC;IACxC,0CAA2B,CAAA;AAC7B,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB;AAwBD;;;;GAIG;AACH,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,kEAA2C,CAAA;IAC3C,4DAAqC,CAAA;IACrC,wDAAiC,CAAA;AACnC,CAAC,EAJW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAI9B;AAID;;GAEG;AACH,IAAY,yBAcX;AAdD,WAAY,yBAAyB;IACnC;;OAEG;IACH,gDAAmB,CAAA;IACnB;;;OAGG;IACH,gDAAmB,CAAA;IACnB;;OAEG;IACH,gDAAmB,CAAA;AACrB,CAAC,EAdW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAcpC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":";;;AAQA;;;GAGG;AACH,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,8BAA8B;IAC9B,uCAAwB,CAAA;IACxB,wCAAwC;IACxC,0CAA2B,CAAA;AAC7B,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB;AAwBD;;;;GAIG;AACH,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,kEAA2C,CAAA;IAC3C,4DAAqC,CAAA;IACrC,wDAAiC,CAAA;AACnC,CAAC,EAJW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAI9B;AAED;;;;GAIG;AACH,IAAY,kBAEX;AAFD,WAAY,kBAAkB;IAC5B,kEAA4C,CAAA;AAC9C,CAAC,EAFW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAE7B;AAID;;GAEG;AACH,IAAY,yBAcX;AAdD,WAAY,yBAAyB;IACnC;;OAEG;IACH,gDAAmB,CAAA;IACnB;;;OAGG;IACH,gDAAmB,CAAA;IACnB;;OAEG;IACH,gDAAmB,CAAA;AACrB,CAAC,EAdW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAcpC"}
@@ -20,6 +20,15 @@ export var EncryptionAlgorithm;
20
20
  EncryptionAlgorithm["AesGcmNoPadding"] = "AES/GCM/NoPadding";
21
21
  EncryptionAlgorithm["RsaOaepSha1"] = "RSA/OAEPWithSHA-1";
22
22
  })(EncryptionAlgorithm || (EncryptionAlgorithm = {}));
23
+ /**
24
+ * Signature algorithm names that are
25
+ * supported by the Sudo Platform and can be used
26
+ * between devices.
27
+ */
28
+ export var SignatureAlgorithm;
29
+ (function (SignatureAlgorithm) {
30
+ SignatureAlgorithm["RsaPkcs15Sha256"] = "RSA/SSAPKCS15withSHA-256";
31
+ })(SignatureAlgorithm || (SignatureAlgorithm = {}));
23
32
  /**
24
33
  * Status of the list operation result.
25
34
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,8BAA8B;IAC9B,uCAAwB,CAAA;IACxB,wCAAwC;IACxC,0CAA2B,CAAA;AAC7B,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAwBD;;;;GAIG;AACH,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,kEAA2C,CAAA;IAC3C,4DAAqC,CAAA;IACrC,wDAAiC,CAAA;AACnC,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B;AAID;;GAEG;AACH,MAAM,CAAN,IAAY,yBAcX;AAdD,WAAY,yBAAyB;IACnC;;OAEG;IACH,gDAAmB,CAAA;IACnB;;;OAGG;IACH,gDAAmB,CAAA;IACnB;;OAEG;IACH,gDAAmB,CAAA;AACrB,CAAC,EAdW,yBAAyB,KAAzB,yBAAyB,QAcpC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,8BAA8B;IAC9B,uCAAwB,CAAA;IACxB,wCAAwC;IACxC,0CAA2B,CAAA;AAC7B,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAwBD;;;;GAIG;AACH,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,kEAA2C,CAAA;IAC3C,4DAAqC,CAAA;IACrC,wDAAiC,CAAA;AACnC,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,kBAEX;AAFD,WAAY,kBAAkB;IAC5B,kEAA4C,CAAA;AAC9C,CAAC,EAFW,kBAAkB,KAAlB,kBAAkB,QAE7B;AAID;;GAEG;AACH,MAAM,CAAN,IAAY,yBAcX;AAdD,WAAY,yBAAyB;IACnC;;OAEG;IACH,gDAAmB,CAAA;IACnB;;;OAGG;IACH,gDAAmB,CAAA;IACnB;;OAEG;IACH,gDAAmB,CAAA;AACrB,CAAC,EAdW,yBAAyB,KAAzB,yBAAyB,QAcpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudoplatform/sudo-common",
3
- "version": "8.1.0",
3
+ "version": "8.2.0",
4
4
  "author": "Anonyome Labs, Inc.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -50,16 +50,13 @@
50
50
  ],
51
51
  "resolutions": {
52
52
  "**/apollo-cache-inmemory": "^1.6.6",
53
- "**/apollo-client": "^2.6.10",
54
- "ansi-regex": "^5.0.1",
55
- "tmpl": "^1.0.5",
56
- "minimist": "^1.2.6"
53
+ "**/apollo-client": "^2.6.10"
57
54
  },
58
55
  "dependencies": {
59
- "@aws-sdk/client-s3": "^3.179.0",
56
+ "@aws-sdk/client-s3": "^3.194.0",
60
57
  "apollo-client": "^2.6.10",
61
58
  "browser-bunyan": "^1.8.0",
62
- "fflate": "^0.7.3",
59
+ "fflate": "^0.7.4",
63
60
  "graphql": "^15.8.0",
64
61
  "tslib": "^2.4.0"
65
62
  },
@@ -68,19 +65,19 @@
68
65
  },
69
66
  "devDependencies": {
70
67
  "@types/jest": "^27.5.2",
71
- "@types/node": "^16.11.62",
72
- "@typescript-eslint/eslint-plugin": "^5.38.1",
73
- "@typescript-eslint/parser": "^5.38.1",
74
- "aws-sdk-mock": "^5.7.0",
75
- "concurrently": "^7.4.0",
76
- "eslint": "^8.24.0",
68
+ "@types/node": "^16.18.0",
69
+ "@typescript-eslint/eslint-plugin": "^5.40.1",
70
+ "@typescript-eslint/parser": "^5.40.1",
71
+ "aws-sdk-mock": "^5.8.0",
72
+ "concurrently": "^7.5.0",
73
+ "eslint": "^8.26.0",
77
74
  "eslint-config-prettier": "^8.5.0",
78
75
  "eslint-plugin-import": "^2.26.0",
79
76
  "eslint-plugin-prettier": "^4.2.1",
80
77
  "eslint-plugin-tree-shaking": "^1.10.0",
81
- "fp-ts": "^2.12.3",
82
- "io-ts": "^2.2.18",
83
- "io-ts-types": "^0.5.16",
78
+ "fp-ts": "^2.13.1",
79
+ "io-ts": "^2.2.19",
80
+ "io-ts-types": "^0.5.19",
84
81
  "isomorphic-fetch": "^3.0.0",
85
82
  "isomorphic-webcrypto": "^2.3.8",
86
83
  "jest": "^27.5.1",
@@ -91,17 +88,16 @@
91
88
  "ts-jest": "^27.1.5",
92
89
  "ts-mockito": "^2.6.1",
93
90
  "ts-node": "^10.9.1",
94
- "typedoc": "^0.23.15",
95
- "typescript": "^4.8.3"
91
+ "typedoc": "^0.23.18",
92
+ "typescript": "^4.8.4"
96
93
  },
97
94
  "outdatedSuppressions": {
98
95
  "major": {
99
- "@types/jest": 1663379291,
100
- "ansi-regex": 1663379292,
101
- "graphql": 1663379292,
102
- "jest": 1663379292,
103
- "@types/node": 1663379291,
104
- "ts-jest": 1663379292
96
+ "@types/jest": 1669184645,
97
+ "@types/node": 1669184645,
98
+ "graphql": 1669184645,
99
+ "jest": 1669184645,
100
+ "ts-jest": 1669184646
105
101
  }
106
102
  }
107
103
  }
@@ -1,4 +1,4 @@
1
- import { EncryptionAlgorithm } from '../types/types';
1
+ import { EncryptionAlgorithm, SignatureAlgorithm } from '../types/types';
2
2
  import { KeyData } from './keyData';
3
3
  import { PublicKey } from './publicKey';
4
4
  export declare class SudoCryptoProviderDefaults {
@@ -21,6 +21,13 @@ export interface SymmetricEncryptionOptions {
21
21
  export interface AsymmetricEncryptionOptions {
22
22
  algorithm?: EncryptionAlgorithm;
23
23
  }
24
+ /**
25
+ * Optional arguments for private key signature generation
26
+ * and verification
27
+ */
28
+ export interface SignatureOptions {
29
+ algorithm?: SignatureAlgorithm;
30
+ }
24
31
  /**
25
32
  * CryptoProvider instance interface
26
33
  */
@@ -119,22 +126,24 @@ export interface SudoCryptoProvider {
119
126
  *
120
127
  * @param name The name of the private key to use for generation.
121
128
  * @param data The data to sign.
129
+ * @param options Signature options. Defaults to \{ algorithm: SignatureAlgorithm.RsaPkcs15Sha256 \}
122
130
  *
123
131
  * @returns Data signature
124
132
  *
125
133
  * @throws {@link KeyNotFoundError}
126
134
  */
127
- generateSignatureWithPrivateKey(name: string, data: ArrayBuffer): Promise<ArrayBuffer>;
135
+ generateSignatureWithPrivateKey(name: string, data: ArrayBuffer, options?: SignatureOptions): Promise<ArrayBuffer>;
128
136
  /**
129
137
  * Verifies the given data against the provided signature using the specified public key.
130
138
  *
131
139
  * @param name The name of the public key to use for validation.
132
140
  * @param data The data to verify
133
141
  * @param signature The signature to verify against
142
+ * @param options Signature options. Defaults to \{ algorithm: SignatureAlgorithm.RsaPkcs15Sha256 \}
134
143
  *
135
144
  * @returns True if the data and signature could be successfully verified
136
145
  */
137
- verifySignatureWithPublicKey(name: string, data: ArrayBuffer, signature: ArrayBuffer): Promise<boolean>;
146
+ verifySignatureWithPublicKey(name: string, data: ArrayBuffer, signature: ArrayBuffer, options?: SignatureOptions): Promise<boolean>;
138
147
  /**
139
148
  * Adds a private key to the secure store.
140
149
  *
@@ -42,6 +42,14 @@ export declare enum EncryptionAlgorithm {
42
42
  AesGcmNoPadding = "AES/GCM/NoPadding",
43
43
  RsaOaepSha1 = "RSA/OAEPWithSHA-1"
44
44
  }
45
+ /**
46
+ * Signature algorithm names that are
47
+ * supported by the Sudo Platform and can be used
48
+ * between devices.
49
+ */
50
+ export declare enum SignatureAlgorithm {
51
+ RsaPkcs15Sha256 = "RSA/SSAPKCS15withSHA-256"
52
+ }
45
53
  export declare type Subset<T, S> = Pick<T, keyof T & keyof S>;
46
54
  /**
47
55
  * Status of the list operation result.