@azure/keyvault-keys 4.4.0 → 4.4.1-alpha.20220401.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 +10 -0
- package/dist/index.js +48 -93
- package/dist/index.js.map +1 -1
- package/dist-esm/keyvault-common/src/index.js +0 -1
- package/dist-esm/keyvault-common/src/index.js.map +1 -1
- package/dist-esm/keyvault-keys/src/constants.js +1 -1
- package/dist-esm/keyvault-keys/src/constants.js.map +1 -1
- package/dist-esm/keyvault-keys/src/cryptography/remoteCryptographyProvider.js +11 -11
- package/dist-esm/keyvault-keys/src/cryptography/remoteCryptographyProvider.js.map +1 -1
- package/dist-esm/keyvault-keys/src/cryptographyClient.js +9 -10
- package/dist-esm/keyvault-keys/src/cryptographyClient.js.map +1 -1
- package/dist-esm/keyvault-keys/src/generated/keyVaultClientContext.js +1 -1
- package/dist-esm/keyvault-keys/src/generated/keyVaultClientContext.js.map +1 -1
- package/dist-esm/keyvault-keys/src/index.js +20 -21
- package/dist-esm/keyvault-keys/src/index.js.map +1 -1
- package/dist-esm/keyvault-keys/src/lro/delete/operation.js +3 -7
- package/dist-esm/keyvault-keys/src/lro/delete/operation.js.map +1 -1
- package/dist-esm/keyvault-keys/src/lro/recover/operation.js +3 -7
- package/dist-esm/keyvault-keys/src/lro/recover/operation.js.map +1 -1
- package/dist-esm/keyvault-keys/src/tracing.js +8 -0
- package/dist-esm/keyvault-keys/src/tracing.js.map +1 -0
- package/package.json +6 -6
- package/dist-esm/keyvault-common/src/tracingHelpers.js +0 -42
- package/dist-esm/keyvault-common/src/tracingHelpers.js.map +0 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -6,9 +6,9 @@ var tslib = require('tslib');
|
|
|
6
6
|
var coreHttp = require('@azure/core-http');
|
|
7
7
|
var logger$1 = require('@azure/logger');
|
|
8
8
|
require('@azure/core-paging');
|
|
9
|
+
var coreTracing = require('@azure/core-tracing');
|
|
9
10
|
var url = require('url');
|
|
10
11
|
var coreLro = require('@azure/core-lro');
|
|
11
|
-
var coreTracing = require('@azure/core-tracing');
|
|
12
12
|
var crypto = require('crypto');
|
|
13
13
|
var constants = require('constants');
|
|
14
14
|
|
|
@@ -1344,7 +1344,7 @@ const nextLink = {
|
|
|
1344
1344
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
1345
1345
|
*/
|
|
1346
1346
|
const packageName = "@azure/keyvault-keys";
|
|
1347
|
-
const packageVersion = "4.4.
|
|
1347
|
+
const packageVersion = "4.4.1";
|
|
1348
1348
|
class KeyVaultClientContext extends coreHttp__namespace.ServiceClient {
|
|
1349
1349
|
/**
|
|
1350
1350
|
* Initializes a new instance of the KeyVaultClientContext class.
|
|
@@ -2478,7 +2478,7 @@ const getDeletedKeysNextOperationSpec = {
|
|
|
2478
2478
|
|
|
2479
2479
|
// Copyright (c) Microsoft Corporation.
|
|
2480
2480
|
// Licensed under the MIT license.
|
|
2481
|
-
const SDK_VERSION = "4.4.
|
|
2481
|
+
const SDK_VERSION = "4.4.1";
|
|
2482
2482
|
|
|
2483
2483
|
// Copyright (c) Microsoft Corporation.
|
|
2484
2484
|
// Licensed under the MIT license.
|
|
@@ -2728,45 +2728,11 @@ function parseKeyvaultIdentifier(collection, identifier) {
|
|
|
2728
2728
|
};
|
|
2729
2729
|
}
|
|
2730
2730
|
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
*
|
|
2737
|
-
* @example const withTrace = createTraceFunction("Azure.KeyVault.Certificates.CertificateClient")
|
|
2738
|
-
*
|
|
2739
|
-
* @internal
|
|
2740
|
-
*/
|
|
2741
|
-
function createTraceFunction(prefix) {
|
|
2742
|
-
const createSpan = coreTracing.createSpanFunction({
|
|
2743
|
-
namespace: "Microsoft.KeyVault",
|
|
2744
|
-
packagePrefix: prefix,
|
|
2745
|
-
});
|
|
2746
|
-
return async function (operationName, options, cb) {
|
|
2747
|
-
const { updatedOptions, span } = createSpan(operationName, options);
|
|
2748
|
-
try {
|
|
2749
|
-
// NOTE: we really do need to await on this function here so we can handle any exceptions thrown and properly
|
|
2750
|
-
// close the span.
|
|
2751
|
-
const result = await cb(updatedOptions, span);
|
|
2752
|
-
// otel 0.16+ needs this or else the code ends up being set as UNSET
|
|
2753
|
-
span.setStatus({
|
|
2754
|
-
code: coreTracing.SpanStatusCode.OK,
|
|
2755
|
-
});
|
|
2756
|
-
return result;
|
|
2757
|
-
}
|
|
2758
|
-
catch (err) {
|
|
2759
|
-
span.setStatus({
|
|
2760
|
-
code: coreTracing.SpanStatusCode.ERROR,
|
|
2761
|
-
message: err.message,
|
|
2762
|
-
});
|
|
2763
|
-
throw err;
|
|
2764
|
-
}
|
|
2765
|
-
finally {
|
|
2766
|
-
span.end();
|
|
2767
|
-
}
|
|
2768
|
-
};
|
|
2769
|
-
}
|
|
2731
|
+
const tracingClient = coreTracing.createTracingClient({
|
|
2732
|
+
namespace: "Microsoft.KeyVault",
|
|
2733
|
+
packageName: "@azure/keyvault-keys",
|
|
2734
|
+
packageVersion: SDK_VERSION,
|
|
2735
|
+
});
|
|
2770
2736
|
|
|
2771
2737
|
// Copyright (c) Microsoft Corporation.
|
|
2772
2738
|
/**
|
|
@@ -2971,10 +2937,6 @@ class KeyVaultKeyPollOperation {
|
|
|
2971
2937
|
}
|
|
2972
2938
|
|
|
2973
2939
|
// Copyright (c) Microsoft Corporation.
|
|
2974
|
-
/**
|
|
2975
|
-
* @internal
|
|
2976
|
-
*/
|
|
2977
|
-
const withTrace$4 = createTraceFunction("Azure.KeyVault.Keys.DeleteKeyPoller");
|
|
2978
2940
|
class DeleteKeyPollOperation extends KeyVaultKeyPollOperation {
|
|
2979
2941
|
constructor(state, vaultUrl, client, operationOptions = {}) {
|
|
2980
2942
|
super(state, { cancelMessage: "Canceling the deletion of a key is not supported." });
|
|
@@ -2988,7 +2950,7 @@ class DeleteKeyPollOperation extends KeyVaultKeyPollOperation {
|
|
|
2988
2950
|
* Since the Key Vault Key won't be immediately deleted, we have {@link beginDeleteKey}.
|
|
2989
2951
|
*/
|
|
2990
2952
|
deleteKey(name, options = {}) {
|
|
2991
|
-
return
|
|
2953
|
+
return tracingClient.withSpan("DeleteKeyPoller.deleteKey", options, async (updatedOptions) => {
|
|
2992
2954
|
const response = await this.client.deleteKey(this.vaultUrl, name, updatedOptions);
|
|
2993
2955
|
return getKeyFromKeyBundle(response);
|
|
2994
2956
|
});
|
|
@@ -2998,7 +2960,7 @@ class DeleteKeyPollOperation extends KeyVaultKeyPollOperation {
|
|
|
2998
2960
|
* This operation requires the keys/get permission.
|
|
2999
2961
|
*/
|
|
3000
2962
|
getDeletedKey(name, options = {}) {
|
|
3001
|
-
return
|
|
2963
|
+
return tracingClient.withSpan("DeleteKeyPoller.getDeletedKey", options, async (updatedOptions) => {
|
|
3002
2964
|
const response = await this.client.getDeletedKey(this.vaultUrl, name, updatedOptions);
|
|
3003
2965
|
return getKeyFromKeyBundle(response);
|
|
3004
2966
|
});
|
|
@@ -3059,10 +3021,6 @@ class DeleteKeyPoller extends KeyVaultKeyPoller {
|
|
|
3059
3021
|
}
|
|
3060
3022
|
|
|
3061
3023
|
// Copyright (c) Microsoft Corporation.
|
|
3062
|
-
/**
|
|
3063
|
-
* @internal
|
|
3064
|
-
*/
|
|
3065
|
-
const withTrace$3 = createTraceFunction("Azure.KeyVault.Keys.RecoverDeletedKeyPoller");
|
|
3066
3024
|
class RecoverDeletedKeyPollOperation extends KeyVaultKeyPollOperation {
|
|
3067
3025
|
constructor(state, vaultUrl, client, operationOptions = {}) {
|
|
3068
3026
|
super(state, { cancelMessage: "Canceling the recovery of a deleted key is not supported." });
|
|
@@ -3076,7 +3034,7 @@ class RecoverDeletedKeyPollOperation extends KeyVaultKeyPollOperation {
|
|
|
3076
3034
|
* This operation requires the keys/get permission.
|
|
3077
3035
|
*/
|
|
3078
3036
|
getKey(name, options = {}) {
|
|
3079
|
-
return
|
|
3037
|
+
return tracingClient.withSpan("RecoverDeleteKeyPoller.getKey", options, async (updatedOptions) => {
|
|
3080
3038
|
const response = await this.client.getKey(this.vaultUrl, name, (updatedOptions === null || updatedOptions === void 0 ? void 0 : updatedOptions.version) || "", updatedOptions);
|
|
3081
3039
|
return getKeyFromKeyBundle(response);
|
|
3082
3040
|
});
|
|
@@ -3086,7 +3044,7 @@ class RecoverDeletedKeyPollOperation extends KeyVaultKeyPollOperation {
|
|
|
3086
3044
|
* Since the Key Vault Key won't be immediately recover the deleted key, we have {@link beginRecoverDeletedKey}.
|
|
3087
3045
|
*/
|
|
3088
3046
|
async recoverDeletedKey(name, options = {}) {
|
|
3089
|
-
return
|
|
3047
|
+
return tracingClient.withSpan("RecoverDeletedKeyPoller.recoverDeleteKey", options, async (updatedOptions) => {
|
|
3090
3048
|
const response = await this.client.recoverDeletedKey(this.vaultUrl, name, updatedOptions);
|
|
3091
3049
|
return getKeyFromKeyBundle(response);
|
|
3092
3050
|
});
|
|
@@ -3240,7 +3198,6 @@ function randomBytes(length) {
|
|
|
3240
3198
|
}
|
|
3241
3199
|
|
|
3242
3200
|
// Copyright (c) Microsoft Corporation.
|
|
3243
|
-
const withTrace$2 = createTraceFunction("Azure.KeyVault.Keys.RemoteCryptographyProvider");
|
|
3244
3201
|
/**
|
|
3245
3202
|
* The remote cryptography provider is used to run crypto operations against KeyVault.
|
|
3246
3203
|
* @internal
|
|
@@ -3281,7 +3238,7 @@ class RemoteCryptographyProvider {
|
|
|
3281
3238
|
encrypt(encryptParameters, options = {}) {
|
|
3282
3239
|
const { algorithm, plaintext } = encryptParameters, params = tslib.__rest(encryptParameters, ["algorithm", "plaintext"]);
|
|
3283
3240
|
const requestOptions = Object.assign(Object.assign({}, options), params);
|
|
3284
|
-
return
|
|
3241
|
+
return tracingClient.withSpan("RemoteCryptographyProvider.encrypt", requestOptions, async (updatedOptions) => {
|
|
3285
3242
|
const result = await this.client.encrypt(this.vaultUrl, this.name, this.version, algorithm, plaintext, updatedOptions);
|
|
3286
3243
|
return {
|
|
3287
3244
|
algorithm: encryptParameters.algorithm,
|
|
@@ -3296,7 +3253,7 @@ class RemoteCryptographyProvider {
|
|
|
3296
3253
|
decrypt(decryptParameters, options = {}) {
|
|
3297
3254
|
const { algorithm, ciphertext } = decryptParameters, params = tslib.__rest(decryptParameters, ["algorithm", "ciphertext"]);
|
|
3298
3255
|
const requestOptions = Object.assign(Object.assign({}, options), params);
|
|
3299
|
-
return
|
|
3256
|
+
return tracingClient.withSpan("RemoteCryptographyProvider.decrypt", requestOptions, async (updatedOptions) => {
|
|
3300
3257
|
const result = await this.client.decrypt(this.vaultUrl, this.name, this.version, algorithm, ciphertext, updatedOptions);
|
|
3301
3258
|
return {
|
|
3302
3259
|
result: result.result,
|
|
@@ -3306,7 +3263,7 @@ class RemoteCryptographyProvider {
|
|
|
3306
3263
|
});
|
|
3307
3264
|
}
|
|
3308
3265
|
wrapKey(algorithm, keyToWrap, options = {}) {
|
|
3309
|
-
return
|
|
3266
|
+
return tracingClient.withSpan("RemoteCryptographyProvider.wrapKey", options, async (updatedOptions) => {
|
|
3310
3267
|
const result = await this.client.wrapKey(this.vaultUrl, this.name, this.version, algorithm, keyToWrap, updatedOptions);
|
|
3311
3268
|
return {
|
|
3312
3269
|
result: result.result,
|
|
@@ -3316,7 +3273,7 @@ class RemoteCryptographyProvider {
|
|
|
3316
3273
|
});
|
|
3317
3274
|
}
|
|
3318
3275
|
unwrapKey(algorithm, encryptedKey, options = {}) {
|
|
3319
|
-
return
|
|
3276
|
+
return tracingClient.withSpan("RemoteCryptographyProvider.unwrapKey", options, async (updatedOptions) => {
|
|
3320
3277
|
const result = await this.client.unwrapKey(this.vaultUrl, this.name, this.version, algorithm, encryptedKey, updatedOptions);
|
|
3321
3278
|
return {
|
|
3322
3279
|
result: result.result,
|
|
@@ -3326,19 +3283,19 @@ class RemoteCryptographyProvider {
|
|
|
3326
3283
|
});
|
|
3327
3284
|
}
|
|
3328
3285
|
sign(algorithm, digest, options = {}) {
|
|
3329
|
-
return
|
|
3286
|
+
return tracingClient.withSpan("RemoteCryptographyProvider.sign", options, async (updatedOptions) => {
|
|
3330
3287
|
const result = await this.client.sign(this.vaultUrl, this.name, this.version, algorithm, digest, updatedOptions);
|
|
3331
3288
|
return { result: result.result, algorithm, keyID: this.getKeyID() };
|
|
3332
3289
|
});
|
|
3333
3290
|
}
|
|
3334
3291
|
verifyData(algorithm, data, signature, options = {}) {
|
|
3335
|
-
return
|
|
3292
|
+
return tracingClient.withSpan("RemoteCryptographyProvider.verifyData", options, async (updatedOptions) => {
|
|
3336
3293
|
const hash = await createHash(algorithm, data);
|
|
3337
3294
|
return this.verify(algorithm, hash, signature, updatedOptions);
|
|
3338
3295
|
});
|
|
3339
3296
|
}
|
|
3340
3297
|
verify(algorithm, digest, signature, options = {}) {
|
|
3341
|
-
return
|
|
3298
|
+
return tracingClient.withSpan("RemoteCryptographyProvider.verify", options, async (updatedOptions) => {
|
|
3342
3299
|
const response = await this.client.verify(this.vaultUrl, this.name, this.version, algorithm, digest, signature, updatedOptions);
|
|
3343
3300
|
return {
|
|
3344
3301
|
result: response.value ? response.value : false,
|
|
@@ -3347,7 +3304,7 @@ class RemoteCryptographyProvider {
|
|
|
3347
3304
|
});
|
|
3348
3305
|
}
|
|
3349
3306
|
signData(algorithm, data, options = {}) {
|
|
3350
|
-
return
|
|
3307
|
+
return tracingClient.withSpan("RemoteCryptographyProvider.signData", options, async (updatedOptions) => {
|
|
3351
3308
|
const digest = await createHash(algorithm, data);
|
|
3352
3309
|
const result = await this.client.sign(this.vaultUrl, this.name, this.version, algorithm, digest, updatedOptions);
|
|
3353
3310
|
return { result: result.result, algorithm, keyID: this.getKeyID() };
|
|
@@ -3365,7 +3322,7 @@ class RemoteCryptographyProvider {
|
|
|
3365
3322
|
* @param options - Additional options.
|
|
3366
3323
|
*/
|
|
3367
3324
|
getKey(options = {}) {
|
|
3368
|
-
return
|
|
3325
|
+
return tracingClient.withSpan("RemoteCryptographyProvider.getKey", options, async (updatedOptions) => {
|
|
3369
3326
|
if (typeof this.key === "string") {
|
|
3370
3327
|
if (!this.name || this.name === "") {
|
|
3371
3328
|
throw new Error("getKey requires a key with a name");
|
|
@@ -3728,7 +3685,6 @@ class AesCryptographyProvider {
|
|
|
3728
3685
|
}
|
|
3729
3686
|
|
|
3730
3687
|
// Copyright (c) Microsoft Corporation.
|
|
3731
|
-
const withTrace$1 = createTraceFunction("Azure.KeyVault.Keys.CryptographyClient");
|
|
3732
3688
|
/**
|
|
3733
3689
|
* A client used to perform cryptographic operations on an Azure Key vault key
|
|
3734
3690
|
* or a local {@link JsonWebKey}.
|
|
@@ -3787,7 +3743,7 @@ class CryptographyClient {
|
|
|
3787
3743
|
}
|
|
3788
3744
|
encrypt(...args) {
|
|
3789
3745
|
const [parameters, options] = this.disambiguateEncryptArguments(args);
|
|
3790
|
-
return
|
|
3746
|
+
return tracingClient.withSpan("CryptographyClient.encrypt", options, async (updatedOptions) => {
|
|
3791
3747
|
this.ensureValid(await this.fetchKey(updatedOptions), exports.KnownKeyOperations.Encrypt);
|
|
3792
3748
|
this.initializeIV(parameters);
|
|
3793
3749
|
const provider = await this.getProvider("encrypt", parameters.algorithm, updatedOptions);
|
|
@@ -3846,7 +3802,7 @@ class CryptographyClient {
|
|
|
3846
3802
|
}
|
|
3847
3803
|
decrypt(...args) {
|
|
3848
3804
|
const [parameters, options] = this.disambiguateDecryptArguments(args);
|
|
3849
|
-
return
|
|
3805
|
+
return tracingClient.withSpan("CryptographyClient.decrypt", options, async (updatedOptions) => {
|
|
3850
3806
|
this.ensureValid(await this.fetchKey(updatedOptions), exports.KnownKeyOperations.Decrypt);
|
|
3851
3807
|
const provider = await this.getProvider("decrypt", parameters.algorithm, updatedOptions);
|
|
3852
3808
|
try {
|
|
@@ -3893,7 +3849,7 @@ class CryptographyClient {
|
|
|
3893
3849
|
* @param options - Additional options.
|
|
3894
3850
|
*/
|
|
3895
3851
|
wrapKey(algorithm, key, options = {}) {
|
|
3896
|
-
return
|
|
3852
|
+
return tracingClient.withSpan("CryptographyClient.wrapKey", options, async (updatedOptions) => {
|
|
3897
3853
|
this.ensureValid(await this.fetchKey(updatedOptions), exports.KnownKeyOperations.WrapKey);
|
|
3898
3854
|
const provider = await this.getProvider("wrapKey", algorithm, updatedOptions);
|
|
3899
3855
|
try {
|
|
@@ -3920,7 +3876,7 @@ class CryptographyClient {
|
|
|
3920
3876
|
* @param options - Additional options.
|
|
3921
3877
|
*/
|
|
3922
3878
|
unwrapKey(algorithm, encryptedKey, options = {}) {
|
|
3923
|
-
return
|
|
3879
|
+
return tracingClient.withSpan("CryptographyClient.unwrapKey", options, async (updatedOptions) => {
|
|
3924
3880
|
this.ensureValid(await this.fetchKey(updatedOptions), exports.KnownKeyOperations.UnwrapKey);
|
|
3925
3881
|
const provider = await this.getProvider("unwrapKey", algorithm, updatedOptions);
|
|
3926
3882
|
try {
|
|
@@ -3947,7 +3903,7 @@ class CryptographyClient {
|
|
|
3947
3903
|
* @param options - Additional options.
|
|
3948
3904
|
*/
|
|
3949
3905
|
sign(algorithm, digest, options = {}) {
|
|
3950
|
-
return
|
|
3906
|
+
return tracingClient.withSpan("CryptographyClient.sign", options, async (updatedOptions) => {
|
|
3951
3907
|
this.ensureValid(await this.fetchKey(updatedOptions), exports.KnownKeyOperations.Sign);
|
|
3952
3908
|
const provider = await this.getProvider("sign", algorithm, updatedOptions);
|
|
3953
3909
|
try {
|
|
@@ -3975,7 +3931,7 @@ class CryptographyClient {
|
|
|
3975
3931
|
* @param options - Additional options.
|
|
3976
3932
|
*/
|
|
3977
3933
|
verify(algorithm, digest, signature, options = {}) {
|
|
3978
|
-
return
|
|
3934
|
+
return tracingClient.withSpan("CryptographyClient.verify", options, async (updatedOptions) => {
|
|
3979
3935
|
this.ensureValid(await this.fetchKey(updatedOptions), exports.KnownKeyOperations.Verify);
|
|
3980
3936
|
const provider = await this.getProvider("verify", algorithm, updatedOptions);
|
|
3981
3937
|
try {
|
|
@@ -4002,7 +3958,7 @@ class CryptographyClient {
|
|
|
4002
3958
|
* @param options - Additional options.
|
|
4003
3959
|
*/
|
|
4004
3960
|
signData(algorithm, data, options = {}) {
|
|
4005
|
-
return
|
|
3961
|
+
return tracingClient.withSpan("CryptographyClient.signData", options, async (updatedOptions) => {
|
|
4006
3962
|
this.ensureValid(await this.fetchKey(updatedOptions), exports.KnownKeyOperations.Sign);
|
|
4007
3963
|
const provider = await this.getProvider("signData", algorithm, updatedOptions);
|
|
4008
3964
|
try {
|
|
@@ -4030,7 +3986,7 @@ class CryptographyClient {
|
|
|
4030
3986
|
* @param options - Additional options.
|
|
4031
3987
|
*/
|
|
4032
3988
|
verifyData(algorithm, data, signature, options = {}) {
|
|
4033
|
-
return
|
|
3989
|
+
return tracingClient.withSpan("CryptographyClient.verifyData", options, async (updatedOptions) => {
|
|
4034
3990
|
this.ensureValid(await this.fetchKey(updatedOptions), exports.KnownKeyOperations.Verify);
|
|
4035
3991
|
const provider = await this.getProvider("verifyData", algorithm, updatedOptions);
|
|
4036
3992
|
try {
|
|
@@ -4169,7 +4125,6 @@ exports.KnownEncryptionAlgorithms = void 0;
|
|
|
4169
4125
|
})(exports.KnownEncryptionAlgorithms || (exports.KnownEncryptionAlgorithms = {}));
|
|
4170
4126
|
|
|
4171
4127
|
// Copyright (c) Microsoft Corporation.
|
|
4172
|
-
const withTrace = createTraceFunction("Azure.KeyVault.Keys.KeyClient");
|
|
4173
4128
|
/**
|
|
4174
4129
|
* The KeyClient provides methods to manage {@link KeyVaultKey} in the
|
|
4175
4130
|
* Azure Key Vault. The client supports creating, retrieving, updating,
|
|
@@ -4245,7 +4200,7 @@ class KeyClient {
|
|
|
4245
4200
|
exportable,
|
|
4246
4201
|
} });
|
|
4247
4202
|
}
|
|
4248
|
-
return
|
|
4203
|
+
return tracingClient.withSpan("KeyClient.createKey", unflattenedOptions, async (updatedOptions) => {
|
|
4249
4204
|
const response = await this.client.createKey(this.vaultUrl, name, keyType, updatedOptions);
|
|
4250
4205
|
return getKeyFromKeyBundle(response);
|
|
4251
4206
|
});
|
|
@@ -4333,7 +4288,7 @@ class KeyClient {
|
|
|
4333
4288
|
exportable,
|
|
4334
4289
|
} });
|
|
4335
4290
|
}
|
|
4336
|
-
return
|
|
4291
|
+
return tracingClient.withSpan(`KeyClient.importKey`, unflattenedOptions, async (updatedOptions) => {
|
|
4337
4292
|
const response = await this.client.importKey(this.vaultUrl, name, key, updatedOptions);
|
|
4338
4293
|
return getKeyFromKeyBundle(response);
|
|
4339
4294
|
});
|
|
@@ -4405,7 +4360,7 @@ class KeyClient {
|
|
|
4405
4360
|
}
|
|
4406
4361
|
updateKeyProperties(...args) {
|
|
4407
4362
|
const [name, keyVersion, options] = this.disambiguateUpdateKeyPropertiesArgs(args);
|
|
4408
|
-
return
|
|
4363
|
+
return tracingClient.withSpan(`KeyClient.updateKeyProperties`, options, async (updatedOptions) => {
|
|
4409
4364
|
const { enabled, notBefore, expiresOn: expires } = updatedOptions, remainingOptions = tslib.__rest(updatedOptions, ["enabled", "notBefore", "expiresOn"]);
|
|
4410
4365
|
const unflattenedOptions = Object.assign(Object.assign({}, remainingOptions), { keyAttributes: {
|
|
4411
4366
|
enabled,
|
|
@@ -4446,7 +4401,7 @@ class KeyClient {
|
|
|
4446
4401
|
* @param options - The optional parameters.
|
|
4447
4402
|
*/
|
|
4448
4403
|
getKey(name, options = {}) {
|
|
4449
|
-
return
|
|
4404
|
+
return tracingClient.withSpan(`KeyClient.getKey`, options, async (updatedOptions) => {
|
|
4450
4405
|
const response = await this.client.getKey(this.vaultUrl, name, options && options.version ? options.version : "", updatedOptions);
|
|
4451
4406
|
return getKeyFromKeyBundle(response);
|
|
4452
4407
|
});
|
|
@@ -4465,7 +4420,7 @@ class KeyClient {
|
|
|
4465
4420
|
* @param options - The optional parameters.
|
|
4466
4421
|
*/
|
|
4467
4422
|
getDeletedKey(name, options = {}) {
|
|
4468
|
-
return
|
|
4423
|
+
return tracingClient.withSpan(`KeyClient.getDeletedKey`, options, async (updatedOptions) => {
|
|
4469
4424
|
const response = await this.client.getDeletedKey(this.vaultUrl, name, updatedOptions);
|
|
4470
4425
|
return getKeyFromKeyBundle(response);
|
|
4471
4426
|
});
|
|
@@ -4487,7 +4442,7 @@ class KeyClient {
|
|
|
4487
4442
|
* @param options - The optional parameters.
|
|
4488
4443
|
*/
|
|
4489
4444
|
purgeDeletedKey(name, options = {}) {
|
|
4490
|
-
return
|
|
4445
|
+
return tracingClient.withSpan(`KeyClient.purgeDeletedKey`, options, async (updatedOptions) => {
|
|
4491
4446
|
await this.client.purgeDeletedKey(this.vaultUrl, name, updatedOptions);
|
|
4492
4447
|
});
|
|
4493
4448
|
}
|
|
@@ -4547,7 +4502,7 @@ class KeyClient {
|
|
|
4547
4502
|
* @param options - The optional parameters.
|
|
4548
4503
|
*/
|
|
4549
4504
|
backupKey(name, options = {}) {
|
|
4550
|
-
return
|
|
4505
|
+
return tracingClient.withSpan(`KeyClient.backupKey`, options, async (updatedOptions) => {
|
|
4551
4506
|
const response = await this.client.backupKey(this.vaultUrl, name, updatedOptions);
|
|
4552
4507
|
return response.value;
|
|
4553
4508
|
});
|
|
@@ -4568,7 +4523,7 @@ class KeyClient {
|
|
|
4568
4523
|
* @param options - The optional parameters.
|
|
4569
4524
|
*/
|
|
4570
4525
|
async restoreKeyBackup(backup, options = {}) {
|
|
4571
|
-
return
|
|
4526
|
+
return tracingClient.withSpan(`KeyClient.restoreKeyBackup`, options, async (updatedOptions) => {
|
|
4572
4527
|
const response = await this.client.restoreKey(this.vaultUrl, backup, updatedOptions);
|
|
4573
4528
|
return getKeyFromKeyBundle(response);
|
|
4574
4529
|
});
|
|
@@ -4586,7 +4541,7 @@ class KeyClient {
|
|
|
4586
4541
|
* @param options - The optional parameters.
|
|
4587
4542
|
*/
|
|
4588
4543
|
getRandomBytes(count, options = {}) {
|
|
4589
|
-
return
|
|
4544
|
+
return tracingClient.withSpan("KeyClient.getRandomBytes", options, async (updatedOptions) => {
|
|
4590
4545
|
const response = await this.client.getRandomBytes(this.vaultUrl, count, updatedOptions);
|
|
4591
4546
|
return response.value;
|
|
4592
4547
|
});
|
|
@@ -4604,7 +4559,7 @@ class KeyClient {
|
|
|
4604
4559
|
* @param options - The optional parameters.
|
|
4605
4560
|
*/
|
|
4606
4561
|
rotateKey(name, options = {}) {
|
|
4607
|
-
return
|
|
4562
|
+
return tracingClient.withSpan("KeyClient.rotateKey", options, async (updatedOptions) => {
|
|
4608
4563
|
const key = await this.client.rotateKey(this.vaultUrl, name, updatedOptions);
|
|
4609
4564
|
return getKeyFromKeyBundle(key);
|
|
4610
4565
|
});
|
|
@@ -4625,7 +4580,7 @@ class KeyClient {
|
|
|
4625
4580
|
* @param options - The optional parameters.
|
|
4626
4581
|
*/
|
|
4627
4582
|
releaseKey(name, targetAttestationToken, options = {}) {
|
|
4628
|
-
return
|
|
4583
|
+
return tracingClient.withSpan("KeyClient.releaseKey", options, async (updatedOptions) => {
|
|
4629
4584
|
const { nonce, algorithm } = updatedOptions, rest = tslib.__rest(updatedOptions, ["nonce", "algorithm"]);
|
|
4630
4585
|
const result = await this.client.release(this.vaultUrl, name, (options === null || options === void 0 ? void 0 : options.version) || "", targetAttestationToken, Object.assign({ enc: algorithm, nonce }, rest));
|
|
4631
4586
|
return { value: result.value };
|
|
@@ -4646,7 +4601,7 @@ class KeyClient {
|
|
|
4646
4601
|
* @param options - The optional parameters.
|
|
4647
4602
|
*/
|
|
4648
4603
|
getKeyRotationPolicy(keyName, options = {}) {
|
|
4649
|
-
return
|
|
4604
|
+
return tracingClient.withSpan("KeyClient.getKeyRotationPolicy", options, async () => {
|
|
4650
4605
|
const policy = await this.client.getKeyRotationPolicy(this.vaultUrl, keyName);
|
|
4651
4606
|
return keyRotationTransformations.generatedToPublic(policy);
|
|
4652
4607
|
});
|
|
@@ -4666,7 +4621,7 @@ class KeyClient {
|
|
|
4666
4621
|
* @param options - The optional parameters.
|
|
4667
4622
|
*/
|
|
4668
4623
|
updateKeyRotationPolicy(keyName, policy, options = {}) {
|
|
4669
|
-
return
|
|
4624
|
+
return tracingClient.withSpan("KeyClient.updateKeyRotationPolicy", options, async (updatedOptions) => {
|
|
4670
4625
|
const result = await this.client.updateKeyRotationPolicy(this.vaultUrl, keyName, keyRotationTransformations.propertiesToGenerated(policy), updatedOptions);
|
|
4671
4626
|
return keyRotationTransformations.generatedToPublic(result);
|
|
4672
4627
|
});
|
|
@@ -4681,14 +4636,14 @@ class KeyClient {
|
|
|
4681
4636
|
return tslib.__asyncGenerator(this, arguments, function* listPropertiesOfKeyVersionsPage_1() {
|
|
4682
4637
|
if (continuationState.continuationToken == null) {
|
|
4683
4638
|
const optionsComplete = Object.assign({ maxresults: continuationState.maxPageSize }, options);
|
|
4684
|
-
const currentSetResponse = yield tslib.__await(
|
|
4639
|
+
const currentSetResponse = yield tslib.__await(tracingClient.withSpan("KeyClient.listPropertiesOfKeyVersionsPage", optionsComplete, async (updatedOptions) => this.client.getKeyVersions(this.vaultUrl, name, updatedOptions)));
|
|
4685
4640
|
continuationState.continuationToken = currentSetResponse.nextLink;
|
|
4686
4641
|
if (currentSetResponse.value) {
|
|
4687
4642
|
yield yield tslib.__await(currentSetResponse.value.map(getKeyPropertiesFromKeyItem, this));
|
|
4688
4643
|
}
|
|
4689
4644
|
}
|
|
4690
4645
|
while (continuationState.continuationToken) {
|
|
4691
|
-
const currentSetResponse = yield tslib.__await(
|
|
4646
|
+
const currentSetResponse = yield tslib.__await(tracingClient.withSpan("KeyClient.listPropertiesOfKeyVersionsPage", options || {}, async (updatedOptions) => this.client.getKeyVersions(continuationState.continuationToken, name, updatedOptions)));
|
|
4692
4647
|
continuationState.continuationToken = currentSetResponse.nextLink;
|
|
4693
4648
|
if (currentSetResponse.value) {
|
|
4694
4649
|
yield yield tslib.__await(currentSetResponse.value.map(getKeyPropertiesFromKeyItem, this));
|
|
@@ -4761,14 +4716,14 @@ class KeyClient {
|
|
|
4761
4716
|
return tslib.__asyncGenerator(this, arguments, function* listPropertiesOfKeysPage_1() {
|
|
4762
4717
|
if (continuationState.continuationToken == null) {
|
|
4763
4718
|
const optionsComplete = Object.assign({ maxresults: continuationState.maxPageSize }, options);
|
|
4764
|
-
const currentSetResponse = yield tslib.__await(
|
|
4719
|
+
const currentSetResponse = yield tslib.__await(tracingClient.withSpan("KeyClient.listPropertiesOfKeysPage", optionsComplete, async (updatedOptions) => this.client.getKeys(this.vaultUrl, updatedOptions)));
|
|
4765
4720
|
continuationState.continuationToken = currentSetResponse.nextLink;
|
|
4766
4721
|
if (currentSetResponse.value) {
|
|
4767
4722
|
yield yield tslib.__await(currentSetResponse.value.map(getKeyPropertiesFromKeyItem, this));
|
|
4768
4723
|
}
|
|
4769
4724
|
}
|
|
4770
4725
|
while (continuationState.continuationToken) {
|
|
4771
|
-
const currentSetResponse = yield tslib.__await(
|
|
4726
|
+
const currentSetResponse = yield tslib.__await(tracingClient.withSpan("KeyClient.listPropertiesOfKeysPage", options || {}, async (updatedOptions) => this.client.getKeys(continuationState.continuationToken, updatedOptions)));
|
|
4772
4727
|
continuationState.continuationToken = currentSetResponse.nextLink;
|
|
4773
4728
|
if (currentSetResponse.value) {
|
|
4774
4729
|
yield yield tslib.__await(currentSetResponse.value.map(getKeyPropertiesFromKeyItem, this));
|
|
@@ -4840,14 +4795,14 @@ class KeyClient {
|
|
|
4840
4795
|
return tslib.__asyncGenerator(this, arguments, function* listDeletedKeysPage_1() {
|
|
4841
4796
|
if (continuationState.continuationToken == null) {
|
|
4842
4797
|
const optionsComplete = Object.assign({ maxresults: continuationState.maxPageSize }, options);
|
|
4843
|
-
const currentSetResponse = yield tslib.__await(
|
|
4798
|
+
const currentSetResponse = yield tslib.__await(tracingClient.withSpan("KeyClient.listDeletedKeysPage", optionsComplete, async (updatedOptions) => this.client.getDeletedKeys(this.vaultUrl, updatedOptions)));
|
|
4844
4799
|
continuationState.continuationToken = currentSetResponse.nextLink;
|
|
4845
4800
|
if (currentSetResponse.value) {
|
|
4846
4801
|
yield yield tslib.__await(currentSetResponse.value.map(getDeletedKeyFromDeletedKeyItem, this));
|
|
4847
4802
|
}
|
|
4848
4803
|
}
|
|
4849
4804
|
while (continuationState.continuationToken) {
|
|
4850
|
-
const currentSetResponse = yield tslib.__await(
|
|
4805
|
+
const currentSetResponse = yield tslib.__await(tracingClient.withSpan("KeyClient.listDeletedKeysPage", options || {}, async (updatedOptions) => this.client.getDeletedKeys(continuationState.continuationToken, updatedOptions)));
|
|
4851
4806
|
continuationState.continuationToken = currentSetResponse.nextLink;
|
|
4852
4807
|
if (currentSetResponse.value) {
|
|
4853
4808
|
yield yield tslib.__await(currentSetResponse.value.map(getDeletedKeyFromDeletedKeyItem, this));
|