@azure/keyvault-keys 4.4.0-alpha.20220105.2 → 4.4.0-alpha.20220127.2

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/CHANGELOG.md CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  ### Features Added
6
6
 
7
+ - Added `KeyReleasePolicy#immutable` flag to support immutable release policies. Once a release policy is marked as immutable, it can no longer be modified.
8
+
7
9
  ### Breaking Changes
8
10
 
9
11
  ### Bugs Fixed
package/dist/index.js CHANGED
@@ -83,38 +83,25 @@ var KnownJsonWebKeyOperation;
83
83
  /** The SECG SECP256K1 elliptic curve. */
84
84
  KnownJsonWebKeyCurveName["P256K"] = "P-256K";
85
85
  })(exports.KnownKeyCurveNames || (exports.KnownKeyCurveNames = {}));
86
+ /** Known values of {@link JsonWebKeyEncryptionAlgorithm} that the service accepts. */
87
+ var KnownJsonWebKeyEncryptionAlgorithm;
86
88
  (function (KnownJsonWebKeyEncryptionAlgorithm) {
87
- /** Encryption Algorithm - RSA-OAEP */
88
89
  KnownJsonWebKeyEncryptionAlgorithm["RSAOaep"] = "RSA-OAEP";
89
- /** Encryption Algorithm - RSA-OAEP-256 */
90
90
  KnownJsonWebKeyEncryptionAlgorithm["RSAOaep256"] = "RSA-OAEP-256";
91
- /** Encryption Algorithm - RSA1_5 */
92
91
  KnownJsonWebKeyEncryptionAlgorithm["RSA15"] = "RSA1_5";
93
- /** Encryption Algorithm - A128GCM */
94
92
  KnownJsonWebKeyEncryptionAlgorithm["A128GCM"] = "A128GCM";
95
- /** Encryption Algorithm - A192GCM */
96
93
  KnownJsonWebKeyEncryptionAlgorithm["A192GCM"] = "A192GCM";
97
- /** Encryption Algorithm - A256GCM */
98
94
  KnownJsonWebKeyEncryptionAlgorithm["A256GCM"] = "A256GCM";
99
- /** Encryption Algorithm - A128KW */
100
95
  KnownJsonWebKeyEncryptionAlgorithm["A128KW"] = "A128KW";
101
- /** Encryption Algorithm - A192KW */
102
96
  KnownJsonWebKeyEncryptionAlgorithm["A192KW"] = "A192KW";
103
- /** Encryption Algorithm - A256KW */
104
97
  KnownJsonWebKeyEncryptionAlgorithm["A256KW"] = "A256KW";
105
- /** Encryption Algorithm - A128CBC */
106
98
  KnownJsonWebKeyEncryptionAlgorithm["A128CBC"] = "A128CBC";
107
- /** Encryption Algorithm - A192CBC */
108
99
  KnownJsonWebKeyEncryptionAlgorithm["A192CBC"] = "A192CBC";
109
- /** Encryption Algorithm - A256CBC */
110
100
  KnownJsonWebKeyEncryptionAlgorithm["A256CBC"] = "A256CBC";
111
- /** Encryption Algorithm - A128CBCPAD */
112
101
  KnownJsonWebKeyEncryptionAlgorithm["A128Cbcpad"] = "A128CBCPAD";
113
- /** Encryption Algorithm - A192CBCPAD */
114
102
  KnownJsonWebKeyEncryptionAlgorithm["A192Cbcpad"] = "A192CBCPAD";
115
- /** Encryption Algorithm - A256CBCPAD */
116
103
  KnownJsonWebKeyEncryptionAlgorithm["A256Cbcpad"] = "A256CBCPAD";
117
- })(exports.KnownEncryptionAlgorithms || (exports.KnownEncryptionAlgorithms = {}));
104
+ })(KnownJsonWebKeyEncryptionAlgorithm || (KnownJsonWebKeyEncryptionAlgorithm = {}));
118
105
  (function (KnownJsonWebKeySignatureAlgorithm) {
119
106
  /** RSASSA-PSS using SHA-256 and MGF1 with SHA-256, as described in https://tools.ietf.org/html/rfc7518 */
120
107
  KnownJsonWebKeySignatureAlgorithm["PS256"] = "PS256";
@@ -271,6 +258,12 @@ const KeyReleasePolicy = {
271
258
  name: "String"
272
259
  }
273
260
  },
261
+ immutable: {
262
+ serializedName: "immutable",
263
+ type: {
264
+ name: "Boolean"
265
+ }
266
+ },
274
267
  encodedPolicy: {
275
268
  serializedName: "data",
276
269
  type: {
@@ -800,39 +793,12 @@ const KeyVerifyResult = {
800
793
  }
801
794
  }
802
795
  };
803
- const KeyExportParameters = {
804
- type: {
805
- name: "Composite",
806
- className: "KeyExportParameters",
807
- modelProperties: {
808
- wrappingKey: {
809
- serializedName: "wrappingKey",
810
- type: {
811
- name: "Composite",
812
- className: "JsonWebKey"
813
- }
814
- },
815
- wrappingKid: {
816
- serializedName: "wrappingKid",
817
- type: {
818
- name: "String"
819
- }
820
- },
821
- enc: {
822
- serializedName: "enc",
823
- type: {
824
- name: "String"
825
- }
826
- }
827
- }
828
- }
829
- };
830
796
  const KeyReleaseParameters = {
831
797
  type: {
832
798
  name: "Composite",
833
799
  className: "KeyReleaseParameters",
834
800
  modelProperties: {
835
- target: {
801
+ targetAttestationToken: {
836
802
  constraints: {
837
803
  MinLength: 1
838
804
  },
@@ -1045,6 +1011,7 @@ const RandomBytes = {
1045
1011
  modelProperties: {
1046
1012
  value: {
1047
1013
  serializedName: "value",
1014
+ required: true,
1048
1015
  type: {
1049
1016
  name: "Base64Url"
1050
1017
  }
@@ -1090,6 +1057,33 @@ const KeyProperties = {
1090
1057
  }
1091
1058
  }
1092
1059
  };
1060
+ const KeyExportParameters = {
1061
+ type: {
1062
+ name: "Composite",
1063
+ className: "KeyExportParameters",
1064
+ modelProperties: {
1065
+ wrappingKey: {
1066
+ serializedName: "wrappingKey",
1067
+ type: {
1068
+ name: "Composite",
1069
+ className: "JsonWebKey"
1070
+ }
1071
+ },
1072
+ wrappingKid: {
1073
+ serializedName: "wrappingKid",
1074
+ type: {
1075
+ name: "String"
1076
+ }
1077
+ },
1078
+ enc: {
1079
+ serializedName: "enc",
1080
+ type: {
1081
+ name: "String"
1082
+ }
1083
+ }
1084
+ }
1085
+ }
1086
+ };
1093
1087
  const KeyAttributes = {
1094
1088
  type: {
1095
1089
  name: "Composite",
@@ -1183,7 +1177,6 @@ var Mappers = /*#__PURE__*/Object.freeze({
1183
1177
  KeySignParameters: KeySignParameters,
1184
1178
  KeyVerifyParameters: KeyVerifyParameters,
1185
1179
  KeyVerifyResult: KeyVerifyResult,
1186
- KeyExportParameters: KeyExportParameters,
1187
1180
  KeyReleaseParameters: KeyReleaseParameters,
1188
1181
  KeyReleaseResult: KeyReleaseResult,
1189
1182
  DeletedKeyListResult: DeletedKeyListResult,
@@ -1195,6 +1188,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
1195
1188
  GetRandomBytesRequest: GetRandomBytesRequest,
1196
1189
  RandomBytes: RandomBytes,
1197
1190
  KeyProperties: KeyProperties,
1191
+ KeyExportParameters: KeyExportParameters,
1198
1192
  KeyAttributes: KeyAttributes,
1199
1193
  DeletedKeyBundle: DeletedKeyBundle,
1200
1194
  DeletedKeyItem: DeletedKeyItem
@@ -1335,7 +1329,7 @@ class KeyVaultClientContext extends coreHttp.ServiceClient {
1335
1329
  if (!options) {
1336
1330
  options = {};
1337
1331
  }
1338
- const defaultUserAgent = `azsdk-js-${packageName.replace("@azure/", "")}/${packageVersion} ${coreHttp.getDefaultUserAgentValue()}`;
1332
+ const defaultUserAgent = `azsdk-js-${packageName.replace(/@.*\//, "")}/${packageVersion} ${coreHttp.getDefaultUserAgentValue()}`;
1339
1333
  super(undefined, Object.assign(Object.assign({}, options), { userAgent: options.userAgent
1340
1334
  ? `${options.userAgent} ${defaultUserAgent}`
1341
1335
  : `${defaultUserAgent}` }));
@@ -1690,38 +1684,21 @@ class KeyVaultClient extends KeyVaultClientContext {
1690
1684
  };
1691
1685
  return this.sendOperationRequest(operationArguments, unwrapKeyOperationSpec);
1692
1686
  }
1693
- /**
1694
- * The export key operation is applicable to all key types. The target key must be marked exportable.
1695
- * This operation requires the keys/export permission.
1696
- * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
1697
- * @param keyName The name of the key to get.
1698
- * @param keyVersion Adding the version parameter retrieves a specific version of a key.
1699
- * @param options The options parameters.
1700
- */
1701
- export(vaultBaseUrl, keyName, keyVersion, options) {
1702
- const operationArguments = {
1703
- vaultBaseUrl,
1704
- keyName,
1705
- keyVersion,
1706
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1707
- };
1708
- return this.sendOperationRequest(operationArguments, exportOperationSpec);
1709
- }
1710
1687
  /**
1711
1688
  * The release key operation is applicable to all key types. The target key must be marked exportable.
1712
1689
  * This operation requires the keys/release permission.
1713
1690
  * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
1714
1691
  * @param keyName The name of the key to get.
1715
1692
  * @param keyVersion Adding the version parameter retrieves a specific version of a key.
1716
- * @param target The attestation assertion for the target of the key release.
1693
+ * @param targetAttestationToken The attestation assertion for the target of the key release.
1717
1694
  * @param options The options parameters.
1718
1695
  */
1719
- release(vaultBaseUrl, keyName, keyVersion, target, options) {
1696
+ release(vaultBaseUrl, keyName, keyVersion, targetAttestationToken, options) {
1720
1697
  const operationArguments = {
1721
1698
  vaultBaseUrl,
1722
1699
  keyName,
1723
1700
  keyVersion,
1724
- target,
1701
+ targetAttestationToken,
1725
1702
  options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1726
1703
  };
1727
1704
  return this.sendOperationRequest(operationArguments, releaseOperationSpec);
@@ -2270,35 +2247,6 @@ const unwrapKeyOperationSpec = {
2270
2247
  mediaType: "json",
2271
2248
  serializer
2272
2249
  };
2273
- const exportOperationSpec = {
2274
- path: "/keys/{key-name}/{key-version}/export",
2275
- httpMethod: "POST",
2276
- responses: {
2277
- 200: {
2278
- bodyMapper: KeyBundle
2279
- },
2280
- default: {
2281
- bodyMapper: KeyVaultError
2282
- }
2283
- },
2284
- requestBody: {
2285
- parameterPath: {
2286
- wrappingKey: ["options", "wrappingKey"],
2287
- wrappingKid: ["options", "wrappingKid"],
2288
- enc: ["options", "enc"]
2289
- },
2290
- mapper: Object.assign(Object.assign({}, KeyExportParameters), { required: true })
2291
- },
2292
- queryParameters: [apiVersion],
2293
- urlParameters: [
2294
- vaultBaseUrl,
2295
- keyName1,
2296
- keyVersion
2297
- ],
2298
- headerParameters: [contentType, accept],
2299
- mediaType: "json",
2300
- serializer
2301
- };
2302
2250
  const releaseOperationSpec = {
2303
2251
  path: "/keys/{key-name}/{key-version}/release",
2304
2252
  httpMethod: "POST",
@@ -2312,7 +2260,7 @@ const releaseOperationSpec = {
2312
2260
  },
2313
2261
  requestBody: {
2314
2262
  parameterPath: {
2315
- target: ["target"],
2263
+ targetAttestationToken: ["targetAttestationToken"],
2316
2264
  nonce: ["options", "nonce"],
2317
2265
  enc: ["options", "enc"]
2318
2266
  },
@@ -4150,6 +4098,40 @@ class CryptographyClient {
4150
4098
  }
4151
4099
  }
4152
4100
 
4101
+ // Copyright (c) Microsoft Corporation.
4102
+ (function (KnownEncryptionAlgorithms) {
4103
+ /** Encryption Algorithm - RSA-OAEP */
4104
+ KnownEncryptionAlgorithms["RSAOaep"] = "RSA-OAEP";
4105
+ /** Encryption Algorithm - RSA-OAEP-256 */
4106
+ KnownEncryptionAlgorithms["RSAOaep256"] = "RSA-OAEP-256";
4107
+ /** Encryption Algorithm - RSA1_5 */
4108
+ KnownEncryptionAlgorithms["RSA15"] = "RSA1_5";
4109
+ /** Encryption Algorithm - A128GCM */
4110
+ KnownEncryptionAlgorithms["A128GCM"] = "A128GCM";
4111
+ /** Encryption Algorithm - A192GCM */
4112
+ KnownEncryptionAlgorithms["A192GCM"] = "A192GCM";
4113
+ /** Encryption Algorithm - A256GCM */
4114
+ KnownEncryptionAlgorithms["A256GCM"] = "A256GCM";
4115
+ /** Encryption Algorithm - A128KW */
4116
+ KnownEncryptionAlgorithms["A128KW"] = "A128KW";
4117
+ /** Encryption Algorithm - A192KW */
4118
+ KnownEncryptionAlgorithms["A192KW"] = "A192KW";
4119
+ /** Encryption Algorithm - A256KW */
4120
+ KnownEncryptionAlgorithms["A256KW"] = "A256KW";
4121
+ /** Encryption Algorithm - A128CBC */
4122
+ KnownEncryptionAlgorithms["A128CBC"] = "A128CBC";
4123
+ /** Encryption Algorithm - A192CBC */
4124
+ KnownEncryptionAlgorithms["A192CBC"] = "A192CBC";
4125
+ /** Encryption Algorithm - A256CBC */
4126
+ KnownEncryptionAlgorithms["A256CBC"] = "A256CBC";
4127
+ /** Encryption Algorithm - A128CBCPAD */
4128
+ KnownEncryptionAlgorithms["A128Cbcpad"] = "A128CBCPAD";
4129
+ /** Encryption Algorithm - A192CBCPAD */
4130
+ KnownEncryptionAlgorithms["A192Cbcpad"] = "A192CBCPAD";
4131
+ /** Encryption Algorithm - A256CBCPAD */
4132
+ KnownEncryptionAlgorithms["A256Cbcpad"] = "A256CBCPAD";
4133
+ })(exports.KnownEncryptionAlgorithms || (exports.KnownEncryptionAlgorithms = {}));
4134
+
4153
4135
  // Copyright (c) Microsoft Corporation.
4154
4136
  const withTrace$4 = createTraceFunction("Azure.KeyVault.Keys.KeyClient");
4155
4137
  /**