@ibm-cloud/secrets-manager 0.0.4 → 0.1.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/auth/index.d.ts +2 -2
- package/auth/index.js +9 -9
- package/auth/index.js.map +1 -1
- package/lib/common.d.ts +3 -0
- package/lib/common.js +6 -2
- package/lib/common.js.map +1 -1
- package/package.json +22 -16
- package/readme.md +81 -29
- package/secrets-manager/v1.d.ts +1138 -0
- package/{ibm-cloud-secrets-manager-api → secrets-manager}/v1.js +184 -121
- package/secrets-manager/v1.js.map +1 -0
- package/ibm-cloud-secrets-manager-api/v1.d.ts +0 -842
- package/ibm-cloud-secrets-manager-api/v1.js.map +0 -1
|
@@ -0,0 +1,1138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (C) Copyright IBM Corp. 2021.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/// <reference types="node" />
|
|
17
|
+
import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http';
|
|
18
|
+
import { BaseService, UserOptions } from 'ibm-cloud-sdk-core';
|
|
19
|
+
/**
|
|
20
|
+
* With IBM Cloud® Secrets Manager, you can create, lease, and centrally manage secrets that are used in IBM Cloud
|
|
21
|
+
* services or your custom-built applications. Secrets are stored in a dedicated instance of Secrets Manager, built on
|
|
22
|
+
* open source HashiCorp Vault.
|
|
23
|
+
*/
|
|
24
|
+
declare class SecretsManagerV1 extends BaseService {
|
|
25
|
+
static DEFAULT_SERVICE_URL: string;
|
|
26
|
+
static DEFAULT_SERVICE_NAME: string;
|
|
27
|
+
/*************************
|
|
28
|
+
* Factory method
|
|
29
|
+
************************/
|
|
30
|
+
/**
|
|
31
|
+
* Constructs an instance of SecretsManagerV1 with passed in options and external configuration.
|
|
32
|
+
*
|
|
33
|
+
* @param {UserOptions} [options] - The parameters to send to the service.
|
|
34
|
+
* @param {string} [options.serviceName] - The name of the service to configure
|
|
35
|
+
* @param {Authenticator} [options.authenticator] - The Authenticator object used to authenticate requests to the service
|
|
36
|
+
* @param {string} [options.serviceUrl] - The URL for the service
|
|
37
|
+
* @returns {SecretsManagerV1}
|
|
38
|
+
*/
|
|
39
|
+
static newInstance(options: UserOptions): SecretsManagerV1;
|
|
40
|
+
/**
|
|
41
|
+
* Construct a SecretsManagerV1 object.
|
|
42
|
+
*
|
|
43
|
+
* @param {Object} options - Options for the service.
|
|
44
|
+
* @param {string} [options.serviceUrl] - The base url to use when contacting the service. The base url may differ between IBM Cloud regions.
|
|
45
|
+
* @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service.
|
|
46
|
+
* @param {Authenticator} options.authenticator - The Authenticator object used to authenticate requests to the service
|
|
47
|
+
* @constructor
|
|
48
|
+
* @returns {SecretsManagerV1}
|
|
49
|
+
*/
|
|
50
|
+
constructor(options: UserOptions);
|
|
51
|
+
/*************************
|
|
52
|
+
* config
|
|
53
|
+
************************/
|
|
54
|
+
/**
|
|
55
|
+
* Configure secrets of a given type.
|
|
56
|
+
*
|
|
57
|
+
* Updates the configuration for the given secret type.
|
|
58
|
+
*
|
|
59
|
+
* @param {Object} params - The parameters to send to the service.
|
|
60
|
+
* @param {string} params.secretType - The secret type.
|
|
61
|
+
* @param {EngineConfigOneOf} params.engineConfigOneOf - The base request for setting secret engine configuration.
|
|
62
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
63
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.Empty>>}
|
|
64
|
+
*/
|
|
65
|
+
putConfig(params: SecretsManagerV1.PutConfigParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.Empty>>;
|
|
66
|
+
/**
|
|
67
|
+
* Get the configuration for a secret type.
|
|
68
|
+
*
|
|
69
|
+
* Retrieves the configuration that is associated with the given secret type.
|
|
70
|
+
*
|
|
71
|
+
* @param {Object} params - The parameters to send to the service.
|
|
72
|
+
* @param {string} params.secretType - The secret type.
|
|
73
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
74
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetConfig>>}
|
|
75
|
+
*/
|
|
76
|
+
getConfig(params: SecretsManagerV1.GetConfigParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.GetConfig>>;
|
|
77
|
+
/*************************
|
|
78
|
+
* policies
|
|
79
|
+
************************/
|
|
80
|
+
/**
|
|
81
|
+
* Set secret policies.
|
|
82
|
+
*
|
|
83
|
+
* Creates or updates one or more policies, such as an [automatic rotation
|
|
84
|
+
* policy](http://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-rotate-secrets#auto-rotate-secret), for the
|
|
85
|
+
* specified secret.
|
|
86
|
+
*
|
|
87
|
+
* @param {Object} params - The parameters to send to the service.
|
|
88
|
+
* @param {string} params.secretType - The secret type.
|
|
89
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
90
|
+
* @param {CollectionMetadata} params.metadata - The metadata that describes the resource array.
|
|
91
|
+
* @param {SecretPolicyRotation[]} params.resources - A collection of resources.
|
|
92
|
+
* @param {string} [params.policy] - The type of policy that is associated with the specified secret.
|
|
93
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
94
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretPoliciesOneOf>>}
|
|
95
|
+
*/
|
|
96
|
+
putPolicy(params: SecretsManagerV1.PutPolicyParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretPoliciesOneOf>>;
|
|
97
|
+
/**
|
|
98
|
+
* List secret policies.
|
|
99
|
+
*
|
|
100
|
+
* Retrieves a list of policies that are associated with a specified secret.
|
|
101
|
+
*
|
|
102
|
+
* @param {Object} params - The parameters to send to the service.
|
|
103
|
+
* @param {string} params.secretType - The secret type.
|
|
104
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
105
|
+
* @param {string} [params.policy] - The type of policy that is associated with the specified secret.
|
|
106
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
107
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretPoliciesOneOf>>}
|
|
108
|
+
*/
|
|
109
|
+
getPolicy(params: SecretsManagerV1.GetPolicyParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretPoliciesOneOf>>;
|
|
110
|
+
/*************************
|
|
111
|
+
* secretGroups
|
|
112
|
+
************************/
|
|
113
|
+
/**
|
|
114
|
+
* Create a secret group.
|
|
115
|
+
*
|
|
116
|
+
* Creates a secret group that you can use to organize secrets and control who on your team has access to them.
|
|
117
|
+
*
|
|
118
|
+
* A successful request returns the ID value of the secret group, along with other metadata. To learn more about
|
|
119
|
+
* secret groups, check out the
|
|
120
|
+
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secret-groups).
|
|
121
|
+
*
|
|
122
|
+
* @param {Object} params - The parameters to send to the service.
|
|
123
|
+
* @param {CollectionMetadata} params.metadata - The metadata that describes the resource array.
|
|
124
|
+
* @param {SecretGroupResource[]} params.resources - A collection of resources.
|
|
125
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
126
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretGroupDef>>}
|
|
127
|
+
*/
|
|
128
|
+
createSecretGroup(params: SecretsManagerV1.CreateSecretGroupParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretGroupDef>>;
|
|
129
|
+
/**
|
|
130
|
+
* List secret groups.
|
|
131
|
+
*
|
|
132
|
+
* Retrieves the list of secret groups that are available in your Secrets Manager instance.
|
|
133
|
+
*
|
|
134
|
+
* @param {Object} [params] - The parameters to send to the service.
|
|
135
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
136
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretGroupDef>>}
|
|
137
|
+
*/
|
|
138
|
+
listSecretGroups(params?: SecretsManagerV1.ListSecretGroupsParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretGroupDef>>;
|
|
139
|
+
/**
|
|
140
|
+
* Get a secret group.
|
|
141
|
+
*
|
|
142
|
+
* Retrieves the metadata of an existing secret group by specifying the ID of the group.
|
|
143
|
+
*
|
|
144
|
+
* @param {Object} params - The parameters to send to the service.
|
|
145
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret group.
|
|
146
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
147
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretGroupDef>>}
|
|
148
|
+
*/
|
|
149
|
+
getSecretGroup(params: SecretsManagerV1.GetSecretGroupParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretGroupDef>>;
|
|
150
|
+
/**
|
|
151
|
+
* Update a secret group.
|
|
152
|
+
*
|
|
153
|
+
* Updates the metadata of an existing secret group, such as its name or description.
|
|
154
|
+
*
|
|
155
|
+
* @param {Object} params - The parameters to send to the service.
|
|
156
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret group.
|
|
157
|
+
* @param {CollectionMetadata} params.metadata - The metadata that describes the resource array.
|
|
158
|
+
* @param {SecretGroupMetadataUpdatable[]} params.resources - A collection of resources.
|
|
159
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
160
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretGroupDef>>}
|
|
161
|
+
*/
|
|
162
|
+
updateSecretGroupMetadata(params: SecretsManagerV1.UpdateSecretGroupMetadataParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretGroupDef>>;
|
|
163
|
+
/**
|
|
164
|
+
* Delete a secret group.
|
|
165
|
+
*
|
|
166
|
+
* Deletes a secret group by specifying the ID of the secret group.
|
|
167
|
+
*
|
|
168
|
+
* **Note:** To delete a secret group, it must be empty. If you need to remove a secret group that contains secrets,
|
|
169
|
+
* you must first [delete the secrets](#delete-secret) that are associated with the group.
|
|
170
|
+
*
|
|
171
|
+
* @param {Object} params - The parameters to send to the service.
|
|
172
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret group.
|
|
173
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
174
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.Empty>>}
|
|
175
|
+
*/
|
|
176
|
+
deleteSecretGroup(params: SecretsManagerV1.DeleteSecretGroupParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.Empty>>;
|
|
177
|
+
/*************************
|
|
178
|
+
* secrets
|
|
179
|
+
************************/
|
|
180
|
+
/**
|
|
181
|
+
* Create a secret.
|
|
182
|
+
*
|
|
183
|
+
* Creates a secret that you can use to access or authenticate to a protected resource.
|
|
184
|
+
*
|
|
185
|
+
* A successful request stores the secret in your dedicated instance based on the secret type and data that you
|
|
186
|
+
* specify. The response returns the ID value of the secret, along with other metadata.
|
|
187
|
+
*
|
|
188
|
+
* To learn more about the types of secrets that you can create with Secrets Manager, check out the
|
|
189
|
+
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secret-basics).
|
|
190
|
+
*
|
|
191
|
+
* @param {Object} params - The parameters to send to the service.
|
|
192
|
+
* @param {string} params.secretType - The secret type.
|
|
193
|
+
* @param {CollectionMetadata} params.metadata - The metadata that describes the resource array.
|
|
194
|
+
* @param {SecretResource[]} params.resources - A collection of resources.
|
|
195
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
196
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.CreateSecret>>}
|
|
197
|
+
*/
|
|
198
|
+
createSecret(params: SecretsManagerV1.CreateSecretParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.CreateSecret>>;
|
|
199
|
+
/**
|
|
200
|
+
* List secrets by type.
|
|
201
|
+
*
|
|
202
|
+
* Retrieves a list of secrets based on the type that you specify.
|
|
203
|
+
*
|
|
204
|
+
* @param {Object} params - The parameters to send to the service.
|
|
205
|
+
* @param {string} params.secretType - The secret type.
|
|
206
|
+
* @param {number} [params.limit] - The number of secrets to retrieve. By default, list operations return the first
|
|
207
|
+
* 200 items. To retrieve a different set of items, use `limit` with `offset` to page through your available
|
|
208
|
+
* resources.
|
|
209
|
+
*
|
|
210
|
+
* **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 secrets, use
|
|
211
|
+
* `../secrets/{secret-type}?limit=5`.
|
|
212
|
+
* @param {number} [params.offset] - The number of secrets to skip. By specifying `offset`, you retrieve a subset of
|
|
213
|
+
* items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
|
|
214
|
+
*
|
|
215
|
+
* **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
|
|
216
|
+
* `../secrets/{secret-type}?offset=25&limit=25`.
|
|
217
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
218
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecrets>>}
|
|
219
|
+
*/
|
|
220
|
+
listSecrets(params: SecretsManagerV1.ListSecretsParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecrets>>;
|
|
221
|
+
/**
|
|
222
|
+
* List all secrets.
|
|
223
|
+
*
|
|
224
|
+
* Retrieves a list of all secrets in your Secrets Manager instance.
|
|
225
|
+
*
|
|
226
|
+
* @param {Object} [params] - The parameters to send to the service.
|
|
227
|
+
* @param {number} [params.limit] - The number of secrets to retrieve. By default, list operations return the first
|
|
228
|
+
* 200 items. To retrieve a different set of items, use `limit` with `offset` to page through your available
|
|
229
|
+
* resources.
|
|
230
|
+
*
|
|
231
|
+
* **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 secrets, use
|
|
232
|
+
* `../secrets/{secret-type}?limit=5`.
|
|
233
|
+
* @param {number} [params.offset] - The number of secrets to skip. By specifying `offset`, you retrieve a subset of
|
|
234
|
+
* items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
|
|
235
|
+
*
|
|
236
|
+
* **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
|
|
237
|
+
* `../secrets/{secret-type}?offset=25&limit=25`.
|
|
238
|
+
* @param {string} [params.search] - Filter secrets that contain the specified string. The fields that are searched
|
|
239
|
+
* include: id, name, description, labels, secret_type.
|
|
240
|
+
*
|
|
241
|
+
* **Usage:** If you want to list only the secrets that contain the string "text", use
|
|
242
|
+
* `../secrets/{secret-type}?search=text`.
|
|
243
|
+
* @param {string} [params.sortBy] - Sort a list of secrets by the specified field.
|
|
244
|
+
*
|
|
245
|
+
* **Usage:** To sort a list of secrets by their creation date, use
|
|
246
|
+
* `../secrets/{secret-type}?sort_by=creation_date`.
|
|
247
|
+
* @param {string[]} [params.groups] - Filter secrets by groups.
|
|
248
|
+
*
|
|
249
|
+
* You can apply multiple filters by using a comma-separated list of secret group IDs. If you need to filter secrets
|
|
250
|
+
* that are in the default secret group, use the `default` keyword.
|
|
251
|
+
*
|
|
252
|
+
* **Usage:** To retrieve a list of secrets that are associated with an existing secret group or the default group,
|
|
253
|
+
* use `../secrets?groups={secret_group_ID},default`.
|
|
254
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
255
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecrets>>}
|
|
256
|
+
*/
|
|
257
|
+
listAllSecrets(params?: SecretsManagerV1.ListAllSecretsParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecrets>>;
|
|
258
|
+
/**
|
|
259
|
+
* Get a secret.
|
|
260
|
+
*
|
|
261
|
+
* Retrieves a secret and its details by specifying the ID of the secret.
|
|
262
|
+
*
|
|
263
|
+
* A successful request returns the secret data that is associated with your secret, along with other metadata. To
|
|
264
|
+
* view only the details of a specified secret without retrieving its value, use the [Get secret
|
|
265
|
+
* metadata](#get-secret-metadata) method.
|
|
266
|
+
*
|
|
267
|
+
* @param {Object} params - The parameters to send to the service.
|
|
268
|
+
* @param {string} params.secretType - The secret type.
|
|
269
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
270
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
271
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecret>>}
|
|
272
|
+
*/
|
|
273
|
+
getSecret(params: SecretsManagerV1.GetSecretParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecret>>;
|
|
274
|
+
/**
|
|
275
|
+
* Invoke an action on a secret.
|
|
276
|
+
*
|
|
277
|
+
* Invokes an action on a specified secret. This method supports the following actions:
|
|
278
|
+
*
|
|
279
|
+
* - `rotate`: Replace the value of an `arbitrary` or `username_password` secret.
|
|
280
|
+
* - `delete_credentials`: Delete the API key that is associated with an `iam_credentials` secret.
|
|
281
|
+
*
|
|
282
|
+
* @param {Object} params - The parameters to send to the service.
|
|
283
|
+
* @param {string} params.secretType - The secret type.
|
|
284
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
285
|
+
* @param {string} params.action - The action to perform on the specified secret.
|
|
286
|
+
* @param {SecretActionOneOf} params.secretActionOneOf - The base request body for invoking an action on a secret.
|
|
287
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
288
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecret>>}
|
|
289
|
+
*/
|
|
290
|
+
updateSecret(params: SecretsManagerV1.UpdateSecretParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecret>>;
|
|
291
|
+
/**
|
|
292
|
+
* Delete a secret.
|
|
293
|
+
*
|
|
294
|
+
* Deletes a secret by specifying the ID of the secret.
|
|
295
|
+
*
|
|
296
|
+
* @param {Object} params - The parameters to send to the service.
|
|
297
|
+
* @param {string} params.secretType - The secret type.
|
|
298
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
299
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
300
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.Empty>>}
|
|
301
|
+
*/
|
|
302
|
+
deleteSecret(params: SecretsManagerV1.DeleteSecretParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.Empty>>;
|
|
303
|
+
/**
|
|
304
|
+
* Get secret metadata.
|
|
305
|
+
*
|
|
306
|
+
* Retrieves the details of a secret by specifying the ID.
|
|
307
|
+
*
|
|
308
|
+
* A successful request returns only metadata about the secret, such as its name and creation date. To retrieve the
|
|
309
|
+
* value of a secret, use the [Get a secret](#get-secret) method.
|
|
310
|
+
*
|
|
311
|
+
* @param {Object} params - The parameters to send to the service.
|
|
312
|
+
* @param {string} params.secretType - The secret type.
|
|
313
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
314
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
315
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretMetadataRequest>>}
|
|
316
|
+
*/
|
|
317
|
+
getSecretMetadata(params: SecretsManagerV1.GetSecretMetadataParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretMetadataRequest>>;
|
|
318
|
+
/**
|
|
319
|
+
* Update secret metadata.
|
|
320
|
+
*
|
|
321
|
+
* Updates the metadata of a secret, such as its name or description.
|
|
322
|
+
*
|
|
323
|
+
* To update the actual contents of a secret, rotate the secret by using the [Invoke an action on a
|
|
324
|
+
* secret](#update-secret) method.
|
|
325
|
+
*
|
|
326
|
+
* @param {Object} params - The parameters to send to the service.
|
|
327
|
+
* @param {string} params.secretType - The secret type.
|
|
328
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
329
|
+
* @param {CollectionMetadata} params.metadata - The metadata that describes the resource array.
|
|
330
|
+
* @param {SecretMetadata[]} params.resources - A collection of resources.
|
|
331
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
332
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretMetadataRequest>>}
|
|
333
|
+
*/
|
|
334
|
+
updateSecretMetadata(params: SecretsManagerV1.UpdateSecretMetadataParams): Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretMetadataRequest>>;
|
|
335
|
+
}
|
|
336
|
+
/*************************
|
|
337
|
+
* interfaces
|
|
338
|
+
************************/
|
|
339
|
+
declare namespace SecretsManagerV1 {
|
|
340
|
+
/** An operation response. */
|
|
341
|
+
interface Response<T = any> {
|
|
342
|
+
result: T;
|
|
343
|
+
status: number;
|
|
344
|
+
statusText: string;
|
|
345
|
+
headers: IncomingHttpHeaders;
|
|
346
|
+
}
|
|
347
|
+
/** The callback for a service request. */
|
|
348
|
+
type Callback<T> = (error: any, response?: Response<T>) => void;
|
|
349
|
+
/** The body of a service request that returns no response data. */
|
|
350
|
+
interface Empty {
|
|
351
|
+
}
|
|
352
|
+
/** A standard JS object, defined to avoid the limitations of `Object` and `object` */
|
|
353
|
+
interface JsonObject {
|
|
354
|
+
[key: string]: any;
|
|
355
|
+
}
|
|
356
|
+
/*************************
|
|
357
|
+
* request interfaces
|
|
358
|
+
************************/
|
|
359
|
+
/** Parameters for the `putConfig` operation. */
|
|
360
|
+
interface PutConfigParams {
|
|
361
|
+
/** The secret type. */
|
|
362
|
+
secretType: PutConfigConstants.SecretType | string;
|
|
363
|
+
/** The base request for setting secret engine configuration. */
|
|
364
|
+
engineConfigOneOf: EngineConfigOneOf;
|
|
365
|
+
headers?: OutgoingHttpHeaders;
|
|
366
|
+
}
|
|
367
|
+
/** Constants for the `putConfig` operation. */
|
|
368
|
+
namespace PutConfigConstants {
|
|
369
|
+
/** The secret type. */
|
|
370
|
+
enum SecretType {
|
|
371
|
+
IAM_CREDENTIALS = "iam_credentials"
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
/** Parameters for the `getConfig` operation. */
|
|
375
|
+
interface GetConfigParams {
|
|
376
|
+
/** The secret type. */
|
|
377
|
+
secretType: GetConfigConstants.SecretType | string;
|
|
378
|
+
headers?: OutgoingHttpHeaders;
|
|
379
|
+
}
|
|
380
|
+
/** Constants for the `getConfig` operation. */
|
|
381
|
+
namespace GetConfigConstants {
|
|
382
|
+
/** The secret type. */
|
|
383
|
+
enum SecretType {
|
|
384
|
+
IAM_CREDENTIALS = "iam_credentials"
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
/** Parameters for the `putPolicy` operation. */
|
|
388
|
+
interface PutPolicyParams {
|
|
389
|
+
/** The secret type. */
|
|
390
|
+
secretType: PutPolicyConstants.SecretType | string;
|
|
391
|
+
/** The v4 UUID that uniquely identifies the secret. */
|
|
392
|
+
id: string;
|
|
393
|
+
/** The metadata that describes the resource array. */
|
|
394
|
+
metadata: CollectionMetadata;
|
|
395
|
+
/** A collection of resources. */
|
|
396
|
+
resources: SecretPolicyRotation[];
|
|
397
|
+
/** The type of policy that is associated with the specified secret. */
|
|
398
|
+
policy?: PutPolicyConstants.Policy | string;
|
|
399
|
+
headers?: OutgoingHttpHeaders;
|
|
400
|
+
}
|
|
401
|
+
/** Constants for the `putPolicy` operation. */
|
|
402
|
+
namespace PutPolicyConstants {
|
|
403
|
+
/** The secret type. */
|
|
404
|
+
enum SecretType {
|
|
405
|
+
USERNAME_PASSWORD = "username_password"
|
|
406
|
+
}
|
|
407
|
+
/** The type of policy that is associated with the specified secret. */
|
|
408
|
+
enum Policy {
|
|
409
|
+
ROTATION = "rotation"
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
/** Parameters for the `getPolicy` operation. */
|
|
413
|
+
interface GetPolicyParams {
|
|
414
|
+
/** The secret type. */
|
|
415
|
+
secretType: GetPolicyConstants.SecretType | string;
|
|
416
|
+
/** The v4 UUID that uniquely identifies the secret. */
|
|
417
|
+
id: string;
|
|
418
|
+
/** The type of policy that is associated with the specified secret. */
|
|
419
|
+
policy?: GetPolicyConstants.Policy | string;
|
|
420
|
+
headers?: OutgoingHttpHeaders;
|
|
421
|
+
}
|
|
422
|
+
/** Constants for the `getPolicy` operation. */
|
|
423
|
+
namespace GetPolicyConstants {
|
|
424
|
+
/** The secret type. */
|
|
425
|
+
enum SecretType {
|
|
426
|
+
USERNAME_PASSWORD = "username_password"
|
|
427
|
+
}
|
|
428
|
+
/** The type of policy that is associated with the specified secret. */
|
|
429
|
+
enum Policy {
|
|
430
|
+
ROTATION = "rotation"
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
/** Parameters for the `createSecretGroup` operation. */
|
|
434
|
+
interface CreateSecretGroupParams {
|
|
435
|
+
/** The metadata that describes the resource array. */
|
|
436
|
+
metadata: CollectionMetadata;
|
|
437
|
+
/** A collection of resources. */
|
|
438
|
+
resources: SecretGroupResource[];
|
|
439
|
+
headers?: OutgoingHttpHeaders;
|
|
440
|
+
}
|
|
441
|
+
/** Parameters for the `listSecretGroups` operation. */
|
|
442
|
+
interface ListSecretGroupsParams {
|
|
443
|
+
headers?: OutgoingHttpHeaders;
|
|
444
|
+
}
|
|
445
|
+
/** Parameters for the `getSecretGroup` operation. */
|
|
446
|
+
interface GetSecretGroupParams {
|
|
447
|
+
/** The v4 UUID that uniquely identifies the secret group. */
|
|
448
|
+
id: string;
|
|
449
|
+
headers?: OutgoingHttpHeaders;
|
|
450
|
+
}
|
|
451
|
+
/** Parameters for the `updateSecretGroupMetadata` operation. */
|
|
452
|
+
interface UpdateSecretGroupMetadataParams {
|
|
453
|
+
/** The v4 UUID that uniquely identifies the secret group. */
|
|
454
|
+
id: string;
|
|
455
|
+
/** The metadata that describes the resource array. */
|
|
456
|
+
metadata: CollectionMetadata;
|
|
457
|
+
/** A collection of resources. */
|
|
458
|
+
resources: SecretGroupMetadataUpdatable[];
|
|
459
|
+
headers?: OutgoingHttpHeaders;
|
|
460
|
+
}
|
|
461
|
+
/** Parameters for the `deleteSecretGroup` operation. */
|
|
462
|
+
interface DeleteSecretGroupParams {
|
|
463
|
+
/** The v4 UUID that uniquely identifies the secret group. */
|
|
464
|
+
id: string;
|
|
465
|
+
headers?: OutgoingHttpHeaders;
|
|
466
|
+
}
|
|
467
|
+
/** Parameters for the `createSecret` operation. */
|
|
468
|
+
interface CreateSecretParams {
|
|
469
|
+
/** The secret type. */
|
|
470
|
+
secretType: CreateSecretConstants.SecretType | string;
|
|
471
|
+
/** The metadata that describes the resource array. */
|
|
472
|
+
metadata: CollectionMetadata;
|
|
473
|
+
/** A collection of resources. */
|
|
474
|
+
resources: SecretResource[];
|
|
475
|
+
headers?: OutgoingHttpHeaders;
|
|
476
|
+
}
|
|
477
|
+
/** Constants for the `createSecret` operation. */
|
|
478
|
+
namespace CreateSecretConstants {
|
|
479
|
+
/** The secret type. */
|
|
480
|
+
enum SecretType {
|
|
481
|
+
ARBITRARY = "arbitrary",
|
|
482
|
+
USERNAME_PASSWORD = "username_password",
|
|
483
|
+
IAM_CREDENTIALS = "iam_credentials"
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
/** Parameters for the `listSecrets` operation. */
|
|
487
|
+
interface ListSecretsParams {
|
|
488
|
+
/** The secret type. */
|
|
489
|
+
secretType: ListSecretsConstants.SecretType | string;
|
|
490
|
+
/** The number of secrets to retrieve. By default, list operations return the first 200 items. To retrieve a
|
|
491
|
+
* different set of items, use `limit` with `offset` to page through your available resources.
|
|
492
|
+
*
|
|
493
|
+
* **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 secrets, use
|
|
494
|
+
* `../secrets/{secret-type}?limit=5`.
|
|
495
|
+
*/
|
|
496
|
+
limit?: number;
|
|
497
|
+
/** The number of secrets to skip. By specifying `offset`, you retrieve a subset of items that starts with the
|
|
498
|
+
* `offset` value. Use `offset` with `limit` to page through your available resources.
|
|
499
|
+
*
|
|
500
|
+
* **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
|
|
501
|
+
* `../secrets/{secret-type}?offset=25&limit=25`.
|
|
502
|
+
*/
|
|
503
|
+
offset?: number;
|
|
504
|
+
headers?: OutgoingHttpHeaders;
|
|
505
|
+
}
|
|
506
|
+
/** Constants for the `listSecrets` operation. */
|
|
507
|
+
namespace ListSecretsConstants {
|
|
508
|
+
/** The secret type. */
|
|
509
|
+
enum SecretType {
|
|
510
|
+
ARBITRARY = "arbitrary",
|
|
511
|
+
USERNAME_PASSWORD = "username_password",
|
|
512
|
+
IAM_CREDENTIALS = "iam_credentials"
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
/** Parameters for the `listAllSecrets` operation. */
|
|
516
|
+
interface ListAllSecretsParams {
|
|
517
|
+
/** The number of secrets to retrieve. By default, list operations return the first 200 items. To retrieve a
|
|
518
|
+
* different set of items, use `limit` with `offset` to page through your available resources.
|
|
519
|
+
*
|
|
520
|
+
* **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 secrets, use
|
|
521
|
+
* `../secrets/{secret-type}?limit=5`.
|
|
522
|
+
*/
|
|
523
|
+
limit?: number;
|
|
524
|
+
/** The number of secrets to skip. By specifying `offset`, you retrieve a subset of items that starts with the
|
|
525
|
+
* `offset` value. Use `offset` with `limit` to page through your available resources.
|
|
526
|
+
*
|
|
527
|
+
* **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
|
|
528
|
+
* `../secrets/{secret-type}?offset=25&limit=25`.
|
|
529
|
+
*/
|
|
530
|
+
offset?: number;
|
|
531
|
+
/** Filter secrets that contain the specified string. The fields that are searched include: id, name,
|
|
532
|
+
* description, labels, secret_type.
|
|
533
|
+
*
|
|
534
|
+
* **Usage:** If you want to list only the secrets that contain the string "text", use
|
|
535
|
+
* `../secrets/{secret-type}?search=text`.
|
|
536
|
+
*/
|
|
537
|
+
search?: string;
|
|
538
|
+
/** Sort a list of secrets by the specified field.
|
|
539
|
+
*
|
|
540
|
+
* **Usage:** To sort a list of secrets by their creation date, use
|
|
541
|
+
* `../secrets/{secret-type}?sort_by=creation_date`.
|
|
542
|
+
*/
|
|
543
|
+
sortBy?: ListAllSecretsConstants.SortBy | string;
|
|
544
|
+
/** Filter secrets by groups.
|
|
545
|
+
*
|
|
546
|
+
* You can apply multiple filters by using a comma-separated list of secret group IDs. If you need to filter
|
|
547
|
+
* secrets that are in the default secret group, use the `default` keyword.
|
|
548
|
+
*
|
|
549
|
+
* **Usage:** To retrieve a list of secrets that are associated with an existing secret group or the default group,
|
|
550
|
+
* use `../secrets?groups={secret_group_ID},default`.
|
|
551
|
+
*/
|
|
552
|
+
groups?: string[];
|
|
553
|
+
headers?: OutgoingHttpHeaders;
|
|
554
|
+
}
|
|
555
|
+
/** Constants for the `listAllSecrets` operation. */
|
|
556
|
+
namespace ListAllSecretsConstants {
|
|
557
|
+
/** Sort a list of secrets by the specified field. **Usage:** To sort a list of secrets by their creation date, use `../secrets/{secret-type}?sort_by=creation_date`. */
|
|
558
|
+
enum SortBy {
|
|
559
|
+
ID = "id",
|
|
560
|
+
CREATION_DATE = "creation_date",
|
|
561
|
+
EXPIRATION_DATE = "expiration_date",
|
|
562
|
+
SECRET_TYPE = "secret_type",
|
|
563
|
+
NAME = "name"
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
/** Parameters for the `getSecret` operation. */
|
|
567
|
+
interface GetSecretParams {
|
|
568
|
+
/** The secret type. */
|
|
569
|
+
secretType: GetSecretConstants.SecretType | string;
|
|
570
|
+
/** The v4 UUID that uniquely identifies the secret. */
|
|
571
|
+
id: string;
|
|
572
|
+
headers?: OutgoingHttpHeaders;
|
|
573
|
+
}
|
|
574
|
+
/** Constants for the `getSecret` operation. */
|
|
575
|
+
namespace GetSecretConstants {
|
|
576
|
+
/** The secret type. */
|
|
577
|
+
enum SecretType {
|
|
578
|
+
ARBITRARY = "arbitrary",
|
|
579
|
+
USERNAME_PASSWORD = "username_password",
|
|
580
|
+
IAM_CREDENTIALS = "iam_credentials"
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
/** Parameters for the `updateSecret` operation. */
|
|
584
|
+
interface UpdateSecretParams {
|
|
585
|
+
/** The secret type. */
|
|
586
|
+
secretType: UpdateSecretConstants.SecretType | string;
|
|
587
|
+
/** The v4 UUID that uniquely identifies the secret. */
|
|
588
|
+
id: string;
|
|
589
|
+
/** The action to perform on the specified secret. */
|
|
590
|
+
action: UpdateSecretConstants.Action | string;
|
|
591
|
+
/** The base request body for invoking an action on a secret. */
|
|
592
|
+
secretActionOneOf: SecretActionOneOf;
|
|
593
|
+
headers?: OutgoingHttpHeaders;
|
|
594
|
+
}
|
|
595
|
+
/** Constants for the `updateSecret` operation. */
|
|
596
|
+
namespace UpdateSecretConstants {
|
|
597
|
+
/** The secret type. */
|
|
598
|
+
enum SecretType {
|
|
599
|
+
ARBITRARY = "arbitrary",
|
|
600
|
+
USERNAME_PASSWORD = "username_password",
|
|
601
|
+
IAM_CREDENTIALS = "iam_credentials"
|
|
602
|
+
}
|
|
603
|
+
/** The action to perform on the specified secret. */
|
|
604
|
+
enum Action {
|
|
605
|
+
ROTATE = "rotate",
|
|
606
|
+
DELETE_CREDENTIALS = "delete_credentials"
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
/** Parameters for the `deleteSecret` operation. */
|
|
610
|
+
interface DeleteSecretParams {
|
|
611
|
+
/** The secret type. */
|
|
612
|
+
secretType: DeleteSecretConstants.SecretType | string;
|
|
613
|
+
/** The v4 UUID that uniquely identifies the secret. */
|
|
614
|
+
id: string;
|
|
615
|
+
headers?: OutgoingHttpHeaders;
|
|
616
|
+
}
|
|
617
|
+
/** Constants for the `deleteSecret` operation. */
|
|
618
|
+
namespace DeleteSecretConstants {
|
|
619
|
+
/** The secret type. */
|
|
620
|
+
enum SecretType {
|
|
621
|
+
ARBITRARY = "arbitrary",
|
|
622
|
+
USERNAME_PASSWORD = "username_password",
|
|
623
|
+
IAM_CREDENTIALS = "iam_credentials"
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
/** Parameters for the `getSecretMetadata` operation. */
|
|
627
|
+
interface GetSecretMetadataParams {
|
|
628
|
+
/** The secret type. */
|
|
629
|
+
secretType: GetSecretMetadataConstants.SecretType | string;
|
|
630
|
+
/** The v4 UUID that uniquely identifies the secret. */
|
|
631
|
+
id: string;
|
|
632
|
+
headers?: OutgoingHttpHeaders;
|
|
633
|
+
}
|
|
634
|
+
/** Constants for the `getSecretMetadata` operation. */
|
|
635
|
+
namespace GetSecretMetadataConstants {
|
|
636
|
+
/** The secret type. */
|
|
637
|
+
enum SecretType {
|
|
638
|
+
ARBITRARY = "arbitrary",
|
|
639
|
+
USERNAME_PASSWORD = "username_password",
|
|
640
|
+
IAM_CREDENTIALS = "iam_credentials"
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
/** Parameters for the `updateSecretMetadata` operation. */
|
|
644
|
+
interface UpdateSecretMetadataParams {
|
|
645
|
+
/** The secret type. */
|
|
646
|
+
secretType: UpdateSecretMetadataConstants.SecretType | string;
|
|
647
|
+
/** The v4 UUID that uniquely identifies the secret. */
|
|
648
|
+
id: string;
|
|
649
|
+
/** The metadata that describes the resource array. */
|
|
650
|
+
metadata: CollectionMetadata;
|
|
651
|
+
/** A collection of resources. */
|
|
652
|
+
resources: SecretMetadata[];
|
|
653
|
+
headers?: OutgoingHttpHeaders;
|
|
654
|
+
}
|
|
655
|
+
/** Constants for the `updateSecretMetadata` operation. */
|
|
656
|
+
namespace UpdateSecretMetadataConstants {
|
|
657
|
+
/** The secret type. */
|
|
658
|
+
enum SecretType {
|
|
659
|
+
ARBITRARY = "arbitrary",
|
|
660
|
+
USERNAME_PASSWORD = "username_password",
|
|
661
|
+
IAM_CREDENTIALS = "iam_credentials"
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
/*************************
|
|
665
|
+
* model interfaces
|
|
666
|
+
************************/
|
|
667
|
+
/** The metadata that describes the resource array. */
|
|
668
|
+
interface CollectionMetadata {
|
|
669
|
+
/** The type of resources in the resource array. */
|
|
670
|
+
collection_type: string;
|
|
671
|
+
/** The number of elements in the resource array. */
|
|
672
|
+
collection_total: number;
|
|
673
|
+
}
|
|
674
|
+
/** The base schema for creating secrets. */
|
|
675
|
+
interface CreateSecret {
|
|
676
|
+
/** The metadata that describes the resource array. */
|
|
677
|
+
metadata: CollectionMetadata;
|
|
678
|
+
/** A collection of resources. */
|
|
679
|
+
resources: SecretResource[];
|
|
680
|
+
}
|
|
681
|
+
/** EngineConfigOneOf. */
|
|
682
|
+
interface EngineConfigOneOf {
|
|
683
|
+
}
|
|
684
|
+
/** Configuration that is used to generate IAM credentials. */
|
|
685
|
+
interface GetConfig {
|
|
686
|
+
/** The metadata that describes the resource array. */
|
|
687
|
+
metadata: CollectionMetadata;
|
|
688
|
+
/** A collection of resources. */
|
|
689
|
+
resources: IAMSecretEngineRootConfig[];
|
|
690
|
+
}
|
|
691
|
+
/** The base schema for retrieving a secret. */
|
|
692
|
+
interface GetSecret {
|
|
693
|
+
/** The metadata that describes the resource array. */
|
|
694
|
+
metadata: CollectionMetadata;
|
|
695
|
+
/** A collection of resources. */
|
|
696
|
+
resources: SecretResource[];
|
|
697
|
+
}
|
|
698
|
+
/** GetSecretPoliciesOneOf. */
|
|
699
|
+
interface GetSecretPoliciesOneOf {
|
|
700
|
+
}
|
|
701
|
+
/** Properties that are associated with a rotation policy. */
|
|
702
|
+
interface GetSecretPoliciesOneOfGetSecretPolicyRotationResourcesItem {
|
|
703
|
+
/** The v4 UUID that uniquely identifies the policy. */
|
|
704
|
+
id: string;
|
|
705
|
+
/** The Cloud Resource Name (CRN) that uniquely identifies your cloud resources. */
|
|
706
|
+
crn?: string;
|
|
707
|
+
/** The date the policy was created. The date format follows RFC 3339. */
|
|
708
|
+
creation_date?: string;
|
|
709
|
+
/** The unique identifier for the entity that created the policy. */
|
|
710
|
+
created_by?: string;
|
|
711
|
+
/** Updates when the policy is replaced or modified. The date format follows RFC 3339. */
|
|
712
|
+
last_update_date?: string;
|
|
713
|
+
/** The unique identifier for the entity that updated the policy. */
|
|
714
|
+
updated_by?: string;
|
|
715
|
+
/** The MIME type that represents the policy. Currently, only the default is supported. */
|
|
716
|
+
type: string;
|
|
717
|
+
/** The secret rotation time interval. */
|
|
718
|
+
rotation: SecretPolicyRotationRotation;
|
|
719
|
+
}
|
|
720
|
+
/** Configuration that is used to generate IAM credentials. */
|
|
721
|
+
interface IAMSecretEngineRootConfig {
|
|
722
|
+
/** An IBM Cloud API key that has the capability to create and manage service IDs.
|
|
723
|
+
*
|
|
724
|
+
* The API key must be assigned the Editor platform role on the Access Groups Service and the Operator platform
|
|
725
|
+
* role on the IAM Identity Service. For more information, see [Enabling the IAM secrets
|
|
726
|
+
* engine](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secret-engines#configure-iam-engine).
|
|
727
|
+
*/
|
|
728
|
+
api_key: string;
|
|
729
|
+
/** The hash value of the IBM Cloud API key that is used to create and manage service IDs. */
|
|
730
|
+
api_key_hash?: string;
|
|
731
|
+
}
|
|
732
|
+
/** The base schema for listing secrets. */
|
|
733
|
+
interface ListSecrets {
|
|
734
|
+
/** The metadata that describes the resource array. */
|
|
735
|
+
metadata: CollectionMetadata;
|
|
736
|
+
/** A collection of resources. */
|
|
737
|
+
resources?: SecretResource[];
|
|
738
|
+
}
|
|
739
|
+
/** SecretActionOneOf. */
|
|
740
|
+
interface SecretActionOneOf {
|
|
741
|
+
}
|
|
742
|
+
/** The base schema definition for a secret group. */
|
|
743
|
+
interface SecretGroupDef {
|
|
744
|
+
/** The metadata that describes the resource array. */
|
|
745
|
+
metadata: CollectionMetadata;
|
|
746
|
+
/** A collection of resources. */
|
|
747
|
+
resources: SecretGroupResource[];
|
|
748
|
+
}
|
|
749
|
+
/** Metadata properties that describe a secret group. */
|
|
750
|
+
interface SecretGroupMetadataUpdatable {
|
|
751
|
+
/** A human-readable name to assign to your secret group.
|
|
752
|
+
*
|
|
753
|
+
* To protect your privacy, do not use personal data, such as your name or location, as a name for your secret
|
|
754
|
+
* group.
|
|
755
|
+
*/
|
|
756
|
+
name?: string;
|
|
757
|
+
/** An extended description of your secret group.
|
|
758
|
+
*
|
|
759
|
+
* To protect your privacy, do not use personal data, such as your name or location, as a description for your
|
|
760
|
+
* secret group.
|
|
761
|
+
*/
|
|
762
|
+
description?: string;
|
|
763
|
+
}
|
|
764
|
+
/** Properties that describe a secret group. */
|
|
765
|
+
interface SecretGroupResource {
|
|
766
|
+
/** The v4 UUID that uniquely identifies the secret group. */
|
|
767
|
+
id?: string;
|
|
768
|
+
/** A human-readable name to assign to your secret group.
|
|
769
|
+
*
|
|
770
|
+
* To protect your privacy, do not use personal data, such as your name or location, as a name for your secret
|
|
771
|
+
* group.
|
|
772
|
+
*/
|
|
773
|
+
name?: string;
|
|
774
|
+
/** An extended description of your secret group.
|
|
775
|
+
*
|
|
776
|
+
* To protect your privacy, do not use personal data, such as your name or location, as a description for your
|
|
777
|
+
* secret group.
|
|
778
|
+
*/
|
|
779
|
+
description?: string;
|
|
780
|
+
/** The date the secret group was created. The date format follows RFC 3339. */
|
|
781
|
+
creation_date?: string;
|
|
782
|
+
/** Updates when the metadata of the secret group is modified. The date format follows RFC 3339. */
|
|
783
|
+
last_update_date?: string;
|
|
784
|
+
/** The MIME type that represents the secret group. */
|
|
785
|
+
type?: string;
|
|
786
|
+
/** SecretGroupResource accepts additional properties. */
|
|
787
|
+
[propName: string]: any;
|
|
788
|
+
}
|
|
789
|
+
/** Metadata properties that describe a secret. */
|
|
790
|
+
interface SecretMetadata {
|
|
791
|
+
/** The unique ID of the secret. */
|
|
792
|
+
id?: string;
|
|
793
|
+
/** Labels that you can use to filter for secrets in your instance.
|
|
794
|
+
*
|
|
795
|
+
* Up to 30 labels can be created. Labels can be between 2-30 characters, including spaces. Special characters not
|
|
796
|
+
* permitted include the angled bracket, comma, colon, ampersand, and vertical pipe character (|).
|
|
797
|
+
*
|
|
798
|
+
* To protect your privacy, do not use personal data, such as your name or location, as a label for your secret.
|
|
799
|
+
*/
|
|
800
|
+
labels?: string[];
|
|
801
|
+
/** A human-readable alias to assign to your secret.
|
|
802
|
+
*
|
|
803
|
+
* To protect your privacy, do not use personal data, such as your name or location, as an alias for your secret.
|
|
804
|
+
*/
|
|
805
|
+
name: string;
|
|
806
|
+
/** An extended description of your secret.
|
|
807
|
+
*
|
|
808
|
+
* To protect your privacy, do not use personal data, such as your name or location, as a description for your
|
|
809
|
+
* secret.
|
|
810
|
+
*/
|
|
811
|
+
description?: string;
|
|
812
|
+
/** The v4 UUID that uniquely identifies the secret group to assign to this secret.
|
|
813
|
+
*
|
|
814
|
+
* If you omit this parameter, your secret is assigned to the `default` secret group.
|
|
815
|
+
*/
|
|
816
|
+
secret_group_id?: string;
|
|
817
|
+
/** The secret state based on NIST SP 800-57. States are integers and correspond to the Pre-activation = 0,
|
|
818
|
+
* Active = 1, Suspended = 2, Deactivated = 3, and Destroyed = 5 values.
|
|
819
|
+
*/
|
|
820
|
+
state?: number;
|
|
821
|
+
/** A text representation of the secret state. */
|
|
822
|
+
state_description?: string;
|
|
823
|
+
/** The secret type. */
|
|
824
|
+
secret_type?: string;
|
|
825
|
+
/** The date the secret material expires. The date format follows RFC 3339.
|
|
826
|
+
*
|
|
827
|
+
* You can set an expiration date on supported secret types at their creation. If you create a secret without
|
|
828
|
+
* specifying an expiration date, the secret does not expire. The `expiration_date` field is supported for the
|
|
829
|
+
* following secret types:
|
|
830
|
+
*
|
|
831
|
+
* - `arbitrary`
|
|
832
|
+
* - `username_password`.
|
|
833
|
+
*/
|
|
834
|
+
expiration_date?: string;
|
|
835
|
+
/** The time-to-live (TTL) or lease duration to assign to generated credentials.
|
|
836
|
+
*
|
|
837
|
+
* For `iam_credentials` secrets, the TTL defines for how long each generated API key remains valid. The value can
|
|
838
|
+
* be either an integer that specifies the number of seconds, or the string representation of a duration, such as
|
|
839
|
+
* `120m` or `24h`.
|
|
840
|
+
*/
|
|
841
|
+
ttl?: any;
|
|
842
|
+
/** For `iam_credentials` secrets, this field controls whether to use the same service ID and API key for future
|
|
843
|
+
* read operations on this secret. If set to `true`, the service reuses the current credentials. If set to `false`,
|
|
844
|
+
* a new service ID and API key is generated each time that the secret is read or accessed.
|
|
845
|
+
*/
|
|
846
|
+
reuse_api_key?: boolean;
|
|
847
|
+
/** The Cloud Resource Name (CRN) that uniquely identifies the resource. */
|
|
848
|
+
crn?: string;
|
|
849
|
+
/** The date the secret was created. The date format follows RFC 3339. */
|
|
850
|
+
creation_date?: string;
|
|
851
|
+
/** The unique identifier for the entity that created the secret. */
|
|
852
|
+
created_by?: string;
|
|
853
|
+
/** Updates when any part of the secret metadata is modified. The date format follows RFC 3339. */
|
|
854
|
+
last_update_date?: string;
|
|
855
|
+
}
|
|
856
|
+
/** The metadata of a secret. */
|
|
857
|
+
interface SecretMetadataRequest {
|
|
858
|
+
/** The metadata that describes the resource array. */
|
|
859
|
+
metadata: CollectionMetadata;
|
|
860
|
+
/** A collection of resources. */
|
|
861
|
+
resources: SecretMetadata[];
|
|
862
|
+
}
|
|
863
|
+
/** Properties that are associated with a rotation policy. */
|
|
864
|
+
interface SecretPolicyRotation {
|
|
865
|
+
/** The MIME type that represents the policy. Currently, only the default is supported. */
|
|
866
|
+
type: string;
|
|
867
|
+
/** The secret rotation time interval. */
|
|
868
|
+
rotation: SecretPolicyRotationRotation;
|
|
869
|
+
}
|
|
870
|
+
/** The secret rotation time interval. */
|
|
871
|
+
interface SecretPolicyRotationRotation {
|
|
872
|
+
/** Specifies the length of the secret rotation time interval. */
|
|
873
|
+
interval: number;
|
|
874
|
+
/** Specifies the units for the secret rotation time interval. */
|
|
875
|
+
unit: string;
|
|
876
|
+
}
|
|
877
|
+
/** SecretResource. */
|
|
878
|
+
interface SecretResource {
|
|
879
|
+
}
|
|
880
|
+
/** Properties that are associated with a specific secret version. */
|
|
881
|
+
interface SecretVersion {
|
|
882
|
+
/** The ID of the secret version. */
|
|
883
|
+
id?: string;
|
|
884
|
+
/** The date that the version of the secret was created. */
|
|
885
|
+
creation_date?: string;
|
|
886
|
+
/** The unique identifier for the entity that created the secret. */
|
|
887
|
+
created_by?: string;
|
|
888
|
+
/** Indicates whether the version of the secret was created by automatic rotation. */
|
|
889
|
+
auto_rotated?: boolean;
|
|
890
|
+
}
|
|
891
|
+
/** Configuration that is used to generate IAM credentials. */
|
|
892
|
+
interface EngineConfigOneOfIAMSecretEngineRootConfig extends EngineConfigOneOf {
|
|
893
|
+
/** An IBM Cloud API key that has the capability to create and manage service IDs.
|
|
894
|
+
*
|
|
895
|
+
* The API key must be assigned the Editor platform role on the Access Groups Service and the Operator platform
|
|
896
|
+
* role on the IAM Identity Service. For more information, see [Enabling the IAM secrets
|
|
897
|
+
* engine](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secret-engines#configure-iam-engine).
|
|
898
|
+
*/
|
|
899
|
+
api_key: string;
|
|
900
|
+
/** The hash value of the IBM Cloud API key that is used to create and manage service IDs. */
|
|
901
|
+
api_key_hash?: string;
|
|
902
|
+
}
|
|
903
|
+
/** The base schema for retrieving a policy that is associated with a secret. */
|
|
904
|
+
interface GetSecretPoliciesOneOfGetSecretPolicyRotation extends GetSecretPoliciesOneOf {
|
|
905
|
+
/** The metadata that describes the resource array. */
|
|
906
|
+
metadata: CollectionMetadata;
|
|
907
|
+
/** A collection of resources. */
|
|
908
|
+
resources: GetSecretPoliciesOneOfGetSecretPolicyRotationResourcesItem[];
|
|
909
|
+
}
|
|
910
|
+
/** Delete the credentials that are associated with an `iam_credentials` secret. */
|
|
911
|
+
interface SecretActionOneOfDeleteCredentialsForIAMSecret extends SecretActionOneOf {
|
|
912
|
+
/** The service ID that you want to delete. It is deleted together with its API key. */
|
|
913
|
+
service_id: string;
|
|
914
|
+
}
|
|
915
|
+
/** The request body of a `rotate` action. */
|
|
916
|
+
interface SecretActionOneOfRotateArbitrarySecretBody extends SecretActionOneOf {
|
|
917
|
+
/** The new secret data to assign to an `arbitrary` secret. */
|
|
918
|
+
payload: string;
|
|
919
|
+
}
|
|
920
|
+
/** The request body of a `rotate` action. */
|
|
921
|
+
interface SecretActionOneOfRotateUsernamePasswordSecretBody extends SecretActionOneOf {
|
|
922
|
+
/** The new password to assign to a `username_password` secret. */
|
|
923
|
+
password: string;
|
|
924
|
+
}
|
|
925
|
+
/** The base schema for secrets. */
|
|
926
|
+
interface SecretResourceArbitrarySecretResource extends SecretResource {
|
|
927
|
+
/** The MIME type that represents the secret. */
|
|
928
|
+
type?: string;
|
|
929
|
+
/** The v4 UUID that uniquely identifies the secret. */
|
|
930
|
+
id?: string;
|
|
931
|
+
/** A human-readable alias to assign to your secret.
|
|
932
|
+
*
|
|
933
|
+
* To protect your privacy, do not use personal data, such as your name or location, as an alias for your secret.
|
|
934
|
+
*/
|
|
935
|
+
name: string;
|
|
936
|
+
/** An extended description of your secret.
|
|
937
|
+
*
|
|
938
|
+
* To protect your privacy, do not use personal data, such as your name or location, as a description for your
|
|
939
|
+
* secret.
|
|
940
|
+
*/
|
|
941
|
+
description?: string;
|
|
942
|
+
/** The v4 UUID that uniquely identifies the secret group to assign to this secret.
|
|
943
|
+
*
|
|
944
|
+
* If you omit this parameter, your secret is assigned to the `default` secret group.
|
|
945
|
+
*/
|
|
946
|
+
secret_group_id?: string;
|
|
947
|
+
/** Labels that you can use to filter for secrets in your instance.
|
|
948
|
+
*
|
|
949
|
+
* Up to 30 labels can be created. Labels can be between 2-30 characters, including spaces. Special characters not
|
|
950
|
+
* permitted include the angled bracket, comma, colon, ampersand, and vertical pipe character (|).
|
|
951
|
+
*
|
|
952
|
+
* To protect your privacy, do not use personal data, such as your name or location, as a label for your secret.
|
|
953
|
+
*/
|
|
954
|
+
labels?: string[];
|
|
955
|
+
/** The secret state based on NIST SP 800-57. States are integers and correspond to the Pre-activation = 0,
|
|
956
|
+
* Active = 1, Suspended = 2, Deactivated = 3, and Destroyed = 5 values.
|
|
957
|
+
*/
|
|
958
|
+
state?: number;
|
|
959
|
+
/** A text representation of the secret state. */
|
|
960
|
+
state_description?: string;
|
|
961
|
+
/** The secret type. */
|
|
962
|
+
secret_type?: string;
|
|
963
|
+
/** The Cloud Resource Name (CRN) that uniquely identifies your Secrets Manager resource. */
|
|
964
|
+
crn?: string;
|
|
965
|
+
/** The date the secret was created. The date format follows RFC 3339. */
|
|
966
|
+
creation_date?: string;
|
|
967
|
+
/** The unique identifier for the entity that created the secret. */
|
|
968
|
+
created_by?: string;
|
|
969
|
+
/** Updates when the actual secret is modified. The date format follows RFC 3339. */
|
|
970
|
+
last_update_date?: string;
|
|
971
|
+
/** An array that contains metadata for each secret version. */
|
|
972
|
+
versions?: SecretVersion[];
|
|
973
|
+
/** The date the secret material expires. The date format follows RFC 3339.
|
|
974
|
+
*
|
|
975
|
+
* You can set an expiration date on supported secret types at their creation. If you create a secret without
|
|
976
|
+
* specifying an expiration date, the secret does not expire. The `expiration_date` field is supported for the
|
|
977
|
+
* following secret types:
|
|
978
|
+
*
|
|
979
|
+
* - `arbitrary`
|
|
980
|
+
* - `username_password`.
|
|
981
|
+
*/
|
|
982
|
+
expiration_date?: string;
|
|
983
|
+
/** The new secret data to assign to an `arbitrary` secret. */
|
|
984
|
+
payload?: string;
|
|
985
|
+
secret_data?: JsonObject;
|
|
986
|
+
}
|
|
987
|
+
/** The base schema for secrets. */
|
|
988
|
+
interface SecretResourceIAMSecretResource extends SecretResource {
|
|
989
|
+
/** The MIME type that represents the secret. */
|
|
990
|
+
type?: string;
|
|
991
|
+
/** The v4 UUID that uniquely identifies the secret. */
|
|
992
|
+
id?: string;
|
|
993
|
+
/** A human-readable alias to assign to your secret.
|
|
994
|
+
*
|
|
995
|
+
* To protect your privacy, do not use personal data, such as your name or location, as an alias for your secret.
|
|
996
|
+
*/
|
|
997
|
+
name: string;
|
|
998
|
+
/** An extended description of your secret.
|
|
999
|
+
*
|
|
1000
|
+
* To protect your privacy, do not use personal data, such as your name or location, as a description for your
|
|
1001
|
+
* secret.
|
|
1002
|
+
*/
|
|
1003
|
+
description?: string;
|
|
1004
|
+
/** The v4 UUID that uniquely identifies the secret group to assign to this secret.
|
|
1005
|
+
*
|
|
1006
|
+
* If you omit this parameter, your secret is assigned to the `default` secret group.
|
|
1007
|
+
*/
|
|
1008
|
+
secret_group_id?: string;
|
|
1009
|
+
/** Labels that you can use to filter for secrets in your instance.
|
|
1010
|
+
*
|
|
1011
|
+
* Up to 30 labels can be created. Labels can be between 2-30 characters, including spaces. Special characters not
|
|
1012
|
+
* permitted include the angled bracket, comma, colon, ampersand, and vertical pipe character (|).
|
|
1013
|
+
*
|
|
1014
|
+
* To protect your privacy, do not use personal data, such as your name or location, as a label for your secret.
|
|
1015
|
+
*/
|
|
1016
|
+
labels?: string[];
|
|
1017
|
+
/** The secret state based on NIST SP 800-57. States are integers and correspond to the Pre-activation = 0,
|
|
1018
|
+
* Active = 1, Suspended = 2, Deactivated = 3, and Destroyed = 5 values.
|
|
1019
|
+
*/
|
|
1020
|
+
state?: number;
|
|
1021
|
+
/** A text representation of the secret state. */
|
|
1022
|
+
state_description?: string;
|
|
1023
|
+
/** The secret type. */
|
|
1024
|
+
secret_type?: string;
|
|
1025
|
+
/** The Cloud Resource Name (CRN) that uniquely identifies your Secrets Manager resource. */
|
|
1026
|
+
crn?: string;
|
|
1027
|
+
/** The date the secret was created. The date format follows RFC 3339. */
|
|
1028
|
+
creation_date?: string;
|
|
1029
|
+
/** The unique identifier for the entity that created the secret. */
|
|
1030
|
+
created_by?: string;
|
|
1031
|
+
/** Updates when the actual secret is modified. The date format follows RFC 3339. */
|
|
1032
|
+
last_update_date?: string;
|
|
1033
|
+
/** An array that contains metadata for each secret version. */
|
|
1034
|
+
versions?: SecretVersion[];
|
|
1035
|
+
/** The time-to-live (TTL) or lease duration to assign to generated credentials.
|
|
1036
|
+
*
|
|
1037
|
+
* For `iam_credentials` secrets, the TTL defines for how long each generated API key remains valid. The value can
|
|
1038
|
+
* be either an integer that specifies the number of seconds, or the string representation of a duration, such as
|
|
1039
|
+
* `120m` or `24h`.
|
|
1040
|
+
*/
|
|
1041
|
+
ttl?: any;
|
|
1042
|
+
/** The access groups that define the capabilities of the service ID and API key that are generated for an
|
|
1043
|
+
* `iam_credentials` secret.
|
|
1044
|
+
*
|
|
1045
|
+
* **Tip:** To find the ID of an access group, go to **Manage > Access (IAM) > Access groups** in the IBM Cloud
|
|
1046
|
+
* console. Select the access group to inspect, and click **Details** to view its ID.
|
|
1047
|
+
*/
|
|
1048
|
+
access_groups?: string[];
|
|
1049
|
+
/** The API key that is generated for this secret.
|
|
1050
|
+
*
|
|
1051
|
+
* After the secret reaches the end of its lease (see the `ttl` field), the API key is deleted automatically. If
|
|
1052
|
+
* you want to continue to use the same API key for future read operations, see the `reuse_api_key` field.
|
|
1053
|
+
*/
|
|
1054
|
+
api_key?: string;
|
|
1055
|
+
/** The service ID under which the API key (see the `api_key` field) is created. This service ID is added to the
|
|
1056
|
+
* access groups that you assign for this secret.
|
|
1057
|
+
*/
|
|
1058
|
+
service_id?: string;
|
|
1059
|
+
/** Set to `true` to reuse the service ID and API key for this secret.
|
|
1060
|
+
*
|
|
1061
|
+
* Use this field to control whether to use the same service ID and API key for future read operations on this
|
|
1062
|
+
* secret. If set to `true`, the service reuses the current credentials. If set to `false`, a new service ID and
|
|
1063
|
+
* API key is generated each time that the secret is read or accessed.
|
|
1064
|
+
*/
|
|
1065
|
+
reuse_api_key?: boolean;
|
|
1066
|
+
}
|
|
1067
|
+
/** The base schema for secrets. */
|
|
1068
|
+
interface SecretResourceUsernamePasswordSecretResource extends SecretResource {
|
|
1069
|
+
/** The MIME type that represents the secret. */
|
|
1070
|
+
type?: string;
|
|
1071
|
+
/** The v4 UUID that uniquely identifies the secret. */
|
|
1072
|
+
id?: string;
|
|
1073
|
+
/** A human-readable alias to assign to your secret.
|
|
1074
|
+
*
|
|
1075
|
+
* To protect your privacy, do not use personal data, such as your name or location, as an alias for your secret.
|
|
1076
|
+
*/
|
|
1077
|
+
name: string;
|
|
1078
|
+
/** An extended description of your secret.
|
|
1079
|
+
*
|
|
1080
|
+
* To protect your privacy, do not use personal data, such as your name or location, as a description for your
|
|
1081
|
+
* secret.
|
|
1082
|
+
*/
|
|
1083
|
+
description?: string;
|
|
1084
|
+
/** The v4 UUID that uniquely identifies the secret group to assign to this secret.
|
|
1085
|
+
*
|
|
1086
|
+
* If you omit this parameter, your secret is assigned to the `default` secret group.
|
|
1087
|
+
*/
|
|
1088
|
+
secret_group_id?: string;
|
|
1089
|
+
/** Labels that you can use to filter for secrets in your instance.
|
|
1090
|
+
*
|
|
1091
|
+
* Up to 30 labels can be created. Labels can be between 2-30 characters, including spaces. Special characters not
|
|
1092
|
+
* permitted include the angled bracket, comma, colon, ampersand, and vertical pipe character (|).
|
|
1093
|
+
*
|
|
1094
|
+
* To protect your privacy, do not use personal data, such as your name or location, as a label for your secret.
|
|
1095
|
+
*/
|
|
1096
|
+
labels?: string[];
|
|
1097
|
+
/** The secret state based on NIST SP 800-57. States are integers and correspond to the Pre-activation = 0,
|
|
1098
|
+
* Active = 1, Suspended = 2, Deactivated = 3, and Destroyed = 5 values.
|
|
1099
|
+
*/
|
|
1100
|
+
state?: number;
|
|
1101
|
+
/** A text representation of the secret state. */
|
|
1102
|
+
state_description?: string;
|
|
1103
|
+
/** The secret type. */
|
|
1104
|
+
secret_type?: string;
|
|
1105
|
+
/** The Cloud Resource Name (CRN) that uniquely identifies your Secrets Manager resource. */
|
|
1106
|
+
crn?: string;
|
|
1107
|
+
/** The date the secret was created. The date format follows RFC 3339. */
|
|
1108
|
+
creation_date?: string;
|
|
1109
|
+
/** The unique identifier for the entity that created the secret. */
|
|
1110
|
+
created_by?: string;
|
|
1111
|
+
/** Updates when the actual secret is modified. The date format follows RFC 3339. */
|
|
1112
|
+
last_update_date?: string;
|
|
1113
|
+
/** An array that contains metadata for each secret version. */
|
|
1114
|
+
versions?: SecretVersion[];
|
|
1115
|
+
/** The username to assign to this secret. */
|
|
1116
|
+
username?: string;
|
|
1117
|
+
/** The password to assign to this secret. */
|
|
1118
|
+
password?: string;
|
|
1119
|
+
secret_data?: JsonObject;
|
|
1120
|
+
/** The date the secret material expires. The date format follows RFC 3339.
|
|
1121
|
+
*
|
|
1122
|
+
* You can set an expiration date on supported secret types at their creation. If you create a secret without
|
|
1123
|
+
* specifying an expiration date, the secret does not expire. The `expiration_date` field is supported for the
|
|
1124
|
+
* following secret types:
|
|
1125
|
+
*
|
|
1126
|
+
* - `arbitrary`
|
|
1127
|
+
* - `username_password`.
|
|
1128
|
+
*/
|
|
1129
|
+
expiration_date?: string;
|
|
1130
|
+
/** The date that the secret is scheduled for automatic rotation.
|
|
1131
|
+
*
|
|
1132
|
+
* The service automatically creates a new version of the secret on its next rotation date. This field exists only
|
|
1133
|
+
* for secrets that can be auto-rotated and have an existing rotation policy.
|
|
1134
|
+
*/
|
|
1135
|
+
next_rotation_date?: string;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
export = SecretsManagerV1;
|