@azure/keyvault-admin 4.3.1-alpha.20221107.3 → 4.4.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +261 -11
- package/dist/index.js.map +1 -1
- package/dist-esm/src/constants.js +2 -2
- package/dist-esm/src/constants.js.map +1 -1
- package/dist-esm/src/generated/keyVaultClient.js +81 -2
- package/dist-esm/src/generated/keyVaultClient.js.map +1 -1
- package/dist-esm/src/generated/keyVaultClientContext.js +1 -1
- package/dist-esm/src/generated/keyVaultClientContext.js.map +1 -1
- package/dist-esm/src/generated/models/index.js +11 -6
- package/dist-esm/src/generated/models/index.js.map +1 -1
- package/dist-esm/src/generated/models/mappers.js +64 -0
- package/dist-esm/src/generated/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/models/parameters.js +15 -1
- package/dist-esm/src/generated/models/parameters.js.map +1 -1
- package/dist-esm/src/index.js +2 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/settingsClient.js +94 -0
- package/dist-esm/src/settingsClient.js.map +1 -0
- package/dist-esm/src/settingsClientModels.js +4 -0
- package/dist-esm/src/settingsClientModels.js.map +1 -0
- package/package.json +5 -5
- package/types/keyvault-admin.d.ts +143 -2
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
|
-
import { RoleDefinitionCreateParameters as RoleDefinitionCreateParametersMapper, RoleAssignmentCreateParameters as RoleAssignmentCreateParametersMapper, SASTokenParameter as SASTokenParameterMapper, RestoreOperationParameters as RestoreOperationParametersMapper, SelectiveKeyRestoreOperationParameters as SelectiveKeyRestoreOperationParametersMapper } from "../models/mappers";
|
|
8
|
+
import { RoleDefinitionCreateParameters as RoleDefinitionCreateParametersMapper, RoleAssignmentCreateParameters as RoleAssignmentCreateParametersMapper, SASTokenParameter as SASTokenParameterMapper, RestoreOperationParameters as RestoreOperationParametersMapper, SelectiveKeyRestoreOperationParameters as SelectiveKeyRestoreOperationParametersMapper, UpdateSettingRequest as UpdateSettingRequestMapper } from "../models/mappers";
|
|
9
9
|
export const accept = {
|
|
10
10
|
parameterPath: "accept",
|
|
11
11
|
mapper: {
|
|
@@ -140,4 +140,18 @@ export const keyName = {
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
|
+
export const value = {
|
|
144
|
+
parameterPath: "value",
|
|
145
|
+
mapper: UpdateSettingRequestMapper
|
|
146
|
+
};
|
|
147
|
+
export const settingName = {
|
|
148
|
+
parameterPath: "settingName",
|
|
149
|
+
mapper: {
|
|
150
|
+
serializedName: "setting-name",
|
|
151
|
+
required: true,
|
|
152
|
+
type: {
|
|
153
|
+
name: "String"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
};
|
|
143
157
|
//# sourceMappingURL=parameters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../../src/generated/models/parameters.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,EACL,8BAA8B,IAAI,oCAAoC,EACtE,8BAA8B,IAAI,oCAAoC,EACtE,iBAAiB,IAAI,uBAAuB,EAC5C,0BAA0B,IAAI,gCAAgC,EAC9D,sCAAsC,IAAI,4CAA4C,
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../../src/generated/models/parameters.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,EACL,8BAA8B,IAAI,oCAAoC,EACtE,8BAA8B,IAAI,oCAAoC,EACtE,iBAAiB,IAAI,uBAAuB,EAC5C,0BAA0B,IAAI,gCAAgC,EAC9D,sCAAsC,IAAI,4CAA4C,EACtF,oBAAoB,IAAI,0BAA0B,EACnD,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,MAAM,GAAuB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AoB,CAAC;IAChD,MAAM,EAAE,gCAAgC;CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAuB;IACrD,aAAa,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC;IAChD,MAAM,EAAE,4CAA4C;CACrD,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAA0B;IAC5C,aAAa,EAAE,SAAS;IACxB,MAAM,EAAE;QACN,cAAc,EAAE,SAAS;QACzB,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAuB;IACvC,aAAa,EAAE,OAAO;IACtB,MAAM,EAAE,0BAA0B;CACnC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAA0B;IAChD,aAAa,EAAE,aAAa;IAC5B,MAAM,EAAE;QACN,cAAc,EAAE,cAAc;QAC9B,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,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 {\n OperationParameter,\n OperationURLParameter,\n OperationQueryParameter\n} from \"@azure/core-client\";\nimport {\n RoleDefinitionCreateParameters as RoleDefinitionCreateParametersMapper,\n RoleAssignmentCreateParameters as RoleAssignmentCreateParametersMapper,\n SASTokenParameter as SASTokenParameterMapper,\n RestoreOperationParameters as RestoreOperationParametersMapper,\n SelectiveKeyRestoreOperationParameters as SelectiveKeyRestoreOperationParametersMapper,\n UpdateSettingRequest as UpdateSettingRequestMapper\n} from \"../models/mappers\";\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const vaultBaseUrl: OperationURLParameter = {\n parameterPath: \"vaultBaseUrl\",\n mapper: {\n serializedName: \"vaultBaseUrl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const scope: OperationURLParameter = {\n parameterPath: \"scope\",\n mapper: {\n serializedName: \"scope\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const roleDefinitionName: OperationURLParameter = {\n parameterPath: \"roleDefinitionName\",\n mapper: {\n serializedName: \"roleDefinitionName\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const apiVersion: OperationQueryParameter = {\n parameterPath: \"apiVersion\",\n mapper: {\n serializedName: \"api-version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const parameters: OperationParameter = {\n parameterPath: \"parameters\",\n mapper: RoleDefinitionCreateParametersMapper\n};\n\nexport const filter: OperationQueryParameter = {\n parameterPath: [\"options\", \"filter\"],\n mapper: {\n serializedName: \"$filter\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const nextLink: OperationURLParameter = {\n parameterPath: \"nextLink\",\n mapper: {\n serializedName: \"nextLink\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const roleAssignmentName: OperationURLParameter = {\n parameterPath: \"roleAssignmentName\",\n mapper: {\n serializedName: \"roleAssignmentName\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const parameters1: OperationParameter = {\n parameterPath: \"parameters\",\n mapper: RoleAssignmentCreateParametersMapper\n};\n\nexport const azureStorageBlobContainerUri: OperationParameter = {\n parameterPath: [\"options\", \"azureStorageBlobContainerUri\"],\n mapper: SASTokenParameterMapper\n};\n\nexport const jobId: OperationURLParameter = {\n parameterPath: \"jobId\",\n mapper: {\n serializedName: \"jobId\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const restoreBlobDetails: OperationParameter = {\n parameterPath: [\"options\", \"restoreBlobDetails\"],\n mapper: RestoreOperationParametersMapper\n};\n\nexport const restoreBlobDetails1: OperationParameter = {\n parameterPath: [\"options\", \"restoreBlobDetails\"],\n mapper: SelectiveKeyRestoreOperationParametersMapper\n};\n\nexport const keyName: OperationURLParameter = {\n parameterPath: \"keyName\",\n mapper: {\n serializedName: \"keyName\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const value: OperationParameter = {\n parameterPath: \"value\",\n mapper: UpdateSettingRequestMapper\n};\n\nexport const settingName: OperationURLParameter = {\n parameterPath: \"settingName\",\n mapper: {\n serializedName: \"setting-name\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n"]}
|
package/dist-esm/src/index.js
CHANGED
|
@@ -4,5 +4,7 @@ export * from "./accessControlClient";
|
|
|
4
4
|
export * from "./accessControlModels";
|
|
5
5
|
export * from "./backupClient";
|
|
6
6
|
export * from "./backupClientModels";
|
|
7
|
+
export * from "./settingsClient";
|
|
8
|
+
export * from "./settingsClientModels";
|
|
7
9
|
export { LATEST_API_VERSION, SDK_VERSION } from "./constants";
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAA0B,MAAM,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./accessControlClient\";\nexport * from \"./accessControlModels\";\n\nexport * from \"./backupClient\";\nexport * from \"./backupClientModels\";\n\nexport { LATEST_API_VERSION, SDK_VERSION, SUPPORTED_API_VERSIONS } from \"./constants\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AAErC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAA0B,MAAM,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./accessControlClient\";\nexport * from \"./accessControlModels\";\n\nexport * from \"./backupClient\";\nexport * from \"./backupClientModels\";\n\nexport * from \"./settingsClient\";\nexport * from \"./settingsClientModels\";\n\nexport { LATEST_API_VERSION, SDK_VERSION, SUPPORTED_API_VERSIONS } from \"./constants\";\n"]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
|
|
4
|
+
import { createKeyVaultChallengeCallbacks } from "@azure/keyvault-common";
|
|
5
|
+
import { LATEST_API_VERSION } from "./constants";
|
|
6
|
+
import { KeyVaultClient } from "./generated";
|
|
7
|
+
import { logger } from "./log";
|
|
8
|
+
function makeSetting(generatedSetting) {
|
|
9
|
+
if (generatedSetting.type === "boolean") {
|
|
10
|
+
return {
|
|
11
|
+
name: generatedSetting.name,
|
|
12
|
+
value: generatedSetting.value === "true" ? true : false,
|
|
13
|
+
kind: "boolean",
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return {
|
|
18
|
+
name: generatedSetting.name,
|
|
19
|
+
value: generatedSetting.value,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The KeyVaultSettingsClient provides asynchronous methods to create, update, get and list
|
|
25
|
+
* settings for the Azure Key Vault.
|
|
26
|
+
*/
|
|
27
|
+
export class KeyVaultSettingsClient {
|
|
28
|
+
/**
|
|
29
|
+
* Creates an instance of the KeyVaultSettingsClient.
|
|
30
|
+
*
|
|
31
|
+
* Example usage:
|
|
32
|
+
* ```ts
|
|
33
|
+
* import { KeyVaultSettingsClient } from "@azure/keyvault-admin";
|
|
34
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
35
|
+
*
|
|
36
|
+
* let vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
37
|
+
* let credentials = new DefaultAzureCredential();
|
|
38
|
+
*
|
|
39
|
+
* let client = new KeyVaultSettingsClient(vaultUrl, credentials);
|
|
40
|
+
* ```
|
|
41
|
+
* @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.azure.net`. You should validate that this URL references a valid Key Vault or Managed HSM resource. See https://aka.ms/azsdk/blog/vault-uri for details.
|
|
42
|
+
* @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.
|
|
43
|
+
* @param options - options used to configure Key Vault API requests.
|
|
44
|
+
|
|
45
|
+
*/
|
|
46
|
+
constructor(vaultUrl, credential, options = {}) {
|
|
47
|
+
this.vaultUrl = vaultUrl;
|
|
48
|
+
const apiVersion = options.serviceVersion || LATEST_API_VERSION;
|
|
49
|
+
const clientOptions = Object.assign(Object.assign({}, options), { loggingOptions: {
|
|
50
|
+
logger: logger.info,
|
|
51
|
+
additionalAllowedHeaderNames: [
|
|
52
|
+
"x-ms-keyvault-region",
|
|
53
|
+
"x-ms-keyvault-network-info",
|
|
54
|
+
"x-ms-keyvault-service-version",
|
|
55
|
+
],
|
|
56
|
+
} });
|
|
57
|
+
this.client = new KeyVaultClient(apiVersion, clientOptions);
|
|
58
|
+
this.client.pipeline.addPolicy(bearerTokenAuthenticationPolicy({
|
|
59
|
+
credential,
|
|
60
|
+
scopes: [],
|
|
61
|
+
challengeCallbacks: createKeyVaultChallengeCallbacks(options),
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Updates the named account setting.
|
|
66
|
+
*
|
|
67
|
+
* @param settingName - the name of the account setting. Must be a valid settings option.
|
|
68
|
+
* @param value - the value of the pool setting.
|
|
69
|
+
* @param options - the optional parameters.
|
|
70
|
+
*/
|
|
71
|
+
async updateSetting(settingName, value, options = {}) {
|
|
72
|
+
return makeSetting(await this.client.updateSetting(this.vaultUrl, settingName, String(value), options));
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Get the value of a specific account setting.
|
|
76
|
+
*
|
|
77
|
+
* @param settingName - the name of the setting.
|
|
78
|
+
* @param options - the optional parameters.
|
|
79
|
+
*/
|
|
80
|
+
async getSetting(settingName, options = {}) {
|
|
81
|
+
return makeSetting(await this.client.getSetting(this.vaultUrl, settingName, options));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* List the account's settings.
|
|
85
|
+
*
|
|
86
|
+
* @param options - the optional parameters.
|
|
87
|
+
*/
|
|
88
|
+
async getSettings(options = {}) {
|
|
89
|
+
var _a;
|
|
90
|
+
const { settings } = await this.client.getSettings(this.vaultUrl, options);
|
|
91
|
+
return { settings: (_a = settings === null || settings === void 0 ? void 0 : settings.map(makeSetting)) !== null && _a !== void 0 ? _a : [] };
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=settingsClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settingsClient.js","sourceRoot":"","sources":["../../src/settingsClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,gCAAg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CACH,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,aAAa,CACjB,WAAmB,EACnB,KAAc,EACd,UAAgC,EAAE;QAElC,OAAO,WAAW,CAChB,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CACpF,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CAAC,WAAmB,EAAE,UAA6B,EAAE;QACnE,OAAO,WAAW,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IACxF,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,WAAW,CAAC,UAA+B,EAAE;;QACjD,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC3E,OAAO,EAAE,QAAQ,EAAE,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,GAAG,CAAC,WAAW,CAAC,mCAAI,EAAE,EAAE,CAAC;IACxD,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport { createKeyVaultChallengeCallbacks } from \"@azure/keyvault-common\";\nimport { LATEST_API_VERSION } from \"./constants\";\nimport { KeyVaultClient, Setting as GeneratedSetting } from \"./generated\";\nimport { logger } from \"./log\";\nimport {\n UpdateSettingOptions,\n GetSettingOptions,\n ListSettingsOptions,\n ListSettingsResponse,\n KeyVaultSetting,\n SettingsClientOptions,\n} from \"./settingsClientModels\";\n\nfunction makeSetting(generatedSetting: GeneratedSetting): KeyVaultSetting {\n if (generatedSetting.type === \"boolean\") {\n return {\n name: generatedSetting.name,\n value: generatedSetting.value === \"true\" ? true : false,\n kind: \"boolean\",\n };\n } else {\n return {\n name: generatedSetting.name,\n value: generatedSetting.value,\n };\n }\n}\n\n/**\n * The KeyVaultSettingsClient provides asynchronous methods to create, update, get and list\n * settings for the Azure Key Vault.\n */\nexport class KeyVaultSettingsClient {\n /**\n * The base URL to the vault.\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated Key Vault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of the KeyVaultSettingsClient.\n *\n * Example usage:\n * ```ts\n * import { KeyVaultSettingsClient } from \"@azure/keyvault-admin\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * let vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * let credentials = new DefaultAzureCredential();\n *\n * let client = new KeyVaultSettingsClient(vaultUrl, credentials);\n * ```\n * @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.azure.net`. You should validate that this URL references a valid Key Vault or Managed HSM 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 options - options used to configure Key Vault API requests.\n\n */\n constructor(vaultUrl: string, credential: TokenCredential, options: SettingsClientOptions = {}) {\n this.vaultUrl = vaultUrl;\n\n const apiVersion = options.serviceVersion || LATEST_API_VERSION;\n\n const clientOptions = {\n ...options,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\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(apiVersion, clientOptions);\n this.client.pipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: [],\n challengeCallbacks: createKeyVaultChallengeCallbacks(options),\n })\n );\n }\n\n /**\n * Updates the named account setting.\n *\n * @param settingName - the name of the account setting. Must be a valid settings option.\n * @param value - the value of the pool setting.\n * @param options - the optional parameters.\n */\n async updateSetting(\n settingName: string,\n value: boolean,\n options: UpdateSettingOptions = {}\n ): Promise<KeyVaultSetting> {\n return makeSetting(\n await this.client.updateSetting(this.vaultUrl, settingName, String(value), options)\n );\n }\n\n /**\n * Get the value of a specific account setting.\n *\n * @param settingName - the name of the setting.\n * @param options - the optional parameters.\n */\n async getSetting(settingName: string, options: GetSettingOptions = {}): Promise<KeyVaultSetting> {\n return makeSetting(await this.client.getSetting(this.vaultUrl, settingName, options));\n }\n\n /**\n * List the account's settings.\n *\n * @param options - the optional parameters.\n */\n async getSettings(options: ListSettingsOptions = {}): Promise<ListSettingsResponse> {\n const { settings } = await this.client.getSettings(this.vaultUrl, options);\n return { settings: settings?.map(makeSetting) ?? [] };\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settingsClientModels.js","sourceRoot":"","sources":["../../src/settingsClientModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport type { CommonClientOptions, OperationOptions } from \"@azure/core-client\";\nimport { SUPPORTED_API_VERSIONS } from \"./constants\";\n\n/**\n * The optional parameters accepted by the KeyVaultSettingsClient.\n */\nexport interface SettingsClientOptions extends CommonClientOptions {\n /**\n * The accepted versions of the Key Vault's service API.\n */\n serviceVersion?: SUPPORTED_API_VERSIONS;\n\n /**\n * Whether to disable verification that the authentication challenge resource matches the Key Vault or Managed HSM domain.\n * Defaults to false.\n */\n disableChallengeResourceVerification?: boolean;\n}\n\n/**\n * An interface representing the optional parameters that can be passed to {@link KeyVaultSettingsClient.updateSetting}\n */\nexport interface UpdateSettingOptions extends OperationOptions {}\n\n/**\n * An interface representing the optional parameters that can be passed to {@link KeyVaultSettingsClient.getSetting}\n */\nexport interface GetSettingOptions extends OperationOptions {}\n\n/**\n * An interface representing the optional parameters that can be passed to {@link KeyVaultSettingsClient.listSettings}\n */\nexport interface ListSettingsOptions extends OperationOptions {}\n\n/**\n * Common attributes shared by Key Vault settings of all kinds.\n */\nexport interface KeyVaultSettingCommon {\n /**\n * The name of the setting.\n */\n name: string;\n}\n\n/**\n * A Key Vault setting for which the type of the value is unknown.\n */\nexport interface UnknownKeyVaultSetting extends KeyVaultSettingCommon {\n /**\n * The value of the setting.\n */\n value: unknown;\n\n /**\n * The kind of the setting.\n */\n kind?: never;\n}\n\n/**\n * A Key Vault setting with a boolean value.\n */\nexport interface BooleanKeyVaultSetting extends KeyVaultSettingCommon {\n /**\n * The value of the setting.\n */\n value: boolean;\n\n /**\n * The kind of the setting.\n */\n kind: \"boolean\";\n}\n\n/**\n * A Key Vault setting.\n */\nexport type KeyVaultSetting = UnknownKeyVaultSetting | BooleanKeyVaultSetting;\n\n/**\n * An interface representing the response returned by {@link KeyVaultSettingsClient.listSettings}\n */\nexport interface ListSettingsResponse {\n /**\n * The account's settings.\n */\n settings: KeyVaultSetting[];\n}\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@azure/keyvault-admin",
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
|
-
"version": "4.
|
|
5
|
+
"version": "4.4.0-beta.1",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "Isomorphic client library for Azure KeyVault's administrative functions.",
|
|
8
8
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-admin/README.md",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@azure/core-paging": "^1.1.1",
|
|
109
109
|
"@azure/core-rest-pipeline": "^1.1.0",
|
|
110
110
|
"@azure/core-tracing": "^1.0.0",
|
|
111
|
-
"@azure/keyvault-common": "
|
|
111
|
+
"@azure/keyvault-common": "^1.0.0-beta.1",
|
|
112
112
|
"@azure/logger": "^1.0.0",
|
|
113
113
|
"@types/uuid": "^8.0.0",
|
|
114
114
|
"tslib": "^2.2.0",
|
|
@@ -117,11 +117,11 @@
|
|
|
117
117
|
"devDependencies": {
|
|
118
118
|
"@azure/abort-controller": "^1.0.0",
|
|
119
119
|
"@azure/core-util": "^1.0.0",
|
|
120
|
-
"@azure/dev-tool": "
|
|
121
|
-
"@azure/eslint-plugin-azure-sdk": "
|
|
120
|
+
"@azure/dev-tool": "^1.0.0",
|
|
121
|
+
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
|
|
122
122
|
"@azure/identity": "^2.0.1",
|
|
123
123
|
"@azure/keyvault-keys": "^4.2.1",
|
|
124
|
-
"@azure/test-utils": "
|
|
124
|
+
"@azure/test-utils": "^1.0.0",
|
|
125
125
|
"@azure-tools/test-recorder": "^1.0.0",
|
|
126
126
|
"@microsoft/api-extractor": "^7.31.1",
|
|
127
127
|
"@types/mocha": "^7.0.2",
|
|
@@ -22,6 +22,20 @@ export declare interface AccessControlClientOptions extends CommonClientOptions
|
|
|
22
22
|
disableChallengeResourceVerification?: boolean;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* A Key Vault setting with a boolean value.
|
|
27
|
+
*/
|
|
28
|
+
export declare interface BooleanKeyVaultSetting extends KeyVaultSettingCommon {
|
|
29
|
+
/**
|
|
30
|
+
* The value of the setting.
|
|
31
|
+
*/
|
|
32
|
+
value: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The kind of the setting.
|
|
35
|
+
*/
|
|
36
|
+
kind: "boolean";
|
|
37
|
+
}
|
|
38
|
+
|
|
25
39
|
/**
|
|
26
40
|
* An interface representing the optional parameters that can be
|
|
27
41
|
* passed to {@link createRoleAssignment}
|
|
@@ -55,6 +69,12 @@ export declare interface GetRoleAssignmentOptions extends OperationOptions {
|
|
|
55
69
|
export declare interface GetRoleDefinitionOptions extends OperationOptions {
|
|
56
70
|
}
|
|
57
71
|
|
|
72
|
+
/**
|
|
73
|
+
* An interface representing the optional parameters that can be passed to {@link KeyVaultSettingsClient.getSetting}
|
|
74
|
+
*/
|
|
75
|
+
export declare interface GetSettingOptions extends OperationOptions {
|
|
76
|
+
}
|
|
77
|
+
|
|
58
78
|
/**
|
|
59
79
|
* The KeyVaultAccessControlClient provides methods to manage
|
|
60
80
|
* access control and role assignments in any given Azure Key Vault instance.
|
|
@@ -663,6 +683,76 @@ export declare interface KeyVaultSelectiveKeyRestoreResult {
|
|
|
663
683
|
endTime?: Date;
|
|
664
684
|
}
|
|
665
685
|
|
|
686
|
+
/**
|
|
687
|
+
* A Key Vault setting.
|
|
688
|
+
*/
|
|
689
|
+
export declare type KeyVaultSetting = UnknownKeyVaultSetting | BooleanKeyVaultSetting;
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* Common attributes shared by Key Vault settings of all kinds.
|
|
693
|
+
*/
|
|
694
|
+
export declare interface KeyVaultSettingCommon {
|
|
695
|
+
/**
|
|
696
|
+
* The name of the setting.
|
|
697
|
+
*/
|
|
698
|
+
name: string;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* The KeyVaultSettingsClient provides asynchronous methods to create, update, get and list
|
|
703
|
+
* settings for the Azure Key Vault.
|
|
704
|
+
*/
|
|
705
|
+
export declare class KeyVaultSettingsClient {
|
|
706
|
+
/**
|
|
707
|
+
* The base URL to the vault.
|
|
708
|
+
*/
|
|
709
|
+
readonly vaultUrl: string;
|
|
710
|
+
/**
|
|
711
|
+
* A reference to the auto-generated Key Vault HTTP client.
|
|
712
|
+
*/
|
|
713
|
+
private readonly client;
|
|
714
|
+
/**
|
|
715
|
+
* Creates an instance of the KeyVaultSettingsClient.
|
|
716
|
+
*
|
|
717
|
+
* Example usage:
|
|
718
|
+
* ```ts
|
|
719
|
+
* import { KeyVaultSettingsClient } from "@azure/keyvault-admin";
|
|
720
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
721
|
+
*
|
|
722
|
+
* let vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
723
|
+
* let credentials = new DefaultAzureCredential();
|
|
724
|
+
*
|
|
725
|
+
* let client = new KeyVaultSettingsClient(vaultUrl, credentials);
|
|
726
|
+
* ```
|
|
727
|
+
* @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.azure.net`. You should validate that this URL references a valid Key Vault or Managed HSM resource. See https://aka.ms/azsdk/blog/vault-uri for details.
|
|
728
|
+
* @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.
|
|
729
|
+
* @param options - options used to configure Key Vault API requests.
|
|
730
|
+
|
|
731
|
+
*/
|
|
732
|
+
constructor(vaultUrl: string, credential: TokenCredential, options?: SettingsClientOptions);
|
|
733
|
+
/**
|
|
734
|
+
* Updates the named account setting.
|
|
735
|
+
*
|
|
736
|
+
* @param settingName - the name of the account setting. Must be a valid settings option.
|
|
737
|
+
* @param value - the value of the pool setting.
|
|
738
|
+
* @param options - the optional parameters.
|
|
739
|
+
*/
|
|
740
|
+
updateSetting(settingName: string, value: boolean, options?: UpdateSettingOptions): Promise<KeyVaultSetting>;
|
|
741
|
+
/**
|
|
742
|
+
* Get the value of a specific account setting.
|
|
743
|
+
*
|
|
744
|
+
* @param settingName - the name of the setting.
|
|
745
|
+
* @param options - the optional parameters.
|
|
746
|
+
*/
|
|
747
|
+
getSetting(settingName: string, options?: GetSettingOptions): Promise<KeyVaultSetting>;
|
|
748
|
+
/**
|
|
749
|
+
* List the account's settings.
|
|
750
|
+
*
|
|
751
|
+
* @param options - the optional parameters.
|
|
752
|
+
*/
|
|
753
|
+
getSettings(options?: ListSettingsOptions): Promise<ListSettingsResponse>;
|
|
754
|
+
}
|
|
755
|
+
|
|
666
756
|
/** Known values of {@link DataAction} that the service accepts. */
|
|
667
757
|
export declare enum KnownKeyVaultDataAction {
|
|
668
758
|
/** Read HSM key metadata. */
|
|
@@ -746,7 +836,7 @@ export declare enum KnownKeyVaultRoleScope {
|
|
|
746
836
|
/**
|
|
747
837
|
* The latest supported Key Vault service API version.
|
|
748
838
|
*/
|
|
749
|
-
export declare const LATEST_API_VERSION = "7.
|
|
839
|
+
export declare const LATEST_API_VERSION = "7.4-preview.1";
|
|
750
840
|
|
|
751
841
|
/**
|
|
752
842
|
* An interface representing optional parameters passed to {@link listRoleAssignments}.
|
|
@@ -782,6 +872,22 @@ export declare interface ListRoleDefinitionsPageSettings {
|
|
|
782
872
|
continuationToken?: string;
|
|
783
873
|
}
|
|
784
874
|
|
|
875
|
+
/**
|
|
876
|
+
* An interface representing the optional parameters that can be passed to {@link KeyVaultSettingsClient.listSettings}
|
|
877
|
+
*/
|
|
878
|
+
export declare interface ListSettingsOptions extends OperationOptions {
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* An interface representing the response returned by {@link KeyVaultSettingsClient.listSettings}
|
|
883
|
+
*/
|
|
884
|
+
export declare interface ListSettingsResponse {
|
|
885
|
+
/**
|
|
886
|
+
* The account's settings.
|
|
887
|
+
*/
|
|
888
|
+
settings: KeyVaultSetting[];
|
|
889
|
+
}
|
|
890
|
+
|
|
785
891
|
/**
|
|
786
892
|
* Current version of the Key Vault Admin SDK.
|
|
787
893
|
*/
|
|
@@ -813,9 +919,44 @@ export declare interface SetRoleDefinitionOptions extends OperationOptions {
|
|
|
813
919
|
assignableScopes?: KeyVaultRoleScope[];
|
|
814
920
|
}
|
|
815
921
|
|
|
922
|
+
/**
|
|
923
|
+
* The optional parameters accepted by the KeyVaultSettingsClient.
|
|
924
|
+
*/
|
|
925
|
+
export declare interface SettingsClientOptions extends CommonClientOptions {
|
|
926
|
+
/**
|
|
927
|
+
* The accepted versions of the Key Vault's service API.
|
|
928
|
+
*/
|
|
929
|
+
serviceVersion?: SUPPORTED_API_VERSIONS;
|
|
930
|
+
/**
|
|
931
|
+
* Whether to disable verification that the authentication challenge resource matches the Key Vault or Managed HSM domain.
|
|
932
|
+
* Defaults to false.
|
|
933
|
+
*/
|
|
934
|
+
disableChallengeResourceVerification?: boolean;
|
|
935
|
+
}
|
|
936
|
+
|
|
816
937
|
/**
|
|
817
938
|
* Supported API versions
|
|
818
939
|
*/
|
|
819
|
-
export declare type SUPPORTED_API_VERSIONS = "7.2" | "7.3";
|
|
940
|
+
export declare type SUPPORTED_API_VERSIONS = "7.2" | "7.3" | "7.4-preview.1";
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* A Key Vault setting for which the type of the value is unknown.
|
|
944
|
+
*/
|
|
945
|
+
export declare interface UnknownKeyVaultSetting extends KeyVaultSettingCommon {
|
|
946
|
+
/**
|
|
947
|
+
* The value of the setting.
|
|
948
|
+
*/
|
|
949
|
+
value: unknown;
|
|
950
|
+
/**
|
|
951
|
+
* The kind of the setting.
|
|
952
|
+
*/
|
|
953
|
+
kind?: never;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
/**
|
|
957
|
+
* An interface representing the optional parameters that can be passed to {@link KeyVaultSettingsClient.updateSetting}
|
|
958
|
+
*/
|
|
959
|
+
export declare interface UpdateSettingOptions extends OperationOptions {
|
|
960
|
+
}
|
|
820
961
|
|
|
821
962
|
export { }
|