@azure/keyvault-secrets 4.5.2-alpha.20220919.6 → 4.6.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.
@@ -1,6 +1,19 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
3
  import { parseWWWAuthenticate } from "./parseWWWAuthenticate";
4
+ function verifyChallengeResource(scope, request) {
5
+ let scopeAsUrl;
6
+ try {
7
+ scopeAsUrl = new URL(scope);
8
+ }
9
+ catch (e) {
10
+ throw new Error(`The challenge contains invalid scope '${scope}'`);
11
+ }
12
+ const requestUrl = new URL(request.url);
13
+ if (!requestUrl.hostname.endsWith(`.${scopeAsUrl.hostname}`)) {
14
+ throw new Error(`The challenge resource '${scopeAsUrl.hostname}' does not match the requested domain. Set disableChallengeResourceVerification to true in your client options to disable. See https://aka.ms/azsdk/blog/vault-uri for more information.`);
15
+ }
16
+ }
4
17
  /**
5
18
  * @internal
6
19
  *
@@ -14,14 +27,15 @@ import { parseWWWAuthenticate } from "./parseWWWAuthenticate";
14
27
  *
15
28
  * Following the first request of a client, follow-up requests will get the cached token
16
29
  * if possible.
30
+ *
17
31
  */
18
- export function createChallengeCallbacks() {
32
+ export function createChallengeCallbacks({ disableChallengeResourceVerification, } = {}) {
19
33
  let challengeState = { status: "none" };
20
34
  function requestToOptions(request) {
21
35
  return {
22
36
  abortSignal: request.abortSignal,
23
37
  requestOptions: {
24
- timeout: request.timeout > 0 ? request.timeout : undefined,
38
+ timeout: request.timeout,
25
39
  },
26
40
  tracingOptions: request.tracingOptions,
27
41
  };
@@ -69,6 +83,9 @@ export function createChallengeCallbacks() {
69
83
  if (!scope) {
70
84
  throw new Error("Missing scope.");
71
85
  }
86
+ if (!disableChallengeResourceVerification) {
87
+ verifyChallengeResource(scope, request);
88
+ }
72
89
  const accessToken = await options.getAccessToken([scope], Object.assign(Object.assign({}, getTokenOptions), { tenantId: parsedChallenge.tenantId }));
73
90
  if (!accessToken) {
74
91
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"challengeBasedAuthenticationPolicy.js","sourceRoot":"","sources":["../../../../keyvault-common/src/challengeBasedAuthenticationPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EAAyB,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AA6BrF;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,wBAAwB;IACtC,IAAI,cAAc,GAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAExD,SAAS,gBAAgB,CAAC,OAAwB;QAChD,OAAO;YACL,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,cAAc,EAAE;gBACd,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;aAC3D;YACD,cAAc,EAAE,OAAO,CAAC,cAAc;SACvC,CAAC;IACJ,CAAC;IAED,KAAK,UAAU,gBAAgB,CAAC,OAAgC;QAC9D,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QAC5B,MAAM,cAAc,GAAoB,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAElE,QAAQ,cAAc,CAAC,MAAM,EAAE;YAC7B,KAAK,MAAM;gBACT,cAAc,GAAG;oBACf,MAAM,EAAE,SAAS;oBACjB,YAAY,EAAE,OAAO,CAAC,IAAI;iBAC3B,CAAC;gBACF,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;gBACpB,MAAM;YACR,KAAK,SAAS;gBACZ,MAAM,CAAC,mDAAmD;YAC5D,KAAK,UAAU,CAAC,CAAC;gBACf,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,cAAc,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;gBAClF,IAAI,KAAK,EAAE;oBACT,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,KAAK,CA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AAG;YACf,MAAM,EAAE,UAAU;YAClB,MAAM,EAAE,CAAC,KAAK,CAAC;SAChB,CAAC;QAEF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,gBAAgB;QAChB,2BAA2B;KAC5B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n AuthorizeRequestOnChallengeOptions,\n AuthorizeRequestOptions,\n ChallengeCallbacks,\n PipelineRequest,\n RequestBodyType,\n} from \"@azure/core-rest-pipeline\";\nimport { ParsedWWWAuthenticate, parseWWWAuthenticate } from \"./parseWWWAuthenticate\";\n\nimport { GetTokenOptions } from \"@azure/core-auth\";\n\n/**\n * @internal\n * Holds the state of Challenge Auth.\n * When making the first request we force Key Vault to begin a challenge\n * by clearing out the request body and storing it locally.\n *\n * Later on, the authorizeRequestOnChallenge callback will process the\n * challenge and, if ready to resend the original request, reset the body\n * so that it may be sent again.\n *\n * Once a client has succeeded once, we can start skipping CAE.\n */\ntype ChallengeState =\n | {\n status: \"none\";\n }\n | {\n status: \"started\";\n originalBody?: RequestBodyType;\n }\n | {\n status: \"complete\";\n scopes: string[];\n };\n\n/**\n * @internal\n *\n * Creates challenge callback handlers to manage CAE lifecycle in Azure Key Vault.\n *\n * Key Vault supports other authentication schemes, but we ensure challenge authentication\n * is used by first sending a copy of the request, without authorization or content.\n *\n * when the challenge is received, it will be authenticated and used to send the original\n * request with authorization.\n *\n * Following the first request of a client, follow-up requests will get the cached token\n * if possible.\n */\nexport function createChallengeCallbacks(): ChallengeCallbacks {\n let challengeState: ChallengeState = { status: \"none\" };\n\n function requestToOptions(request: PipelineRequest): GetTokenOptions {\n return {\n abortSignal: request.abortSignal,\n requestOptions: {\n timeout: request.timeout > 0 ? request.timeout : undefined,\n },\n tracingOptions: request.tracingOptions,\n };\n }\n\n async function authorizeRequest(options: AuthorizeRequestOptions) {\n const { request } = options;\n const requestOptions: GetTokenOptions = requestToOptions(request);\n\n switch (challengeState.status) {\n case \"none\":\n challengeState = {\n status: \"started\",\n originalBody: request.body,\n };\n request.body = null;\n break;\n case \"started\":\n break; // Retry, we should not overwrite the original body\n case \"complete\": {\n const token = await options.getAccessToken(challengeState.scopes, requestOptions);\n if (token) {\n request.headers.set(\"authorization\", `Bearer ${token.token}`);\n }\n break;\n }\n }\n return Promise.resolve();\n }\n\n async function authorizeRequestOnChallenge(\n options: AuthorizeRequestOnChallengeOptions\n ): Promise<boolean> {\n const { request, response } = options;\n\n if (request.body === null && challengeState.status === \"started\") {\n // Reset the original body before doing anything else.\n // Note: If successful status will be \"complete\", otherwise \"none\" will\n // restart the process.\n request.body = challengeState.originalBody;\n }\n\n const getTokenOptions = requestToOptions(request);\n\n const challenge = response.headers.get(\"WWW-Authenticate\");\n if (!challenge) {\n throw new Error(\"Missing challenge.\");\n }\n const parsedChallenge: ParsedWWWAuthenticate = parseWWWAuthenticate(challenge) || {};\n\n const scope = parsedChallenge.resource\n ? parsedChallenge.resource + \"/.default\"\n : parsedChallenge.scope;\n\n if (!scope) {\n throw new Error(\"Missing scope.\");\n }\n\n const accessToken = await options.getAccessToken([scope], {\n ...getTokenOptions,\n tenantId: parsedChallenge.tenantId,\n });\n\n if (!accessToken) {\n return false;\n }\n\n options.request.headers.set(\"Authorization\", `Bearer ${accessToken.token}`);\n\n challengeState = {\n status: \"complete\",\n scopes: [scope],\n };\n\n return true;\n }\n\n return {\n authorizeRequest,\n authorizeRequestOnChallenge,\n };\n}\n"]}
1
+ {"version":3,"file":"challengeBasedAuthenticationPolicy.js","sourceRoot":"","sources":["../../../../keyvault-common/src/challengeBasedAuthenticationPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EAAyB,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAsCrF,SAAS,uBAAuB,CAAC,KAAa,EAAE,OAAwB;IACtE,IAAI,UAAe,CAAC;IACpB,IAAI;QACF,UAAU,GAAG,IAAI,GAAG,CAA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C,QAAQ,IAClC,CAAC;QAEH,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO,KAAK,CAAC;SACd;QAED,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC;QAE5E,cAAc,GAAG;YACf,MAAM,EAAE,UAAU;YAClB,MAAM,EAAE,CAAC,KAAK,CAAC;SAChB,CAAC;QAEF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,gBAAgB;QAChB,2BAA2B;KAC5B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n AuthorizeRequestOnChallengeOptions,\n AuthorizeRequestOptions,\n ChallengeCallbacks,\n PipelineRequest,\n RequestBodyType,\n} from \"@azure/core-rest-pipeline\";\nimport { ParsedWWWAuthenticate, parseWWWAuthenticate } from \"./parseWWWAuthenticate\";\n\nimport { GetTokenOptions } from \"@azure/core-auth\";\n\n/**\n * @internal\n * Holds the state of Challenge Auth.\n * When making the first request we force Key Vault to begin a challenge\n * by clearing out the request body and storing it locally.\n *\n * Later on, the authorizeRequestOnChallenge callback will process the\n * challenge and, if ready to resend the original request, reset the body\n * so that it may be sent again.\n *\n * Once a client has succeeded once, we can start skipping CAE.\n */\ntype ChallengeState =\n | {\n status: \"none\";\n }\n | {\n status: \"started\";\n originalBody?: RequestBodyType;\n }\n | {\n status: \"complete\";\n scopes: string[];\n };\n\nexport interface CreateChallengeCallbacksOptions {\n /**\n * Whether to disable verification that the challenge resource matches the Key Vault or Managed HSM domain.\n *\n * Defaults to false.\n */\n disableChallengeResourceVerification?: boolean;\n}\n\nfunction verifyChallengeResource(scope: string, request: PipelineRequest): void {\n let scopeAsUrl: URL;\n try {\n scopeAsUrl = new URL(scope);\n } catch (e) {\n throw new Error(`The challenge contains invalid scope '${scope}'`);\n }\n\n const requestUrl = new URL(request.url);\n\n if (!requestUrl.hostname.endsWith(`.${scopeAsUrl.hostname}`)) {\n throw new Error(\n `The challenge resource '${scopeAsUrl.hostname}' does not match the requested domain. Set disableChallengeResourceVerification to true in your client options to disable. See https://aka.ms/azsdk/blog/vault-uri for more information.`\n );\n }\n}\n\n/**\n * @internal\n *\n * Creates challenge callback handlers to manage CAE lifecycle in Azure Key Vault.\n *\n * Key Vault supports other authentication schemes, but we ensure challenge authentication\n * is used by first sending a copy of the request, without authorization or content.\n *\n * when the challenge is received, it will be authenticated and used to send the original\n * request with authorization.\n *\n * Following the first request of a client, follow-up requests will get the cached token\n * if possible.\n *\n */\nexport function createChallengeCallbacks({\n disableChallengeResourceVerification,\n}: CreateChallengeCallbacksOptions = {}): ChallengeCallbacks {\n let challengeState: ChallengeState = { status: \"none\" };\n\n function requestToOptions(request: PipelineRequest): GetTokenOptions {\n return {\n abortSignal: request.abortSignal,\n requestOptions: {\n timeout: request.timeout,\n },\n tracingOptions: request.tracingOptions,\n };\n }\n\n async function authorizeRequest(options: AuthorizeRequestOptions) {\n const { request } = options;\n const requestOptions: GetTokenOptions = requestToOptions(request);\n\n switch (challengeState.status) {\n case \"none\":\n challengeState = {\n status: \"started\",\n originalBody: request.body,\n };\n request.body = null;\n break;\n case \"started\":\n break; // Retry, we should not overwrite the original body\n case \"complete\": {\n const token = await options.getAccessToken(challengeState.scopes, requestOptions);\n if (token) {\n request.headers.set(\"authorization\", `Bearer ${token.token}`);\n }\n break;\n }\n }\n return Promise.resolve();\n }\n\n async function authorizeRequestOnChallenge(\n options: AuthorizeRequestOnChallengeOptions\n ): Promise<boolean> {\n const { request, response } = options;\n\n if (request.body === null && challengeState.status === \"started\") {\n // Reset the original body before doing anything else.\n // Note: If successful status will be \"complete\", otherwise \"none\" will\n // restart the process.\n request.body = challengeState.originalBody;\n }\n\n const getTokenOptions = requestToOptions(request);\n\n const challenge = response.headers.get(\"WWW-Authenticate\");\n if (!challenge) {\n throw new Error(\"Missing challenge.\");\n }\n const parsedChallenge: ParsedWWWAuthenticate = parseWWWAuthenticate(challenge) || {};\n\n const scope = parsedChallenge.resource\n ? parsedChallenge.resource + \"/.default\"\n : parsedChallenge.scope;\n\n if (!scope) {\n throw new Error(\"Missing scope.\");\n }\n\n if (!disableChallengeResourceVerification) {\n verifyChallengeResource(scope, request);\n }\n\n const accessToken = await options.getAccessToken([scope], {\n ...getTokenOptions,\n tenantId: parsedChallenge.tenantId,\n });\n\n if (!accessToken) {\n return false;\n }\n\n options.request.headers.set(\"Authorization\", `Bearer ${accessToken.token}`);\n\n challengeState = {\n status: \"complete\",\n scopes: [scope],\n };\n\n return true;\n }\n\n return {\n authorizeRequest,\n authorizeRequestOnChallenge,\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
- export const SDK_VERSION = "4.5.2";
3
+ export const SDK_VERSION = "4.6.0";
4
4
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,OAAO,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const SDK_VERSION: string = \"4.5.2\";\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,OAAO,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const SDK_VERSION: string = \"4.6.0\";\n"]}
@@ -29,7 +29,7 @@ export class KeyVaultClient extends coreHttpCompat.ExtendedServiceClient {
29
29
  const defaults = {
30
30
  requestContentType: "application/json; charset=utf-8"
31
31
  };
32
- const packageDetails = `azsdk-js-keyvault-secrets/4.5.2`;
32
+ const packageDetails = `azsdk-js-keyvault-secrets/4.6.0`;
33
33
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
34
34
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
35
35
  : `${packageDetails}`;
@@ -1 +1 @@
1
- {"version":3,"file":"keyVaultClient.js","sourceRoot":"","sources":["../../../../src/generated/keyVaultClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,cAAc,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAmC5C,gBAAgB;AAChB,MAAM,OAAO,cAAe,SAAQ,cAAc,CAAC,qBAAqB;IAGtE;;;;OAIG;IACH,YACE,UAAwB,EACxB,OAAsC;;QAEtC,IAAI,UAAU,KAAK,SAAS,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;SAChD;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,EAAE,CAAC;SACd;QACD,MAAM,QAAQ,GAAiC;YAC7C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,iCAAiC,CAAC;QACzD,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,OAAO,EAAE,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAA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ated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreHttpCompat from \"@azure/core-http-compat\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport * as Parameters from \"./models/parameters\";\nimport * as Mappers from \"./models/mappers\";\nimport {\n ApiVersion73,\n KeyVaultClientOptionalParams,\n SetSecretOptionalParams,\n SetSecretResponse,\n DeleteSecretOptionalParams,\n DeleteSecretResponse,\n UpdateSecretOptionalParams,\n UpdateSecretResponse,\n GetSecretOptionalParams,\n GetSecretResponse,\n GetSecretsOptionalParams,\n GetSecretsResponse,\n GetSecretVersionsOptionalParams,\n GetSecretVersionsResponse,\n GetDeletedSecretsOptionalParams,\n GetDeletedSecretsResponse,\n GetDeletedSecretOptionalParams,\n GetDeletedSecretResponse,\n PurgeDeletedSecretOptionalParams,\n RecoverDeletedSecretOptionalParams,\n RecoverDeletedSecretResponse,\n BackupSecretOptionalParams,\n BackupSecretResponse,\n RestoreSecretOptionalParams,\n RestoreSecretResponse,\n GetSecretsNextOptionalParams,\n GetSecretsNextResponse,\n GetSecretVersionsNextOptionalParams,\n GetSecretVersionsNextResponse,\n GetDeletedSecretsNextOptionalParams,\n GetDeletedSecretsNextResponse\n} from \"./models\";\n\n/** @internal */\nexport class KeyVaultClient extends coreHttpCompat.ExtendedServiceClient {\n apiVersion: ApiVersion73;\n\n /**\n * Initializes a new instance of the KeyVaultClient class.\n * @param apiVersion Api Version\n * @param options The parameter options\n */\n constructor(\n apiVersion: ApiVersion73,\n options?: KeyVaultClientOptionalParams\n ) {\n if (apiVersion === undefined) {\n throw new Error(\"'apiVersion' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: KeyVaultClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-keyvault-secrets/4.5.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{vaultBaseUrl}\"\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n }\n // Parameter assignments\n this.apiVersion = apiVersion;\n }\n\n /**\n * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure\n * Key Vault creates a new version of that secret. This operation requires the secrets/set permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param value The value of the secret.\n * @param options The options parameters.\n */\n setSecret(\n vaultBaseUrl: string,\n secretName: string,\n value: string,\n options?: SetSecretOptionalParams\n ): Promise<SetSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, value, options },\n setSecretOperationSpec\n );\n }\n\n /**\n * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an\n * individual version of a secret. This operation requires the secrets/delete permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param options The options parameters.\n */\n deleteSecret(\n vaultBaseUrl: string,\n secretName: string,\n options?: DeleteSecretOptionalParams\n ): Promise<DeleteSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, options },\n deleteSecretOperationSpec\n );\n }\n\n /**\n * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are\n * not specified in the request are left unchanged. The value of a secret itself cannot be changed.\n * This operation requires the secrets/set permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param secretVersion The version of the secret.\n * @param options The options parameters.\n */\n updateSecret(\n vaultBaseUrl: string,\n secretName: string,\n secretVersion: string,\n options?: UpdateSecretOptionalParams\n ): Promise<UpdateSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, secretVersion, options },\n updateSecretOperationSpec\n );\n }\n\n /**\n * The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the\n * secrets/get permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param secretVersion The version of the secret. This URI fragment is optional. If not specified, the\n * latest version of the secret is returned.\n * @param options The options parameters.\n */\n getSecret(\n vaultBaseUrl: string,\n secretName: string,\n secretVersion: string,\n options?: GetSecretOptionalParams\n ): Promise<GetSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, secretVersion, options },\n getSecretOperationSpec\n );\n }\n\n /**\n * The Get Secrets operation is applicable to the entire vault. However, only the base secret\n * identifier and its attributes are provided in the response. Individual secret versions are not\n * listed in the response. This operation requires the secrets/list permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param options The options parameters.\n */\n getSecrets(\n vaultBaseUrl: string,\n options?: GetSecretsOptionalParams\n ): Promise<GetSecretsResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, options },\n getSecretsOperationSpec\n );\n }\n\n /**\n * The full secret identifier and attributes are provided in the response. No values are returned for\n * the secrets. This operations requires the secrets/list permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param options The options parameters.\n */\n getSecretVersions(\n vaultBaseUrl: string,\n secretName: string,\n options?: GetSecretVersionsOptionalParams\n ): Promise<GetSecretVersionsResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, options },\n getSecretVersionsOperationSpec\n );\n }\n\n /**\n * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for\n * soft-delete. This operation requires the secrets/list permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param options The options parameters.\n */\n getDeletedSecrets(\n vaultBaseUrl: string,\n options?: GetDeletedSecretsOptionalParams\n ): Promise<GetDeletedSecretsResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, options },\n getDeletedSecretsOperationSpec\n );\n }\n\n /**\n * The Get Deleted Secret operation returns the specified deleted secret along with its attributes.\n * This operation requires the secrets/get permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param options The options parameters.\n */\n getDeletedSecret(\n vaultBaseUrl: string,\n secretName: string,\n options?: GetDeletedSecretOptionalParams\n ): Promise<GetDeletedSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, options },\n getDeletedSecretOperationSpec\n );\n }\n\n /**\n * The purge deleted secret operation removes the secret permanently, without the possibility of\n * recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires\n * the secrets/purge permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param options The options parameters.\n */\n purgeDeletedSecret(\n vaultBaseUrl: string,\n secretName: string,\n options?: PurgeDeletedSecretOptionalParams\n ): Promise<void> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, options },\n purgeDeletedSecretOperationSpec\n );\n }\n\n /**\n * Recovers the deleted secret in the specified vault. This operation can only be performed on a\n * soft-delete enabled vault. This operation requires the secrets/recover permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the deleted secret.\n * @param options The options parameters.\n */\n recoverDeletedSecret(\n vaultBaseUrl: string,\n secretName: string,\n options?: RecoverDeletedSecretOptionalParams\n ): Promise<RecoverDeletedSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, options },\n recoverDeletedSecretOperationSpec\n );\n }\n\n /**\n * Requests that a backup of the specified secret be downloaded to the client. All versions of the\n * secret will be downloaded. This operation requires the secrets/backup permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param options The options parameters.\n */\n backupSecret(\n vaultBaseUrl: string,\n secretName: string,\n options?: BackupSecretOptionalParams\n ): Promise<BackupSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, options },\n backupSecretOperationSpec\n );\n }\n\n /**\n * Restores a backed up secret, and all its versions, to a vault. This operation requires the\n * secrets/restore permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretBundleBackup The backup blob associated with a secret bundle.\n * @param options The options parameters.\n */\n restoreSecret(\n vaultBaseUrl: string,\n secretBundleBackup: Uint8Array,\n options?: RestoreSecretOptionalParams\n ): Promise<RestoreSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretBundleBackup, options },\n restoreSecretOperationSpec\n );\n }\n\n /**\n * GetSecretsNext\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param nextLink The nextLink from the previous successful call to the GetSecrets method.\n * @param options The options parameters.\n */\n getSecretsNext(\n vaultBaseUrl: string,\n nextLink: string,\n options?: GetSecretsNextOptionalParams\n ): Promise<GetSecretsNextResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, nextLink, options },\n getSecretsNextOperationSpec\n );\n }\n\n /**\n * GetSecretVersionsNext\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param nextLink The nextLink from the previous successful call to the GetSecretVersions method.\n * @param options The options parameters.\n */\n getSecretVersionsNext(\n vaultBaseUrl: string,\n secretName: string,\n nextLink: string,\n options?: GetSecretVersionsNextOptionalParams\n ): Promise<GetSecretVersionsNextResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, nextLink, options },\n getSecretVersionsNextOperationSpec\n );\n }\n\n /**\n * GetDeletedSecretsNext\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param nextLink The nextLink from the previous successful call to the GetDeletedSecrets method.\n * @param options The options parameters.\n */\n getDeletedSecretsNext(\n vaultBaseUrl: string,\n nextLink: string,\n options?: GetDeletedSecretsNextOptionalParams\n ): Promise<GetDeletedSecretsNextResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, nextLink, options },\n getDeletedSecretsNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst setSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets/{secret-name}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretBundle\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n requestBody: {\n parameterPath: {\n value: [\"value\"],\n tags: [\"options\", \"tags\"],\n contentType: [\"options\", \"contentType\"],\n secretAttributes: [\"options\", \"secretAttributes\"]\n },\n mapper: { ...Mappers.SecretSetParameters, required: true }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.secretName],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst deleteSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets/{secret-name}\",\n httpMethod: \"DELETE\",\n responses: {\n 200: {\n bodyMapper: Mappers.DeletedSecretBundle\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.secretName1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst updateSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets/{secret-name}/{secret-version}\",\n httpMethod: \"PATCH\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretBundle\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n requestBody: {\n parameterPath: {\n contentType: [\"options\", \"contentType\"],\n secretAttributes: [\"options\", \"secretAttributes\"],\n tags: [\"options\", \"tags\"]\n },\n mapper: { ...Mappers.SecretUpdateParameters, required: true }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.vaultBaseUrl,\n Parameters.secretName1,\n Parameters.secretVersion\n ],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst getSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets/{secret-name}/{secret-version}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretBundle\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.vaultBaseUrl,\n Parameters.secretName1,\n Parameters.secretVersion\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getSecretsOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretListResult\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.maxresults],\n urlParameters: [Parameters.vaultBaseUrl],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getSecretVersionsOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets/{secret-name}/versions\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretListResult\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.maxresults],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.secretName1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getDeletedSecretsOperationSpec: coreClient.OperationSpec = {\n path: \"/deletedsecrets\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.DeletedSecretListResult\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.maxresults],\n urlParameters: [Parameters.vaultBaseUrl],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getDeletedSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/deletedsecrets/{secret-name}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.DeletedSecretBundle\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.secretName1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst purgeDeletedSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/deletedsecrets/{secret-name}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.secretName1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst recoverDeletedSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/deletedsecrets/{secret-name}/recover\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretBundle\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.secretName1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst backupSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets/{secret-name}/backup\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.BackupSecretResult\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.secretName1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst restoreSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets/restore\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretBundle\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n requestBody: {\n parameterPath: { secretBundleBackup: [\"secretBundleBackup\"] },\n mapper: { ...Mappers.SecretRestoreParameters, required: true }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.vaultBaseUrl],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst getSecretsNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretListResult\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.maxresults],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getSecretVersionsNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretListResult\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.maxresults],\n urlParameters: [\n Parameters.vaultBaseUrl,\n Parameters.secretName1,\n Parameters.nextLink\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getDeletedSecretsNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.DeletedSecretListResult\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.maxresults],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
1
+ {"version":3,"file":"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Y,EAAE,UAAU,CAAC,QAAQ,CAAC;IAC7D,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,kCAAkC,GAA6B;IACnE,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,gBAAgB;SACrC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC;IAC/D,aAAa,EAAE;QACb,UAAU,CAAC,YAAY;QACvB,UAAU,CAAC,WAAW;QACtB,UAAU,CAAC,QAAQ;KACpB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,kCAAkC,GAA6B;IACnE,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,uBAAuB;SAC5C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC;IAC/D,aAAa,EAAE,CAAC,UAAU,CAAC,YAAY,EAAE,UAAU,CAAC,QAAQ,CAAC;IAC7D,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreHttpCompat from \"@azure/core-http-compat\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport * as Parameters from \"./models/parameters\";\nimport * as Mappers from \"./models/mappers\";\nimport {\n ApiVersion73,\n KeyVaultClientOptionalParams,\n SetSecretOptionalParams,\n SetSecretResponse,\n DeleteSecretOptionalParams,\n DeleteSecretResponse,\n UpdateSecretOptionalParams,\n UpdateSecretResponse,\n GetSecretOptionalParams,\n GetSecretResponse,\n GetSecretsOptionalParams,\n GetSecretsResponse,\n GetSecretVersionsOptionalParams,\n GetSecretVersionsResponse,\n GetDeletedSecretsOptionalParams,\n GetDeletedSecretsResponse,\n GetDeletedSecretOptionalParams,\n GetDeletedSecretResponse,\n PurgeDeletedSecretOptionalParams,\n RecoverDeletedSecretOptionalParams,\n RecoverDeletedSecretResponse,\n BackupSecretOptionalParams,\n BackupSecretResponse,\n RestoreSecretOptionalParams,\n RestoreSecretResponse,\n GetSecretsNextOptionalParams,\n GetSecretsNextResponse,\n GetSecretVersionsNextOptionalParams,\n GetSecretVersionsNextResponse,\n GetDeletedSecretsNextOptionalParams,\n GetDeletedSecretsNextResponse\n} from \"./models\";\n\n/** @internal */\nexport class KeyVaultClient extends coreHttpCompat.ExtendedServiceClient {\n apiVersion: ApiVersion73;\n\n /**\n * Initializes a new instance of the KeyVaultClient class.\n * @param apiVersion Api Version\n * @param options The parameter options\n */\n constructor(\n apiVersion: ApiVersion73,\n options?: KeyVaultClientOptionalParams\n ) {\n if (apiVersion === undefined) {\n throw new Error(\"'apiVersion' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: KeyVaultClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-keyvault-secrets/4.6.0`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{vaultBaseUrl}\"\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n }\n // Parameter assignments\n this.apiVersion = apiVersion;\n }\n\n /**\n * The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure\n * Key Vault creates a new version of that secret. This operation requires the secrets/set permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param value The value of the secret.\n * @param options The options parameters.\n */\n setSecret(\n vaultBaseUrl: string,\n secretName: string,\n value: string,\n options?: SetSecretOptionalParams\n ): Promise<SetSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, value, options },\n setSecretOperationSpec\n );\n }\n\n /**\n * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an\n * individual version of a secret. This operation requires the secrets/delete permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param options The options parameters.\n */\n deleteSecret(\n vaultBaseUrl: string,\n secretName: string,\n options?: DeleteSecretOptionalParams\n ): Promise<DeleteSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, options },\n deleteSecretOperationSpec\n );\n }\n\n /**\n * The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are\n * not specified in the request are left unchanged. The value of a secret itself cannot be changed.\n * This operation requires the secrets/set permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param secretVersion The version of the secret.\n * @param options The options parameters.\n */\n updateSecret(\n vaultBaseUrl: string,\n secretName: string,\n secretVersion: string,\n options?: UpdateSecretOptionalParams\n ): Promise<UpdateSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, secretVersion, options },\n updateSecretOperationSpec\n );\n }\n\n /**\n * The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the\n * secrets/get permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param secretVersion The version of the secret. This URI fragment is optional. If not specified, the\n * latest version of the secret is returned.\n * @param options The options parameters.\n */\n getSecret(\n vaultBaseUrl: string,\n secretName: string,\n secretVersion: string,\n options?: GetSecretOptionalParams\n ): Promise<GetSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, secretVersion, options },\n getSecretOperationSpec\n );\n }\n\n /**\n * The Get Secrets operation is applicable to the entire vault. However, only the base secret\n * identifier and its attributes are provided in the response. Individual secret versions are not\n * listed in the response. This operation requires the secrets/list permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param options The options parameters.\n */\n getSecrets(\n vaultBaseUrl: string,\n options?: GetSecretsOptionalParams\n ): Promise<GetSecretsResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, options },\n getSecretsOperationSpec\n );\n }\n\n /**\n * The full secret identifier and attributes are provided in the response. No values are returned for\n * the secrets. This operations requires the secrets/list permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param options The options parameters.\n */\n getSecretVersions(\n vaultBaseUrl: string,\n secretName: string,\n options?: GetSecretVersionsOptionalParams\n ): Promise<GetSecretVersionsResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, options },\n getSecretVersionsOperationSpec\n );\n }\n\n /**\n * The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for\n * soft-delete. This operation requires the secrets/list permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param options The options parameters.\n */\n getDeletedSecrets(\n vaultBaseUrl: string,\n options?: GetDeletedSecretsOptionalParams\n ): Promise<GetDeletedSecretsResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, options },\n getDeletedSecretsOperationSpec\n );\n }\n\n /**\n * The Get Deleted Secret operation returns the specified deleted secret along with its attributes.\n * This operation requires the secrets/get permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param options The options parameters.\n */\n getDeletedSecret(\n vaultBaseUrl: string,\n secretName: string,\n options?: GetDeletedSecretOptionalParams\n ): Promise<GetDeletedSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, options },\n getDeletedSecretOperationSpec\n );\n }\n\n /**\n * The purge deleted secret operation removes the secret permanently, without the possibility of\n * recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires\n * the secrets/purge permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param options The options parameters.\n */\n purgeDeletedSecret(\n vaultBaseUrl: string,\n secretName: string,\n options?: PurgeDeletedSecretOptionalParams\n ): Promise<void> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, options },\n purgeDeletedSecretOperationSpec\n );\n }\n\n /**\n * Recovers the deleted secret in the specified vault. This operation can only be performed on a\n * soft-delete enabled vault. This operation requires the secrets/recover permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the deleted secret.\n * @param options The options parameters.\n */\n recoverDeletedSecret(\n vaultBaseUrl: string,\n secretName: string,\n options?: RecoverDeletedSecretOptionalParams\n ): Promise<RecoverDeletedSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, options },\n recoverDeletedSecretOperationSpec\n );\n }\n\n /**\n * Requests that a backup of the specified secret be downloaded to the client. All versions of the\n * secret will be downloaded. This operation requires the secrets/backup permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param options The options parameters.\n */\n backupSecret(\n vaultBaseUrl: string,\n secretName: string,\n options?: BackupSecretOptionalParams\n ): Promise<BackupSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, options },\n backupSecretOperationSpec\n );\n }\n\n /**\n * Restores a backed up secret, and all its versions, to a vault. This operation requires the\n * secrets/restore permission.\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretBundleBackup The backup blob associated with a secret bundle.\n * @param options The options parameters.\n */\n restoreSecret(\n vaultBaseUrl: string,\n secretBundleBackup: Uint8Array,\n options?: RestoreSecretOptionalParams\n ): Promise<RestoreSecretResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretBundleBackup, options },\n restoreSecretOperationSpec\n );\n }\n\n /**\n * GetSecretsNext\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param nextLink The nextLink from the previous successful call to the GetSecrets method.\n * @param options The options parameters.\n */\n getSecretsNext(\n vaultBaseUrl: string,\n nextLink: string,\n options?: GetSecretsNextOptionalParams\n ): Promise<GetSecretsNextResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, nextLink, options },\n getSecretsNextOperationSpec\n );\n }\n\n /**\n * GetSecretVersionsNext\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param secretName The name of the secret.\n * @param nextLink The nextLink from the previous successful call to the GetSecretVersions method.\n * @param options The options parameters.\n */\n getSecretVersionsNext(\n vaultBaseUrl: string,\n secretName: string,\n nextLink: string,\n options?: GetSecretVersionsNextOptionalParams\n ): Promise<GetSecretVersionsNextResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, secretName, nextLink, options },\n getSecretVersionsNextOperationSpec\n );\n }\n\n /**\n * GetDeletedSecretsNext\n * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.\n * @param nextLink The nextLink from the previous successful call to the GetDeletedSecrets method.\n * @param options The options parameters.\n */\n getDeletedSecretsNext(\n vaultBaseUrl: string,\n nextLink: string,\n options?: GetDeletedSecretsNextOptionalParams\n ): Promise<GetDeletedSecretsNextResponse> {\n return this.sendOperationRequest(\n { vaultBaseUrl, nextLink, options },\n getDeletedSecretsNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst setSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets/{secret-name}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretBundle\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n requestBody: {\n parameterPath: {\n value: [\"value\"],\n tags: [\"options\", \"tags\"],\n contentType: [\"options\", \"contentType\"],\n secretAttributes: [\"options\", \"secretAttributes\"]\n },\n mapper: { ...Mappers.SecretSetParameters, required: true }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.secretName],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst deleteSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets/{secret-name}\",\n httpMethod: \"DELETE\",\n responses: {\n 200: {\n bodyMapper: Mappers.DeletedSecretBundle\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.secretName1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst updateSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets/{secret-name}/{secret-version}\",\n httpMethod: \"PATCH\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretBundle\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n requestBody: {\n parameterPath: {\n contentType: [\"options\", \"contentType\"],\n secretAttributes: [\"options\", \"secretAttributes\"],\n tags: [\"options\", \"tags\"]\n },\n mapper: { ...Mappers.SecretUpdateParameters, required: true }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.vaultBaseUrl,\n Parameters.secretName1,\n Parameters.secretVersion\n ],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst getSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets/{secret-name}/{secret-version}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretBundle\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.vaultBaseUrl,\n Parameters.secretName1,\n Parameters.secretVersion\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getSecretsOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretListResult\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.maxresults],\n urlParameters: [Parameters.vaultBaseUrl],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getSecretVersionsOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets/{secret-name}/versions\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretListResult\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.maxresults],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.secretName1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getDeletedSecretsOperationSpec: coreClient.OperationSpec = {\n path: \"/deletedsecrets\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.DeletedSecretListResult\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.maxresults],\n urlParameters: [Parameters.vaultBaseUrl],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getDeletedSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/deletedsecrets/{secret-name}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.DeletedSecretBundle\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.secretName1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst purgeDeletedSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/deletedsecrets/{secret-name}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.secretName1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst recoverDeletedSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/deletedsecrets/{secret-name}/recover\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretBundle\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.secretName1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst backupSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets/{secret-name}/backup\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.BackupSecretResult\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.secretName1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst restoreSecretOperationSpec: coreClient.OperationSpec = {\n path: \"/secrets/restore\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretBundle\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n requestBody: {\n parameterPath: { secretBundleBackup: [\"secretBundleBackup\"] },\n mapper: { ...Mappers.SecretRestoreParameters, required: true }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.vaultBaseUrl],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst getSecretsNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretListResult\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.maxresults],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getSecretVersionsNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SecretListResult\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.maxresults],\n urlParameters: [\n Parameters.vaultBaseUrl,\n Parameters.secretName1,\n Parameters.nextLink\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getDeletedSecretsNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.DeletedSecretListResult\n },\n default: {\n bodyMapper: Mappers.KeyVaultError\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.maxresults],\n urlParameters: [Parameters.vaultBaseUrl, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
@@ -36,7 +36,7 @@ export class SecretClient {
36
36
  *
37
37
  * let client = new SecretClient(vaultUrl, credentials);
38
38
  * ```
39
- * @param vaultUrl - The base URL to the vault.
39
+ * @param vaultUrl - The base URL to the vault. You should validate that this URL references a valid Key Vault resource. See https://aka.ms/azsdk/blog/vault-uri for details.
40
40
  * @param credential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \@azure/identity package to create a credential that suits your needs.
41
41
  * @param pipelineOptions - Pipeline options used to configure Key Vault API requests.
42
42
  * Omit this parameter to use the default pipeline configuration.
@@ -46,7 +46,7 @@ export class SecretClient {
46
46
  const authPolicy = bearerTokenAuthenticationPolicy({
47
47
  credential,
48
48
  scopes: [],
49
- challengeCallbacks: createChallengeCallbacks(),
49
+ challengeCallbacks: createChallengeCallbacks(pipelineOptions),
50
50
  });
51
51
  const internalPipelineOptions = Object.assign(Object.assign({}, pipelineOptions), { loggingOptions: {
52
52
  logger: logger.info,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;;AAI5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,oBAAoB,CAAC;AAG5B,OAAO,EAIL,0BAA0B,GAE3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAQL,kBAAkB,GAWnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAA4B,6BAA6B,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAIL,0BAA0B,EAY1B,6BAA6B,EAU7B,MAAM,GACP,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,OAA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,CAAC,MAAM,CAAC,CAClC,CAAA,CAAC;iBACH;qBAAM;oBACL,MAAM;iBACP;aACF;QACH,CAAC;KAAA;IAED;;;OAGG;IACY,qBAAqB,CAClC,UAAqC,EAAE;;;YAEvC,MAAM,CAAC,GAAG,EAAE,CAAC;;gBAEb,KAAyB,IAAA,KAAA,cAAA,IAAI,CAAC,sBAAsB,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA,IAAA;oBAArD,MAAM,IAAI,WAAA,CAAA;oBACnB,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE;wBACvB,oBAAM,IAAI,CAAA,CAAC;qBACZ;iBACF;;;;;;;;;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;OAaG;IACI,kBAAkB,CACvB,UAAqC,EAAE;QAEvC,MAAM,IAAI,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;QAEjD,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,CAAC,WAAyB,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,OAAO,CAAC;SACxF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport { TokenCredential } from \"@azure/core-auth\";\n\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\n\nimport { logger } from \"./log\";\n\nimport \"@azure/core-paging\";\nimport { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { PollOperationState, PollerLike } from \"@azure/core-lro\";\nimport {\n DeletedSecretBundle,\n DeletionRecoveryLevel,\n GetSecretsOptionalParams,\n KnownDeletionRecoveryLevel,\n SecretBundle,\n} from \"./generated/models\";\nimport { KeyVaultClient } from \"./generated/keyVaultClient\";\nimport { createChallengeCallbacks } from \"../../keyvault-common/src\";\n\nimport { DeleteSecretPoller } from \"./lro/delete/poller\";\nimport { RecoverDeletedSecretPoller } from \"./lro/recover/poller\";\n\nimport {\n BackupSecretOptions,\n BeginDeleteSecretOptions,\n BeginRecoverDeletedSecretOptions,\n DeletedSecret,\n GetDeletedSecretOptions,\n GetSecretOptions,\n KeyVaultSecret,\n LATEST_API_VERSION,\n ListDeletedSecretsOptions,\n ListPropertiesOfSecretVersionsOptions,\n ListPropertiesOfSecretsOptions,\n PurgeDeletedSecretOptions,\n RestoreSecretBackupOptions,\n SecretClientOptions,\n SecretPollerOptions,\n SecretProperties,\n SetSecretOptions,\n UpdateSecretPropertiesOptions,\n} from \"./secretsModels\";\nimport { KeyVaultSecretIdentifier, parseKeyVaultSecretIdentifier } from \"./identifier\";\nimport { getSecretFromSecretBundle } from \"./transformations\";\nimport { tracingClient } from \"./tracing\";\n\nexport {\n SecretClientOptions,\n DeletedSecret,\n DeletionRecoveryLevel,\n KnownDeletionRecoveryLevel,\n GetSecretOptions,\n GetDeletedSecretOptions,\n PurgeDeletedSecretOptions,\n BackupSecretOptions,\n RestoreSecretBackupOptions,\n ListPropertiesOfSecretVersionsOptions,\n ListPropertiesOfSecretsOptions,\n ListDeletedSecretsOptions,\n PagedAsyncIterableIterator,\n PageSettings,\n KeyVaultSecretIdentifier,\n parseKeyVaultSecretIdentifier,\n PollerLike,\n PollOperationState,\n KeyVaultSecret,\n SecretProperties,\n SecretPollerOptions,\n BeginDeleteSecretOptions,\n BeginRecoverDeletedSecretOptions,\n SetSecretOptions,\n UpdateSecretPropertiesOptions,\n logger,\n};\n\n/**\n * The SecretClient provides methods to manage {@link KeyVaultSecret} in\n * the Azure Key Vault. The client supports creating, retrieving, updating,\n * deleting, purging, backing up, restoring and listing KeyVaultSecrets. The\n * client also supports listing {@link DeletedSecret} for a soft-delete enabled Azure\n * Key Vault.\n */\nexport class SecretClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated KeyVault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of SecretClient.\n *\n * Example usage:\n * ```ts\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * let vaultUrl = `https://<MY KEYVAULT HERE>.vault.azure.net`;\n * let credentials = new DefaultAzureCredential();\n *\n * let client = new SecretClient(vaultUrl, credentials);\n * ```\n * @param vaultUrl - The base URL to the vault.\n * @param credential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \\@azure/identity package to create a credential that suits your needs.\n * @param pipelineOptions - Pipeline options used to configure Key Vault API requests.\n * Omit this parameter to use the default pipeline configuration.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n pipelineOptions: SecretClientOptions = {}\n ) {\n this.vaultUrl = vaultUrl;\n\n const authPolicy = bearerTokenAuthenticationPolicy({\n credential,\n scopes: [],\n challengeCallbacks: createChallengeCallbacks(),\n });\n\n const internalPipelineOptions = {\n ...pipelineOptions,\n loggingOptions: {\n logger: logger.info,\n allowedHeaderNames: [\n \"x-ms-keyvault-region\",\n \"x-ms-keyvault-network-info\",\n \"x-ms-keyvault-service-version\",\n ],\n },\n };\n\n this.client = new KeyVaultClient(\n pipelineOptions.serviceVersion || LATEST_API_VERSION,\n internalPipelineOptions\n );\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * The setSecret method adds a secret or secret version to the Azure Key Vault. If the named secret\n * already exists, Azure Key Vault creates a new version of that secret.\n * This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * await client.setSecret(\"MySecretName\", \"ABC123\");\n * ```\n * Adds a secret in a specified key vault.\n * @param secretName - The name of the secret.\n * @param value - The value of the secret.\n * @param options - The optional parameters.\n */\n public setSecret(\n secretName: string,\n value: string,\n options: SetSecretOptions = {}\n ): Promise<KeyVaultSecret> {\n let unflattenedOptions = {};\n\n if (options) {\n const { enabled, notBefore, expiresOn: expires, ...remainingOptions } = options;\n unflattenedOptions = {\n ...remainingOptions,\n secretAttributes: {\n enabled,\n notBefore,\n expires,\n },\n };\n }\n return tracingClient.withSpan(\n \"SecretClient.setSecret\",\n unflattenedOptions,\n async (updatedOptions) => {\n const response = await this.client.setSecret(\n this.vaultUrl,\n secretName,\n value,\n updatedOptions\n );\n return getSecretFromSecretBundle(response);\n }\n );\n }\n\n /**\n * Deletes a secret stored in Azure Key Vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is deleted.\n *\n * This operation requires the secrets/delete permission.\n *\n * Example usage:\n * ```ts\n * const client = new SecretClient(url, credentials);\n * await client.setSecret(\"MySecretName\", \"ABC123\");\n *\n * const deletePoller = await client.beginDeleteSecret(\"MySecretName\");\n *\n * // Serializing the poller\n * const serialized = deletePoller.toString();\n *\n * // A new poller can be created with:\n * // const newPoller = await client.beginDeleteSecret(\"MySecretName\", { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const deletedSecret = await deletePoller.pollUntilDone();\n * console.log(deletedSecret);\n * ```\n * Deletes a secret from a specified key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public async beginDeleteSecret(\n name: string,\n options: BeginDeleteSecretOptions = {}\n ): Promise<PollerLike<PollOperationState<DeletedSecret>, DeletedSecret>> {\n const poller = new DeleteSecretPoller({\n name,\n client: this.client,\n vaultUrl: this.vaultUrl,\n ...options,\n operationOptions: options,\n });\n // This will initialize the poller's operation (the deletion of the secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * The updateSecret method changes specified attributes of an existing stored secret. Properties that\n * are not specified in the request are left unchanged. The value of a secret itself cannot be\n * changed. This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts\n * let secretName = \"MySecretName\";\n * let client = new SecretClient(url, credentials);\n * let secret = await client.getSecret(secretName);\n * await client.updateSecretProperties(secretName, secret.properties.version, { enabled: false });\n * ```\n * Updates the attributes associated with a specified secret in a given key vault.\n * @param secretName - The name of the secret.\n * @param secretVersion - The version of the secret.\n * @param options - The optional parameters.\n */\n public async updateSecretProperties(\n secretName: string,\n secretVersion: string,\n options: UpdateSecretPropertiesOptions = {}\n ): Promise<SecretProperties> {\n let unflattenedOptions = {};\n if (options) {\n const { enabled, notBefore, expiresOn: expires, ...remainingOptions } = options;\n unflattenedOptions = {\n ...remainingOptions,\n secretAttributes: {\n enabled,\n notBefore,\n expires,\n },\n };\n }\n\n return tracingClient.withSpan(\n \"SecretClient.updateSecretProperties\",\n unflattenedOptions,\n async (updatedOptions) => {\n const response = await this.client.updateSecret(\n this.vaultUrl,\n secretName,\n secretVersion,\n updatedOptions\n );\n return getSecretFromSecretBundle(response).properties;\n }\n );\n }\n\n /**\n * The getSecret method is applicable to any secret stored in Azure Key Vault. This operation requires\n * the secrets/get permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * let secret = await client.getSecret(\"MySecretName\");\n * ```\n * Get a specified secret from a given key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getSecret(secretName: string, options: GetSecretOptions = {}): Promise<KeyVaultSecret> {\n return tracingClient.withSpan(\"SecretClient.getSecret\", options, async (updatedOptions) => {\n const response = await this.client.getSecret(\n this.vaultUrl,\n secretName,\n options && options.version ? options.version : \"\",\n updatedOptions\n );\n return getSecretFromSecretBundle(response);\n });\n }\n\n /**\n * The getDeletedSecret method returns the specified deleted secret along with its attributes.\n * This operation requires the secrets/get permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * await client.getDeletedSecret(\"MyDeletedSecret\");\n * ```\n * Gets the specified deleted secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getDeletedSecret(\n secretName: string,\n options: GetDeletedSecretOptions = {}\n ): Promise<DeletedSecret> {\n return tracingClient.withSpan(\n \"SecretClient.getDeletedSecret\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getDeletedSecret(\n this.vaultUrl,\n secretName,\n updatedOptions\n );\n return getSecretFromSecretBundle(response);\n }\n );\n }\n\n /**\n * The purge deleted secret operation removes the secret permanently, without the possibility of\n * recovery. This operation can only be enabled on a soft-delete enabled vault. This operation\n * requires the secrets/purge permission.\n *\n * Example usage:\n * ```ts\n * const client = new SecretClient(url, credentials);\n * const deletePoller = await client.beginDeleteSecret(\"MySecretName\");\n * await deletePoller.pollUntilDone();\n * await client.purgeDeletedSecret(\"MySecretName\");\n * ```\n * Permanently deletes the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public purgeDeletedSecret(\n secretName: string,\n options: PurgeDeletedSecretOptions = {}\n ): Promise<void> {\n return tracingClient.withSpan(\n \"SecretClient.purgeDeletedSecret\",\n options,\n async (updatedOptions) => {\n await this.client.purgeDeletedSecret(this.vaultUrl, secretName, updatedOptions);\n }\n );\n }\n\n /**\n * Recovers the deleted secret in the specified vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is recovered.\n *\n * This operation requires the secrets/recover permission.\n *\n * Example usage:\n * ```ts\n * const client = new SecretClient(url, credentials);\n * await client.setSecret(\"MySecretName\", \"ABC123\");\n *\n * const deletePoller = await client.beginDeleteSecret(\"MySecretName\");\n * await deletePoller.pollUntilDone();\n *\n * const recoverPoller = await client.beginRecoverDeletedSecret(\"MySecretName\");\n *\n * // Serializing the poller\n * const serialized = recoverPoller.toString();\n *\n * // A new poller can be created with:\n * // const newPoller = await client.beginRecoverDeletedSecret(\"MySecretName\", { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const deletedSecret = await recoverPoller.pollUntilDone();\n * console.log(deletedSecret);\n * ```\n * Recovers the deleted secret to the latest version.\n * @param secretName - The name of the deleted secret.\n * @param options - The optional parameters.\n */\n public async beginRecoverDeletedSecret(\n name: string,\n options: BeginRecoverDeletedSecretOptions = {}\n ): Promise<PollerLike<PollOperationState<SecretProperties>, SecretProperties>> {\n const poller = new RecoverDeletedSecretPoller({\n name,\n client: this.client,\n vaultUrl: this.vaultUrl,\n ...options,\n operationOptions: options,\n });\n\n // This will initialize the poller's operation (the recovery of the deleted secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * Requests that a backup of the specified secret be downloaded to the client. All versions of the\n * secret will be downloaded. This operation requires the secrets/backup permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * let backupResult = await client.backupSecret(\"MySecretName\");\n * ```\n * Backs up the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public backupSecret(\n secretName: string,\n options: BackupSecretOptions = {}\n ): Promise<Uint8Array | undefined> {\n return tracingClient.withSpan(\"SecretClient.backupSecret\", options, async (updatedOptions) => {\n const response = await this.client.backupSecret(this.vaultUrl, secretName, updatedOptions);\n\n return response.value;\n });\n }\n\n /**\n * Restores a backed up secret, and all its versions, to a vault. This operation requires the\n * secrets/restore permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * let mySecretBundle = await client.backupSecret(\"MySecretName\");\n * // ...\n * await client.restoreSecretBackup(mySecretBundle);\n * ```\n * Restores a backed up secret to a vault.\n * @param secretBundleBackup - The backup blob associated with a secret bundle.\n * @param options - The optional parameters.\n */\n public restoreSecretBackup(\n secretBundleBackup: Uint8Array,\n options: RestoreSecretBackupOptions = {}\n ): Promise<SecretProperties> {\n return tracingClient.withSpan(\n \"SecretClient.restoreSecretBackup\",\n options,\n async (updatedOptions) => {\n const response = await this.client.restoreSecret(\n this.vaultUrl,\n secretBundleBackup,\n updatedOptions\n );\n return getSecretFromSecretBundle(response).properties;\n }\n );\n }\n\n /**\n * Deals with the pagination of {@link listPropertiesOfSecretVersions}.\n * @param name - The name of the KeyVault Secret.\n * @param continuationState - An object that indicates the position of the paginated request.\n * @param options - Optional parameters for the underlying HTTP request.\n */\n private async *listPropertiesOfSecretVersionsPage(\n secretName: string,\n continuationState: PageSettings,\n options: ListPropertiesOfSecretVersionsOptions = {}\n ): AsyncIterableIterator<SecretProperties[]> {\n if (continuationState.continuationToken == null) {\n const optionsComplete: GetSecretsOptionalParams = {\n maxresults: continuationState.maxPageSize,\n ...options,\n };\n const currentSetResponse = await tracingClient.withSpan(\n \"SecretClient.listPropertiesOfSecretVersionsPage\",\n optionsComplete,\n (updatedOptions) => this.client.getSecretVersions(this.vaultUrl, secretName, updatedOptions)\n );\n continuationState.continuationToken = currentSetResponse.nextLink;\n if (currentSetResponse.value) {\n yield currentSetResponse.value.map(\n (bundle: SecretBundle | DeletedSecretBundle) =>\n getSecretFromSecretBundle(bundle).properties\n );\n }\n }\n while (continuationState.continuationToken) {\n const currentSetResponse = await tracingClient.withSpan(\n \"SecretClient.listPropertiesOfSecretVersionsPage\",\n options,\n (updatedOptions) =>\n this.client.getSecretVersionsNext(\n this.vaultUrl,\n secretName,\n continuationState.continuationToken!,\n updatedOptions\n )\n );\n continuationState.continuationToken = currentSetResponse.nextLink;\n if (currentSetResponse.value) {\n yield currentSetResponse.value.map(\n (bundle: SecretBundle | DeletedSecretBundle) =>\n getSecretFromSecretBundle(bundle).properties\n );\n } else {\n break;\n }\n }\n }\n\n /**\n * Deals with the iteration of all the available results of {@link listPropertiesOfSecretVersions}.\n * @param name - The name of the KeyVault Secret.\n * @param options - Optional parameters for the underlying HTTP request.\n */\n private async *listPropertiesOfSecretVersionsAll(\n secretName: string,\n options: ListPropertiesOfSecretVersionsOptions = {}\n ): AsyncIterableIterator<SecretProperties> {\n const f = {};\n\n for await (const page of this.listPropertiesOfSecretVersionsPage(secretName, f, options)) {\n for (const item of page) {\n yield item;\n }\n }\n }\n\n /**\n * Iterates all versions of the given secret in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * for await (const secretProperties of client.listPropertiesOfSecretVersions(\"MySecretName\")) {\n * const secret = await client.getSecret(secretProperties.name);\n * console.log(\"secret version: \", secret);\n * }\n * ```\n * @param secretName - Name of the secret to fetch versions for.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecretVersions(\n secretName: string,\n options: ListPropertiesOfSecretVersionsOptions = {}\n ): PagedAsyncIterableIterator<SecretProperties> {\n const iter = this.listPropertiesOfSecretVersionsAll(secretName, options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) =>\n this.listPropertiesOfSecretVersionsPage(secretName, settings, options),\n };\n }\n\n /**\n * Deals with the pagination of {@link listPropertiesOfSecrets}.\n * @param continuationState - An object that indicates the position of the paginated request.\n * @param options - Optional parameters for the underlying HTTP request.\n */\n private async *listPropertiesOfSecretsPage(\n continuationState: PageSettings,\n options: ListPropertiesOfSecretsOptions = {}\n ): AsyncIterableIterator<SecretProperties[]> {\n if (continuationState.continuationToken == null) {\n const optionsComplete: GetSecretsOptionalParams = {\n maxresults: continuationState.maxPageSize,\n ...options,\n };\n const currentSetResponse = await tracingClient.withSpan(\n \"SecretClient.listPropertiesOfSecretsPage\",\n optionsComplete,\n (updatedOptions) => this.client.getSecrets(this.vaultUrl, updatedOptions)\n );\n continuationState.continuationToken = currentSetResponse.nextLink;\n if (currentSetResponse.value) {\n yield currentSetResponse.value.map(\n (bundle: SecretBundle | DeletedSecretBundle) =>\n getSecretFromSecretBundle(bundle).properties\n );\n }\n }\n while (continuationState.continuationToken) {\n const currentSetResponse = await tracingClient.withSpan(\n \"SecretClient.listPropertiesOfSecretsPage\",\n options,\n (updatedOptions) =>\n this.client.getSecretsNext(\n this.vaultUrl,\n continuationState.continuationToken!,\n updatedOptions\n )\n );\n continuationState.continuationToken = currentSetResponse.nextLink;\n if (currentSetResponse.value) {\n yield currentSetResponse.value.map(\n (bundle: SecretBundle | DeletedSecretBundle) =>\n getSecretFromSecretBundle(bundle).properties\n );\n } else {\n break;\n }\n }\n }\n\n /**\n * Deals with the iteration of all the available results of {@link listPropertiesOfSecrets}.\n * @param options - Optional parameters for the underlying HTTP request.\n */\n private async *listPropertiesOfSecretsAll(\n options: ListPropertiesOfSecretsOptions = {}\n ): AsyncIterableIterator<SecretProperties> {\n const f = {};\n\n for await (const page of this.listPropertiesOfSecretsPage(f, options)) {\n for (const item of page) {\n yield item;\n }\n }\n }\n\n /**\n * Iterates the latest version of all secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * const secret = await client.getSecret(secretProperties.name);\n * console.log(\"secret: \", secret);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecrets(\n options: ListPropertiesOfSecretsOptions = {}\n ): PagedAsyncIterableIterator<SecretProperties> {\n const iter = this.listPropertiesOfSecretsAll(options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) => this.listPropertiesOfSecretsPage(settings, options),\n };\n }\n\n /**\n * Deals with the pagination of {@link listDeletedSecrets}.\n * @param continuationState - An object that indicates the position of the paginated request.\n * @param options - Optional parameters for the underlying HTTP request.\n */\n private async *listDeletedSecretsPage(\n continuationState: PageSettings,\n options: ListDeletedSecretsOptions = {}\n ): AsyncIterableIterator<DeletedSecret[]> {\n if (continuationState.continuationToken == null) {\n const optionsComplete: GetSecretsOptionalParams = {\n maxresults: continuationState.maxPageSize,\n ...options,\n };\n const currentSetResponse = await tracingClient.withSpan(\n \"SecretClient.listDeletedSecretsPage\",\n optionsComplete,\n (updatedOptions) => this.client.getDeletedSecrets(this.vaultUrl, updatedOptions)\n );\n continuationState.continuationToken = currentSetResponse.nextLink;\n if (currentSetResponse.value) {\n yield currentSetResponse.value.map((bundle: SecretBundle | DeletedSecretBundle) =>\n getSecretFromSecretBundle(bundle)\n );\n }\n }\n while (continuationState.continuationToken) {\n const currentSetResponse = await tracingClient.withSpan(\n \"SecretClient.lisDeletedSecretsPage\",\n options,\n (updatedOptions) =>\n this.client.getDeletedSecretsNext(\n this.vaultUrl,\n continuationState.continuationToken!,\n updatedOptions\n )\n );\n continuationState.continuationToken = currentSetResponse.nextLink;\n if (currentSetResponse.value) {\n yield currentSetResponse.value.map((bundle: SecretBundle | DeletedSecretBundle) =>\n getSecretFromSecretBundle(bundle)\n );\n } else {\n break;\n }\n }\n }\n\n /**\n * Deals with the iteration of all the available results of {@link listDeletedSecrets}.\n * @param options - Optional parameters for the underlying HTTP request.\n */\n private async *listDeletedSecretsAll(\n options: ListDeletedSecretsOptions = {}\n ): AsyncIterableIterator<DeletedSecret> {\n const f = {};\n\n for await (const page of this.listDeletedSecretsPage(f, options)) {\n for (const item of page) {\n yield item;\n }\n }\n }\n\n /**\n * Iterates the deleted secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"deleted secret: \", deletedSecret);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listDeletedSecrets(\n options: ListDeletedSecretsOptions = {}\n ): PagedAsyncIterableIterator<DeletedSecret> {\n const iter = this.listDeletedSecretsAll(options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) => this.listDeletedSecretsPage(settings, options),\n };\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;;AAI5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,oBAAoB,CAAC;AAG5B,OAAO,EAIL,0BAA0B,GAE3B,MAAM,oBAAoB,CAA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D,MAAM,EAAE,CAAC,WAAyB,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,OAAO,CAAC;SACxF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport { TokenCredential } from \"@azure/core-auth\";\n\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\n\nimport { logger } from \"./log\";\n\nimport \"@azure/core-paging\";\nimport { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { PollOperationState, PollerLike } from \"@azure/core-lro\";\nimport {\n DeletedSecretBundle,\n DeletionRecoveryLevel,\n GetSecretsOptionalParams,\n KnownDeletionRecoveryLevel,\n SecretBundle,\n} from \"./generated/models\";\nimport { KeyVaultClient } from \"./generated/keyVaultClient\";\nimport { createChallengeCallbacks } from \"../../keyvault-common/src\";\n\nimport { DeleteSecretPoller } from \"./lro/delete/poller\";\nimport { RecoverDeletedSecretPoller } from \"./lro/recover/poller\";\n\nimport {\n BackupSecretOptions,\n BeginDeleteSecretOptions,\n BeginRecoverDeletedSecretOptions,\n DeletedSecret,\n GetDeletedSecretOptions,\n GetSecretOptions,\n KeyVaultSecret,\n LATEST_API_VERSION,\n ListDeletedSecretsOptions,\n ListPropertiesOfSecretVersionsOptions,\n ListPropertiesOfSecretsOptions,\n PurgeDeletedSecretOptions,\n RestoreSecretBackupOptions,\n SecretClientOptions,\n SecretPollerOptions,\n SecretProperties,\n SetSecretOptions,\n UpdateSecretPropertiesOptions,\n} from \"./secretsModels\";\nimport { KeyVaultSecretIdentifier, parseKeyVaultSecretIdentifier } from \"./identifier\";\nimport { getSecretFromSecretBundle } from \"./transformations\";\nimport { tracingClient } from \"./tracing\";\n\nexport {\n SecretClientOptions,\n DeletedSecret,\n DeletionRecoveryLevel,\n KnownDeletionRecoveryLevel,\n GetSecretOptions,\n GetDeletedSecretOptions,\n PurgeDeletedSecretOptions,\n BackupSecretOptions,\n RestoreSecretBackupOptions,\n ListPropertiesOfSecretVersionsOptions,\n ListPropertiesOfSecretsOptions,\n ListDeletedSecretsOptions,\n PagedAsyncIterableIterator,\n PageSettings,\n KeyVaultSecretIdentifier,\n parseKeyVaultSecretIdentifier,\n PollerLike,\n PollOperationState,\n KeyVaultSecret,\n SecretProperties,\n SecretPollerOptions,\n BeginDeleteSecretOptions,\n BeginRecoverDeletedSecretOptions,\n SetSecretOptions,\n UpdateSecretPropertiesOptions,\n logger,\n};\n\n/**\n * The SecretClient provides methods to manage {@link KeyVaultSecret} in\n * the Azure Key Vault. The client supports creating, retrieving, updating,\n * deleting, purging, backing up, restoring and listing KeyVaultSecrets. The\n * client also supports listing {@link DeletedSecret} for a soft-delete enabled Azure\n * Key Vault.\n */\nexport class SecretClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated KeyVault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of SecretClient.\n *\n * Example usage:\n * ```ts\n * import { SecretClient } from \"@azure/keyvault-secrets\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * let vaultUrl = `https://<MY KEYVAULT HERE>.vault.azure.net`;\n * let credentials = new DefaultAzureCredential();\n *\n * let client = new SecretClient(vaultUrl, credentials);\n * ```\n * @param vaultUrl - The base URL to the vault. You should validate that this URL references a valid Key Vault resource. See https://aka.ms/azsdk/blog/vault-uri for details.\n * @param credential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \\@azure/identity package to create a credential that suits your needs.\n * @param pipelineOptions - Pipeline options used to configure Key Vault API requests.\n * Omit this parameter to use the default pipeline configuration.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n pipelineOptions: SecretClientOptions = {}\n ) {\n this.vaultUrl = vaultUrl;\n\n const authPolicy = bearerTokenAuthenticationPolicy({\n credential,\n scopes: [],\n challengeCallbacks: createChallengeCallbacks(pipelineOptions),\n });\n\n const internalPipelineOptions = {\n ...pipelineOptions,\n loggingOptions: {\n logger: logger.info,\n allowedHeaderNames: [\n \"x-ms-keyvault-region\",\n \"x-ms-keyvault-network-info\",\n \"x-ms-keyvault-service-version\",\n ],\n },\n };\n\n this.client = new KeyVaultClient(\n pipelineOptions.serviceVersion || LATEST_API_VERSION,\n internalPipelineOptions\n );\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * The setSecret method adds a secret or secret version to the Azure Key Vault. If the named secret\n * already exists, Azure Key Vault creates a new version of that secret.\n * This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * await client.setSecret(\"MySecretName\", \"ABC123\");\n * ```\n * Adds a secret in a specified key vault.\n * @param secretName - The name of the secret.\n * @param value - The value of the secret.\n * @param options - The optional parameters.\n */\n public setSecret(\n secretName: string,\n value: string,\n options: SetSecretOptions = {}\n ): Promise<KeyVaultSecret> {\n let unflattenedOptions = {};\n\n if (options) {\n const { enabled, notBefore, expiresOn: expires, ...remainingOptions } = options;\n unflattenedOptions = {\n ...remainingOptions,\n secretAttributes: {\n enabled,\n notBefore,\n expires,\n },\n };\n }\n return tracingClient.withSpan(\n \"SecretClient.setSecret\",\n unflattenedOptions,\n async (updatedOptions) => {\n const response = await this.client.setSecret(\n this.vaultUrl,\n secretName,\n value,\n updatedOptions\n );\n return getSecretFromSecretBundle(response);\n }\n );\n }\n\n /**\n * Deletes a secret stored in Azure Key Vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is deleted.\n *\n * This operation requires the secrets/delete permission.\n *\n * Example usage:\n * ```ts\n * const client = new SecretClient(url, credentials);\n * await client.setSecret(\"MySecretName\", \"ABC123\");\n *\n * const deletePoller = await client.beginDeleteSecret(\"MySecretName\");\n *\n * // Serializing the poller\n * const serialized = deletePoller.toString();\n *\n * // A new poller can be created with:\n * // const newPoller = await client.beginDeleteSecret(\"MySecretName\", { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const deletedSecret = await deletePoller.pollUntilDone();\n * console.log(deletedSecret);\n * ```\n * Deletes a secret from a specified key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public async beginDeleteSecret(\n name: string,\n options: BeginDeleteSecretOptions = {}\n ): Promise<PollerLike<PollOperationState<DeletedSecret>, DeletedSecret>> {\n const poller = new DeleteSecretPoller({\n name,\n client: this.client,\n vaultUrl: this.vaultUrl,\n ...options,\n operationOptions: options,\n });\n // This will initialize the poller's operation (the deletion of the secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * The updateSecret method changes specified attributes of an existing stored secret. Properties that\n * are not specified in the request are left unchanged. The value of a secret itself cannot be\n * changed. This operation requires the secrets/set permission.\n *\n * Example usage:\n * ```ts\n * let secretName = \"MySecretName\";\n * let client = new SecretClient(url, credentials);\n * let secret = await client.getSecret(secretName);\n * await client.updateSecretProperties(secretName, secret.properties.version, { enabled: false });\n * ```\n * Updates the attributes associated with a specified secret in a given key vault.\n * @param secretName - The name of the secret.\n * @param secretVersion - The version of the secret.\n * @param options - The optional parameters.\n */\n public async updateSecretProperties(\n secretName: string,\n secretVersion: string,\n options: UpdateSecretPropertiesOptions = {}\n ): Promise<SecretProperties> {\n let unflattenedOptions = {};\n if (options) {\n const { enabled, notBefore, expiresOn: expires, ...remainingOptions } = options;\n unflattenedOptions = {\n ...remainingOptions,\n secretAttributes: {\n enabled,\n notBefore,\n expires,\n },\n };\n }\n\n return tracingClient.withSpan(\n \"SecretClient.updateSecretProperties\",\n unflattenedOptions,\n async (updatedOptions) => {\n const response = await this.client.updateSecret(\n this.vaultUrl,\n secretName,\n secretVersion,\n updatedOptions\n );\n return getSecretFromSecretBundle(response).properties;\n }\n );\n }\n\n /**\n * The getSecret method is applicable to any secret stored in Azure Key Vault. This operation requires\n * the secrets/get permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * let secret = await client.getSecret(\"MySecretName\");\n * ```\n * Get a specified secret from a given key vault.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getSecret(secretName: string, options: GetSecretOptions = {}): Promise<KeyVaultSecret> {\n return tracingClient.withSpan(\"SecretClient.getSecret\", options, async (updatedOptions) => {\n const response = await this.client.getSecret(\n this.vaultUrl,\n secretName,\n options && options.version ? options.version : \"\",\n updatedOptions\n );\n return getSecretFromSecretBundle(response);\n });\n }\n\n /**\n * The getDeletedSecret method returns the specified deleted secret along with its attributes.\n * This operation requires the secrets/get permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * await client.getDeletedSecret(\"MyDeletedSecret\");\n * ```\n * Gets the specified deleted secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public getDeletedSecret(\n secretName: string,\n options: GetDeletedSecretOptions = {}\n ): Promise<DeletedSecret> {\n return tracingClient.withSpan(\n \"SecretClient.getDeletedSecret\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getDeletedSecret(\n this.vaultUrl,\n secretName,\n updatedOptions\n );\n return getSecretFromSecretBundle(response);\n }\n );\n }\n\n /**\n * The purge deleted secret operation removes the secret permanently, without the possibility of\n * recovery. This operation can only be enabled on a soft-delete enabled vault. This operation\n * requires the secrets/purge permission.\n *\n * Example usage:\n * ```ts\n * const client = new SecretClient(url, credentials);\n * const deletePoller = await client.beginDeleteSecret(\"MySecretName\");\n * await deletePoller.pollUntilDone();\n * await client.purgeDeletedSecret(\"MySecretName\");\n * ```\n * Permanently deletes the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public purgeDeletedSecret(\n secretName: string,\n options: PurgeDeletedSecretOptions = {}\n ): Promise<void> {\n return tracingClient.withSpan(\n \"SecretClient.purgeDeletedSecret\",\n options,\n async (updatedOptions) => {\n await this.client.purgeDeletedSecret(this.vaultUrl, secretName, updatedOptions);\n }\n );\n }\n\n /**\n * Recovers the deleted secret in the specified vault.\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the secret is recovered.\n *\n * This operation requires the secrets/recover permission.\n *\n * Example usage:\n * ```ts\n * const client = new SecretClient(url, credentials);\n * await client.setSecret(\"MySecretName\", \"ABC123\");\n *\n * const deletePoller = await client.beginDeleteSecret(\"MySecretName\");\n * await deletePoller.pollUntilDone();\n *\n * const recoverPoller = await client.beginRecoverDeletedSecret(\"MySecretName\");\n *\n * // Serializing the poller\n * const serialized = recoverPoller.toString();\n *\n * // A new poller can be created with:\n * // const newPoller = await client.beginRecoverDeletedSecret(\"MySecretName\", { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const deletedSecret = await recoverPoller.pollUntilDone();\n * console.log(deletedSecret);\n * ```\n * Recovers the deleted secret to the latest version.\n * @param secretName - The name of the deleted secret.\n * @param options - The optional parameters.\n */\n public async beginRecoverDeletedSecret(\n name: string,\n options: BeginRecoverDeletedSecretOptions = {}\n ): Promise<PollerLike<PollOperationState<SecretProperties>, SecretProperties>> {\n const poller = new RecoverDeletedSecretPoller({\n name,\n client: this.client,\n vaultUrl: this.vaultUrl,\n ...options,\n operationOptions: options,\n });\n\n // This will initialize the poller's operation (the recovery of the deleted secret).\n await poller.poll();\n return poller;\n }\n\n /**\n * Requests that a backup of the specified secret be downloaded to the client. All versions of the\n * secret will be downloaded. This operation requires the secrets/backup permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * let backupResult = await client.backupSecret(\"MySecretName\");\n * ```\n * Backs up the specified secret.\n * @param secretName - The name of the secret.\n * @param options - The optional parameters.\n */\n public backupSecret(\n secretName: string,\n options: BackupSecretOptions = {}\n ): Promise<Uint8Array | undefined> {\n return tracingClient.withSpan(\"SecretClient.backupSecret\", options, async (updatedOptions) => {\n const response = await this.client.backupSecret(this.vaultUrl, secretName, updatedOptions);\n\n return response.value;\n });\n }\n\n /**\n * Restores a backed up secret, and all its versions, to a vault. This operation requires the\n * secrets/restore permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * let mySecretBundle = await client.backupSecret(\"MySecretName\");\n * // ...\n * await client.restoreSecretBackup(mySecretBundle);\n * ```\n * Restores a backed up secret to a vault.\n * @param secretBundleBackup - The backup blob associated with a secret bundle.\n * @param options - The optional parameters.\n */\n public restoreSecretBackup(\n secretBundleBackup: Uint8Array,\n options: RestoreSecretBackupOptions = {}\n ): Promise<SecretProperties> {\n return tracingClient.withSpan(\n \"SecretClient.restoreSecretBackup\",\n options,\n async (updatedOptions) => {\n const response = await this.client.restoreSecret(\n this.vaultUrl,\n secretBundleBackup,\n updatedOptions\n );\n return getSecretFromSecretBundle(response).properties;\n }\n );\n }\n\n /**\n * Deals with the pagination of {@link listPropertiesOfSecretVersions}.\n * @param name - The name of the KeyVault Secret.\n * @param continuationState - An object that indicates the position of the paginated request.\n * @param options - Optional parameters for the underlying HTTP request.\n */\n private async *listPropertiesOfSecretVersionsPage(\n secretName: string,\n continuationState: PageSettings,\n options: ListPropertiesOfSecretVersionsOptions = {}\n ): AsyncIterableIterator<SecretProperties[]> {\n if (continuationState.continuationToken == null) {\n const optionsComplete: GetSecretsOptionalParams = {\n maxresults: continuationState.maxPageSize,\n ...options,\n };\n const currentSetResponse = await tracingClient.withSpan(\n \"SecretClient.listPropertiesOfSecretVersionsPage\",\n optionsComplete,\n (updatedOptions) => this.client.getSecretVersions(this.vaultUrl, secretName, updatedOptions)\n );\n continuationState.continuationToken = currentSetResponse.nextLink;\n if (currentSetResponse.value) {\n yield currentSetResponse.value.map(\n (bundle: SecretBundle | DeletedSecretBundle) =>\n getSecretFromSecretBundle(bundle).properties\n );\n }\n }\n while (continuationState.continuationToken) {\n const currentSetResponse = await tracingClient.withSpan(\n \"SecretClient.listPropertiesOfSecretVersionsPage\",\n options,\n (updatedOptions) =>\n this.client.getSecretVersionsNext(\n this.vaultUrl,\n secretName,\n continuationState.continuationToken!,\n updatedOptions\n )\n );\n continuationState.continuationToken = currentSetResponse.nextLink;\n if (currentSetResponse.value) {\n yield currentSetResponse.value.map(\n (bundle: SecretBundle | DeletedSecretBundle) =>\n getSecretFromSecretBundle(bundle).properties\n );\n } else {\n break;\n }\n }\n }\n\n /**\n * Deals with the iteration of all the available results of {@link listPropertiesOfSecretVersions}.\n * @param name - The name of the KeyVault Secret.\n * @param options - Optional parameters for the underlying HTTP request.\n */\n private async *listPropertiesOfSecretVersionsAll(\n secretName: string,\n options: ListPropertiesOfSecretVersionsOptions = {}\n ): AsyncIterableIterator<SecretProperties> {\n const f = {};\n\n for await (const page of this.listPropertiesOfSecretVersionsPage(secretName, f, options)) {\n for (const item of page) {\n yield item;\n }\n }\n }\n\n /**\n * Iterates all versions of the given secret in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * for await (const secretProperties of client.listPropertiesOfSecretVersions(\"MySecretName\")) {\n * const secret = await client.getSecret(secretProperties.name);\n * console.log(\"secret version: \", secret);\n * }\n * ```\n * @param secretName - Name of the secret to fetch versions for.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecretVersions(\n secretName: string,\n options: ListPropertiesOfSecretVersionsOptions = {}\n ): PagedAsyncIterableIterator<SecretProperties> {\n const iter = this.listPropertiesOfSecretVersionsAll(secretName, options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) =>\n this.listPropertiesOfSecretVersionsPage(secretName, settings, options),\n };\n }\n\n /**\n * Deals with the pagination of {@link listPropertiesOfSecrets}.\n * @param continuationState - An object that indicates the position of the paginated request.\n * @param options - Optional parameters for the underlying HTTP request.\n */\n private async *listPropertiesOfSecretsPage(\n continuationState: PageSettings,\n options: ListPropertiesOfSecretsOptions = {}\n ): AsyncIterableIterator<SecretProperties[]> {\n if (continuationState.continuationToken == null) {\n const optionsComplete: GetSecretsOptionalParams = {\n maxresults: continuationState.maxPageSize,\n ...options,\n };\n const currentSetResponse = await tracingClient.withSpan(\n \"SecretClient.listPropertiesOfSecretsPage\",\n optionsComplete,\n (updatedOptions) => this.client.getSecrets(this.vaultUrl, updatedOptions)\n );\n continuationState.continuationToken = currentSetResponse.nextLink;\n if (currentSetResponse.value) {\n yield currentSetResponse.value.map(\n (bundle: SecretBundle | DeletedSecretBundle) =>\n getSecretFromSecretBundle(bundle).properties\n );\n }\n }\n while (continuationState.continuationToken) {\n const currentSetResponse = await tracingClient.withSpan(\n \"SecretClient.listPropertiesOfSecretsPage\",\n options,\n (updatedOptions) =>\n this.client.getSecretsNext(\n this.vaultUrl,\n continuationState.continuationToken!,\n updatedOptions\n )\n );\n continuationState.continuationToken = currentSetResponse.nextLink;\n if (currentSetResponse.value) {\n yield currentSetResponse.value.map(\n (bundle: SecretBundle | DeletedSecretBundle) =>\n getSecretFromSecretBundle(bundle).properties\n );\n } else {\n break;\n }\n }\n }\n\n /**\n * Deals with the iteration of all the available results of {@link listPropertiesOfSecrets}.\n * @param options - Optional parameters for the underlying HTTP request.\n */\n private async *listPropertiesOfSecretsAll(\n options: ListPropertiesOfSecretsOptions = {}\n ): AsyncIterableIterator<SecretProperties> {\n const f = {};\n\n for await (const page of this.listPropertiesOfSecretsPage(f, options)) {\n for (const item of page) {\n yield item;\n }\n }\n }\n\n /**\n * Iterates the latest version of all secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * for await (const secretProperties of client.listPropertiesOfSecrets()) {\n * const secret = await client.getSecret(secretProperties.name);\n * console.log(\"secret: \", secret);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listPropertiesOfSecrets(\n options: ListPropertiesOfSecretsOptions = {}\n ): PagedAsyncIterableIterator<SecretProperties> {\n const iter = this.listPropertiesOfSecretsAll(options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) => this.listPropertiesOfSecretsPage(settings, options),\n };\n }\n\n /**\n * Deals with the pagination of {@link listDeletedSecrets}.\n * @param continuationState - An object that indicates the position of the paginated request.\n * @param options - Optional parameters for the underlying HTTP request.\n */\n private async *listDeletedSecretsPage(\n continuationState: PageSettings,\n options: ListDeletedSecretsOptions = {}\n ): AsyncIterableIterator<DeletedSecret[]> {\n if (continuationState.continuationToken == null) {\n const optionsComplete: GetSecretsOptionalParams = {\n maxresults: continuationState.maxPageSize,\n ...options,\n };\n const currentSetResponse = await tracingClient.withSpan(\n \"SecretClient.listDeletedSecretsPage\",\n optionsComplete,\n (updatedOptions) => this.client.getDeletedSecrets(this.vaultUrl, updatedOptions)\n );\n continuationState.continuationToken = currentSetResponse.nextLink;\n if (currentSetResponse.value) {\n yield currentSetResponse.value.map((bundle: SecretBundle | DeletedSecretBundle) =>\n getSecretFromSecretBundle(bundle)\n );\n }\n }\n while (continuationState.continuationToken) {\n const currentSetResponse = await tracingClient.withSpan(\n \"SecretClient.lisDeletedSecretsPage\",\n options,\n (updatedOptions) =>\n this.client.getDeletedSecretsNext(\n this.vaultUrl,\n continuationState.continuationToken!,\n updatedOptions\n )\n );\n continuationState.continuationToken = currentSetResponse.nextLink;\n if (currentSetResponse.value) {\n yield currentSetResponse.value.map((bundle: SecretBundle | DeletedSecretBundle) =>\n getSecretFromSecretBundle(bundle)\n );\n } else {\n break;\n }\n }\n }\n\n /**\n * Deals with the iteration of all the available results of {@link listDeletedSecrets}.\n * @param options - Optional parameters for the underlying HTTP request.\n */\n private async *listDeletedSecretsAll(\n options: ListDeletedSecretsOptions = {}\n ): AsyncIterableIterator<DeletedSecret> {\n const f = {};\n\n for await (const page of this.listDeletedSecretsPage(f, options)) {\n for (const item of page) {\n yield item;\n }\n }\n }\n\n /**\n * Iterates the deleted secrets in the vault. The full secret identifier and attributes are provided\n * in the response. No values are returned for the secrets. This operations requires the secrets/list permission.\n *\n * Example usage:\n * ```ts\n * let client = new SecretClient(url, credentials);\n * for await (const deletedSecret of client.listDeletedSecrets()) {\n * console.log(\"deleted secret: \", deletedSecret);\n * }\n * ```\n * List all secrets in the vault.\n * @param options - The optional parameters.\n */\n public listDeletedSecrets(\n options: ListDeletedSecretsOptions = {}\n ): PagedAsyncIterableIterator<DeletedSecret> {\n const iter = this.listDeletedSecretsAll(options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) => this.listDeletedSecretsPage(settings, options),\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"secretsModels.js","sourceRoot":"","sources":["../../../src/secretsModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as coreClient from \"@azure/core-client\";\nimport { DeletionRecoveryLevel } from \"./generated/models\";\nimport { ExtendedCommonClientOptions } from \"@azure/core-http-compat\";\n\n/**\n * The latest supported KeyVault service API version\n */\nexport const LATEST_API_VERSION = \"7.3\";\n\n/**\n * The optional parameters accepted by the KeyVault's KeyClient\n */\nexport interface SecretClientOptions extends ExtendedCommonClientOptions {\n /**\n * The accepted versions of the KeyVault's service API.\n */\n serviceVersion?: \"7.0\" | \"7.1\" | \"7.2\" | \"7.3\";\n}\n\n/**\n * An interface representing a KeyVault Secret, with its name, value and {@link SecretProperties}.\n */\nexport interface KeyVaultSecret {\n /**\n * The properties of the secret.\n */\n properties: SecretProperties;\n /**\n * The value of the secret.\n */\n value?: string;\n /**\n * The name of the secret.\n */\n name: string;\n}\n\n/**\n * An interface representing the properties of a {@link KeyVaultSecret}.\n */\nexport interface SecretProperties {\n /**\n * The base URL to the vault.\n */\n vaultUrl: string;\n /**\n * The version of the secret. May be undefined.\n */\n version?: string;\n /**\n * The name of the secret.\n */\n name: string;\n /**\n * The secret id.\n */\n id?: string;\n /**\n * The content type of the secret.\n */\n contentType?: string;\n /**\n * Determines whether the object is enabled.\n */\n enabled?: boolean;\n /**\n * Not before date in UTC.\n */\n readonly notBefore?: Date;\n /**\n * Expiry date in UTC.\n */\n readonly expiresOn?: Date;\n /**\n * Application specific\n * metadata in the form of key-value pairs.\n */\n tags?: { [propertyName: string]: string };\n /**\n * If this is a secret backing a KV certificate, then\n * this field specifies the corresponding key backing the KV certificate.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n * @deprecated Please use {@link SecretProperties.certificateKeyId} instead. `keyId` will always be undefined.\n */\n readonly keyId?: never;\n\n /**\n * If this is a secret backing a KV certificate, then\n * this field specifies the identifier of the corresponding key backing the KV certificate.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly certificateKeyId?: string;\n\n /**\n * True if the secret's lifetime is managed by\n * key vault. If this is a secret backing a certificate, then managed will be\n * true.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly managed?: boolean;\n /**\n * Creation time in UTC.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly createdOn?: Date;\n /**\n * Last updated time in UTC.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly updatedOn?: Date;\n /**\n * Reflects the deletion\n * recovery level currently in effect for keys in the current vault. If it\n * contains 'Purgeable' the key can be permanently deleted by a privileged\n * user; otherwise, only the system can purge the key, at the end of the\n * retention interval. Possible values include: 'Purgeable',\n * 'Recoverable+Purgeable', 'Recoverable',\n * 'Recoverable+ProtectedSubscription'\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly recoveryLevel?: DeletionRecoveryLevel;\n /**\n * The retention dates of the softDelete data.\n * The value should be `>=7` and `<=90` when softDelete enabled.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n recoverableDays?: number;\n}\n\n/**\n * An interface representing a deleted KeyVault Secret.\n */\nexport interface DeletedSecret {\n /**\n * The properties of the secret\n */\n properties: SecretProperties & {\n /**\n * The url of the recovery object, used to\n * identify and recover the deleted secret.\n * @deprecated Please use {@link DeletedSecret.recoveryId}.\n */\n recoveryId?: string;\n /**\n * The time when the secret is scheduled\n * to be purged, in UTC\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n * @deprecated Please use {@link DeletedSecret.scheduledPurgeDate}.\n */\n scheduledPurgeDate?: Date;\n /**\n * The time when the secret was deleted, in UTC\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n * @deprecated Please use {@link DeletedSecret.deletedOn}.\n */\n deletedOn?: Date;\n };\n /**\n * The secret value.\n */\n value?: string;\n /**\n * The name of the secret.\n */\n name: string;\n /**\n * The url of the recovery object, used to\n * identify and recover the deleted secret.\n */\n recoveryId?: string;\n /**\n * The time when the secret is scheduled\n * to be purged, in UTC\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n scheduledPurgeDate?: Date;\n /**\n * The time when the secret was deleted, in UTC\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n deletedOn?: Date;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginDeleteSecret} and {@link beginRecoverDeletedKey}.\n */\nexport interface SecretPollerOptions extends coreClient.OperationOptions {\n /**\n * Time between each polling in milliseconds.\n */\n intervalInMs?: number;\n /**\n * A serialized poller, used to resume an existing operation\n */\n resumeFrom?: string;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginDeleteSecret}\n */\nexport interface BeginDeleteSecretOptions extends SecretPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginRecoverDeletedSecret}\n */\nexport interface BeginRecoverDeletedSecretOptions extends SecretPollerOptions {}\n\n/**\n * Options for {@link setSecret}.\n */\nexport interface SetSecretOptions extends coreClient.OperationOptions {\n /**\n * Application specific metadata in the form of key-value pairs.\n */\n tags?: { [propertyName: string]: string };\n /**\n * Type of the secret value such as a password.\n */\n contentType?: string;\n /**\n * Determines whether the object is enabled.\n */\n enabled?: boolean;\n /**\n * Not before date in UTC.\n */\n readonly notBefore?: Date;\n /**\n * Expiry date in UTC.\n */\n readonly expiresOn?: Date;\n}\n\n/**\n * Options for {@link updateSecretProperties}.\n */\nexport interface UpdateSecretPropertiesOptions extends coreClient.OperationOptions {\n /**\n * Type of the secret value such as a password.\n */\n contentType?: string;\n /**\n * Determines whether the object is enabled.\n */\n enabled?: boolean;\n /**\n * Not before date in UTC.\n */\n readonly notBefore?: Date;\n /**\n * Expiry date in UTC.\n */\n readonly expiresOn?: Date;\n /**\n * Application specific metadata in the form of key-value pairs.\n */\n tags?: { [propertyName: string]: string };\n}\n\n/**\n * Options for {@link getSecret}.\n */\nexport interface GetSecretOptions extends coreClient.OperationOptions {\n /**\n * The version of the secret to retrieve. If not\n * specified the latest version of the secret will be retrieved.\n */\n version?: string;\n}\n\n/**\n * Options for {@link getDeletedSecret}.\n */\nexport interface GetDeletedSecretOptions extends coreClient.OperationOptions {}\n\n/**\n * Options for {@link purgeDeletedSecret}.\n */\nexport interface PurgeDeletedSecretOptions extends coreClient.OperationOptions {}\n\n/**\n * Options for {@link backupSecretOptions}.\n */\nexport interface BackupSecretOptions extends coreClient.OperationOptions {}\n\n/**\n * Options for {@link restoreSecretBackup}.\n */\nexport interface RestoreSecretBackupOptions extends coreClient.OperationOptions {}\n\n/**\n * @internal\n * Options for {@link recoverDeletedSecret}.\n */\nexport interface RecoverDeletedSecretOptions extends coreClient.OperationOptions {}\n\n/**\n * @internal\n * Options for {@link deleteSecret}.\n */\nexport interface DeleteSecretOptions extends coreClient.OperationOptions {}\n\n/**\n * Options for {@link listPropertiesOfSecretVersions}.\n */\nexport interface ListPropertiesOfSecretVersionsOptions extends coreClient.OperationOptions {}\n\n/**\n * Options for {@link listPropertiesOfSecrets}.\n */\nexport interface ListPropertiesOfSecretsOptions extends coreClient.OperationOptions {}\n\n/**\n * Options for {@link listDeletedSecrets}.\n */\nexport interface ListDeletedSecretsOptions extends coreClient.OperationOptions {}\n"]}
1
+ {"version":3,"file":"secretsModels.js","sourceRoot":"","sources":["../../../src/secretsModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as coreClient from \"@azure/core-client\";\nimport { DeletionRecoveryLevel } from \"./generated/models\";\nimport { ExtendedCommonClientOptions } from \"@azure/core-http-compat\";\n\n/**\n * The latest supported KeyVault service API version\n */\nexport const LATEST_API_VERSION = \"7.3\";\n\n/**\n * The optional parameters accepted by the KeyVault's KeyClient\n */\nexport interface SecretClientOptions extends ExtendedCommonClientOptions {\n /**\n * The accepted versions of the KeyVault's service API.\n */\n serviceVersion?: \"7.0\" | \"7.1\" | \"7.2\" | \"7.3\";\n\n /**\n * Whether to disable verification that the authentication challenge resource matches the Key Vault domain.\n * Defaults to false.\n */\n disableChallengeResourceVerification?: boolean;\n}\n\n/**\n * An interface representing a KeyVault Secret, with its name, value and {@link SecretProperties}.\n */\nexport interface KeyVaultSecret {\n /**\n * The properties of the secret.\n */\n properties: SecretProperties;\n /**\n * The value of the secret.\n */\n value?: string;\n /**\n * The name of the secret.\n */\n name: string;\n}\n\n/**\n * An interface representing the properties of a {@link KeyVaultSecret}.\n */\nexport interface SecretProperties {\n /**\n * The base URL to the vault.\n */\n vaultUrl: string;\n /**\n * The version of the secret. May be undefined.\n */\n version?: string;\n /**\n * The name of the secret.\n */\n name: string;\n /**\n * The secret id.\n */\n id?: string;\n /**\n * The content type of the secret.\n */\n contentType?: string;\n /**\n * Determines whether the object is enabled.\n */\n enabled?: boolean;\n /**\n * Not before date in UTC.\n */\n readonly notBefore?: Date;\n /**\n * Expiry date in UTC.\n */\n readonly expiresOn?: Date;\n /**\n * Application specific\n * metadata in the form of key-value pairs.\n */\n tags?: { [propertyName: string]: string };\n /**\n * If this is a secret backing a KV certificate, then\n * this field specifies the corresponding key backing the KV certificate.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n * @deprecated Please use {@link SecretProperties.certificateKeyId} instead. `keyId` will always be undefined.\n */\n readonly keyId?: never;\n\n /**\n * If this is a secret backing a KV certificate, then\n * this field specifies the identifier of the corresponding key backing the KV certificate.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly certificateKeyId?: string;\n\n /**\n * True if the secret's lifetime is managed by\n * key vault. If this is a secret backing a certificate, then managed will be\n * true.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly managed?: boolean;\n /**\n * Creation time in UTC.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly createdOn?: Date;\n /**\n * Last updated time in UTC.\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly updatedOn?: Date;\n /**\n * Reflects the deletion\n * recovery level currently in effect for keys in the current vault. If it\n * contains 'Purgeable' the key can be permanently deleted by a privileged\n * user; otherwise, only the system can purge the key, at the end of the\n * retention interval. Possible values include: 'Purgeable',\n * 'Recoverable+Purgeable', 'Recoverable',\n * 'Recoverable+ProtectedSubscription'\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n readonly recoveryLevel?: DeletionRecoveryLevel;\n /**\n * The retention dates of the softDelete data.\n * The value should be `>=7` and `<=90` when softDelete enabled.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n recoverableDays?: number;\n}\n\n/**\n * An interface representing a deleted KeyVault Secret.\n */\nexport interface DeletedSecret {\n /**\n * The properties of the secret\n */\n properties: SecretProperties & {\n /**\n * The url of the recovery object, used to\n * identify and recover the deleted secret.\n * @deprecated Please use {@link DeletedSecret.recoveryId}.\n */\n recoveryId?: string;\n /**\n * The time when the secret is scheduled\n * to be purged, in UTC\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n * @deprecated Please use {@link DeletedSecret.scheduledPurgeDate}.\n */\n scheduledPurgeDate?: Date;\n /**\n * The time when the secret was deleted, in UTC\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n * @deprecated Please use {@link DeletedSecret.deletedOn}.\n */\n deletedOn?: Date;\n };\n /**\n * The secret value.\n */\n value?: string;\n /**\n * The name of the secret.\n */\n name: string;\n /**\n * The url of the recovery object, used to\n * identify and recover the deleted secret.\n */\n recoveryId?: string;\n /**\n * The time when the secret is scheduled\n * to be purged, in UTC\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n scheduledPurgeDate?: Date;\n /**\n * The time when the secret was deleted, in UTC\n * **NOTE: This property will not be serialized. It can only be populated by\n * the server.**\n */\n deletedOn?: Date;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginDeleteSecret} and {@link beginRecoverDeletedKey}.\n */\nexport interface SecretPollerOptions extends coreClient.OperationOptions {\n /**\n * Time between each polling in milliseconds.\n */\n intervalInMs?: number;\n /**\n * A serialized poller, used to resume an existing operation\n */\n resumeFrom?: string;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginDeleteSecret}\n */\nexport interface BeginDeleteSecretOptions extends SecretPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginRecoverDeletedSecret}\n */\nexport interface BeginRecoverDeletedSecretOptions extends SecretPollerOptions {}\n\n/**\n * Options for {@link setSecret}.\n */\nexport interface SetSecretOptions extends coreClient.OperationOptions {\n /**\n * Application specific metadata in the form of key-value pairs.\n */\n tags?: { [propertyName: string]: string };\n /**\n * Type of the secret value such as a password.\n */\n contentType?: string;\n /**\n * Determines whether the object is enabled.\n */\n enabled?: boolean;\n /**\n * Not before date in UTC.\n */\n readonly notBefore?: Date;\n /**\n * Expiry date in UTC.\n */\n readonly expiresOn?: Date;\n}\n\n/**\n * Options for {@link updateSecretProperties}.\n */\nexport interface UpdateSecretPropertiesOptions extends coreClient.OperationOptions {\n /**\n * Type of the secret value such as a password.\n */\n contentType?: string;\n /**\n * Determines whether the object is enabled.\n */\n enabled?: boolean;\n /**\n * Not before date in UTC.\n */\n readonly notBefore?: Date;\n /**\n * Expiry date in UTC.\n */\n readonly expiresOn?: Date;\n /**\n * Application specific metadata in the form of key-value pairs.\n */\n tags?: { [propertyName: string]: string };\n}\n\n/**\n * Options for {@link getSecret}.\n */\nexport interface GetSecretOptions extends coreClient.OperationOptions {\n /**\n * The version of the secret to retrieve. If not\n * specified the latest version of the secret will be retrieved.\n */\n version?: string;\n}\n\n/**\n * Options for {@link getDeletedSecret}.\n */\nexport interface GetDeletedSecretOptions extends coreClient.OperationOptions {}\n\n/**\n * Options for {@link purgeDeletedSecret}.\n */\nexport interface PurgeDeletedSecretOptions extends coreClient.OperationOptions {}\n\n/**\n * Options for {@link backupSecretOptions}.\n */\nexport interface BackupSecretOptions extends coreClient.OperationOptions {}\n\n/**\n * Options for {@link restoreSecretBackup}.\n */\nexport interface RestoreSecretBackupOptions extends coreClient.OperationOptions {}\n\n/**\n * @internal\n * Options for {@link recoverDeletedSecret}.\n */\nexport interface RecoverDeletedSecretOptions extends coreClient.OperationOptions {}\n\n/**\n * @internal\n * Options for {@link deleteSecret}.\n */\nexport interface DeleteSecretOptions extends coreClient.OperationOptions {}\n\n/**\n * Options for {@link listPropertiesOfSecretVersions}.\n */\nexport interface ListPropertiesOfSecretVersionsOptions extends coreClient.OperationOptions {}\n\n/**\n * Options for {@link listPropertiesOfSecrets}.\n */\nexport interface ListPropertiesOfSecretsOptions extends coreClient.OperationOptions {}\n\n/**\n * Options for {@link listDeletedSecrets}.\n */\nexport interface ListDeletedSecretsOptions extends coreClient.OperationOptions {}\n"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@azure/keyvault-secrets",
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
- "version": "4.5.2-alpha.20220919.6",
5
+ "version": "4.6.0",
6
6
  "license": "MIT",
7
7
  "description": "Isomorphic client library for Azure KeyVault's secrets.",
8
8
  "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-secrets/README.md",
@@ -114,12 +114,12 @@
114
114
  "tslib": "^2.2.0"
115
115
  },
116
116
  "devDependencies": {
117
- "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
118
- "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
117
+ "@azure/dev-tool": "^1.0.0",
118
+ "@azure/eslint-plugin-azure-sdk": "^3.0.0",
119
119
  "@azure/identity": "^2.1.0-beta.2",
120
- "@azure/test-utils": ">=1.0.0-alpha <1.0.0-alphb",
120
+ "@azure/test-utils": "^1.0.0",
121
121
  "@azure-tools/test-recorder": "^1.0.0",
122
- "@azure-tools/test-credential": ">=1.0.0-alpha <1.0.0-alphb",
122
+ "@azure-tools/test-credential": "^1.0.0",
123
123
  "@microsoft/api-extractor": "7.18.11",
124
124
  "@types/mocha": "^7.0.2",
125
125
  "@types/node": "^12.0.0",
@@ -270,7 +270,7 @@ export declare class SecretClient {
270
270
  *
271
271
  * let client = new SecretClient(vaultUrl, credentials);
272
272
  * ```
273
- * @param vaultUrl - The base URL to the vault.
273
+ * @param vaultUrl - The base URL to the vault. You should validate that this URL references a valid Key Vault resource. See https://aka.ms/azsdk/blog/vault-uri for details.
274
274
  * @param credential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \@azure/identity package to create a credential that suits your needs.
275
275
  * @param pipelineOptions - Pipeline options used to configure Key Vault API requests.
276
276
  * Omit this parameter to use the default pipeline configuration.
@@ -536,6 +536,11 @@ export declare interface SecretClientOptions extends ExtendedCommonClientOptions
536
536
  * The accepted versions of the KeyVault's service API.
537
537
  */
538
538
  serviceVersion?: "7.0" | "7.1" | "7.2" | "7.3";
539
+ /**
540
+ * Whether to disable verification that the authentication challenge resource matches the Key Vault domain.
541
+ * Defaults to false.
542
+ */
543
+ disableChallengeResourceVerification?: boolean;
539
544
  }
540
545
 
541
546
  /**