@ibm-cloud/secrets-manager 1.0.2 → 1.0.3
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/package.json +7 -8
- package/secrets-manager/v1.d.ts +487 -156
- package/secrets-manager/v1.js +206 -101
- package/secrets-manager/v1.js.map +1 -1
package/secrets-manager/v1.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* (C) Copyright IBM Corp.
|
|
3
|
+
* (C) Copyright IBM Corp. 2022.
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -39,15 +39,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
39
39
|
return __assign.apply(this, arguments);
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
42
|
-
* IBM OpenAPI SDK Code Generator Version: 3.
|
|
42
|
+
* IBM OpenAPI SDK Code Generator Version: 3.44.0-98838c07-20220128-151531
|
|
43
43
|
*/
|
|
44
44
|
var extend = require("extend");
|
|
45
45
|
var ibm_cloud_sdk_core_1 = require("ibm-cloud-sdk-core");
|
|
46
46
|
var common_1 = require("../lib/common");
|
|
47
47
|
/**
|
|
48
48
|
* With IBM Cloud® Secrets Manager, you can create, lease, and centrally manage secrets that are used in IBM Cloud
|
|
49
|
-
* services or your custom-built applications. Secrets are stored in a dedicated instance of Secrets Manager,
|
|
50
|
-
* open source HashiCorp Vault.
|
|
49
|
+
* services or your custom-built applications. Secrets are stored in a dedicated instance of Secrets Manager, which is
|
|
50
|
+
* built on open source HashiCorp Vault.
|
|
51
51
|
*
|
|
52
52
|
* API Version: 1.0.0
|
|
53
53
|
* See: https://cloud.ibm.com/docs/secrets-manager
|
|
@@ -123,10 +123,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
123
123
|
*/
|
|
124
124
|
SecretsManagerV1.prototype.createSecretGroup = function (params) {
|
|
125
125
|
var _params = __assign({}, params);
|
|
126
|
-
var
|
|
127
|
-
var
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
var _requiredParams = ['metadata', 'resources'];
|
|
127
|
+
var _validParams = ['metadata', 'resources', 'headers'];
|
|
128
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
129
|
+
if (_validationErrors) {
|
|
130
|
+
return Promise.reject(_validationErrors);
|
|
130
131
|
}
|
|
131
132
|
var body = {
|
|
132
133
|
'metadata': _params.metadata,
|
|
@@ -159,6 +160,12 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
159
160
|
*/
|
|
160
161
|
SecretsManagerV1.prototype.listSecretGroups = function (params) {
|
|
161
162
|
var _params = __assign({}, params);
|
|
163
|
+
var _requiredParams = [];
|
|
164
|
+
var _validParams = ['headers'];
|
|
165
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
166
|
+
if (_validationErrors) {
|
|
167
|
+
return Promise.reject(_validationErrors);
|
|
168
|
+
}
|
|
162
169
|
var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'listSecretGroups');
|
|
163
170
|
var parameters = {
|
|
164
171
|
options: {
|
|
@@ -185,10 +192,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
185
192
|
*/
|
|
186
193
|
SecretsManagerV1.prototype.getSecretGroup = function (params) {
|
|
187
194
|
var _params = __assign({}, params);
|
|
188
|
-
var
|
|
189
|
-
var
|
|
190
|
-
|
|
191
|
-
|
|
195
|
+
var _requiredParams = ['id'];
|
|
196
|
+
var _validParams = ['id', 'headers'];
|
|
197
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
198
|
+
if (_validationErrors) {
|
|
199
|
+
return Promise.reject(_validationErrors);
|
|
192
200
|
}
|
|
193
201
|
var path = {
|
|
194
202
|
'id': _params.id,
|
|
@@ -222,10 +230,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
222
230
|
*/
|
|
223
231
|
SecretsManagerV1.prototype.updateSecretGroupMetadata = function (params) {
|
|
224
232
|
var _params = __assign({}, params);
|
|
225
|
-
var
|
|
226
|
-
var
|
|
227
|
-
|
|
228
|
-
|
|
233
|
+
var _requiredParams = ['id', 'metadata', 'resources'];
|
|
234
|
+
var _validParams = ['id', 'metadata', 'resources', 'headers'];
|
|
235
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
236
|
+
if (_validationErrors) {
|
|
237
|
+
return Promise.reject(_validationErrors);
|
|
229
238
|
}
|
|
230
239
|
var body = {
|
|
231
240
|
'metadata': _params.metadata,
|
|
@@ -266,10 +275,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
266
275
|
*/
|
|
267
276
|
SecretsManagerV1.prototype.deleteSecretGroup = function (params) {
|
|
268
277
|
var _params = __assign({}, params);
|
|
269
|
-
var
|
|
270
|
-
var
|
|
271
|
-
|
|
272
|
-
|
|
278
|
+
var _requiredParams = ['id'];
|
|
279
|
+
var _validParams = ['id', 'headers'];
|
|
280
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
281
|
+
if (_validationErrors) {
|
|
282
|
+
return Promise.reject(_validationErrors);
|
|
273
283
|
}
|
|
274
284
|
var path = {
|
|
275
285
|
'id': _params.id,
|
|
@@ -293,7 +303,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
293
303
|
/**
|
|
294
304
|
* Create a secret.
|
|
295
305
|
*
|
|
296
|
-
*
|
|
306
|
+
* Create a secret or import an existing value that you can use to access or authenticate to a protected resource.
|
|
297
307
|
*
|
|
298
308
|
* Use this method to either generate or import an existing secret, such as an arbitrary value or a TLS certificate,
|
|
299
309
|
* that you can manage in your Secrets Manager service instance. A successful request stores the secret in your
|
|
@@ -312,10 +322,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
312
322
|
*/
|
|
313
323
|
SecretsManagerV1.prototype.createSecret = function (params) {
|
|
314
324
|
var _params = __assign({}, params);
|
|
315
|
-
var
|
|
316
|
-
var
|
|
317
|
-
|
|
318
|
-
|
|
325
|
+
var _requiredParams = ['secretType', 'metadata', 'resources'];
|
|
326
|
+
var _validParams = ['secretType', 'metadata', 'resources', 'headers'];
|
|
327
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
328
|
+
if (_validationErrors) {
|
|
329
|
+
return Promise.reject(_validationErrors);
|
|
319
330
|
}
|
|
320
331
|
var body = {
|
|
321
332
|
'metadata': _params.metadata,
|
|
@@ -364,10 +375,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
364
375
|
*/
|
|
365
376
|
SecretsManagerV1.prototype.listSecrets = function (params) {
|
|
366
377
|
var _params = __assign({}, params);
|
|
367
|
-
var
|
|
368
|
-
var
|
|
369
|
-
|
|
370
|
-
|
|
378
|
+
var _requiredParams = ['secretType'];
|
|
379
|
+
var _validParams = ['secretType', 'limit', 'offset', 'headers'];
|
|
380
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
381
|
+
if (_validationErrors) {
|
|
382
|
+
return Promise.reject(_validationErrors);
|
|
371
383
|
}
|
|
372
384
|
var query = {
|
|
373
385
|
'limit': _params.limit,
|
|
@@ -430,6 +442,12 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
430
442
|
*/
|
|
431
443
|
SecretsManagerV1.prototype.listAllSecrets = function (params) {
|
|
432
444
|
var _params = __assign({}, params);
|
|
445
|
+
var _requiredParams = [];
|
|
446
|
+
var _validParams = ['limit', 'offset', 'search', 'sortBy', 'groups', 'headers'];
|
|
447
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
448
|
+
if (_validationErrors) {
|
|
449
|
+
return Promise.reject(_validationErrors);
|
|
450
|
+
}
|
|
433
451
|
var query = {
|
|
434
452
|
'limit': _params.limit,
|
|
435
453
|
'offset': _params.offset,
|
|
@@ -455,7 +473,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
455
473
|
/**
|
|
456
474
|
* Get a secret.
|
|
457
475
|
*
|
|
458
|
-
*
|
|
476
|
+
* Get a secret and its details by specifying the ID of the secret.
|
|
459
477
|
*
|
|
460
478
|
* A successful request returns the secret data that is associated with your secret, along with other metadata. To
|
|
461
479
|
* view only the details of a specified secret without retrieving its value, use the [Get secret
|
|
@@ -469,10 +487,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
469
487
|
*/
|
|
470
488
|
SecretsManagerV1.prototype.getSecret = function (params) {
|
|
471
489
|
var _params = __assign({}, params);
|
|
472
|
-
var
|
|
473
|
-
var
|
|
474
|
-
|
|
475
|
-
|
|
490
|
+
var _requiredParams = ['secretType', 'id'];
|
|
491
|
+
var _validParams = ['secretType', 'id', 'headers'];
|
|
492
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
493
|
+
if (_validationErrors) {
|
|
494
|
+
return Promise.reject(_validationErrors);
|
|
476
495
|
}
|
|
477
496
|
var path = {
|
|
478
497
|
'secret_type': _params.secretType,
|
|
@@ -498,23 +517,25 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
498
517
|
*
|
|
499
518
|
* Invokes an action on a specified secret. This method supports the following actions:
|
|
500
519
|
*
|
|
501
|
-
* - `rotate`: Replace the value of
|
|
520
|
+
* - `rotate`: Replace the value of a secret.
|
|
521
|
+
* - `restore`: Restore a previous version of an `iam_credentials` secret.
|
|
502
522
|
* - `delete_credentials`: Delete the API key that is associated with an `iam_credentials` secret.
|
|
503
523
|
*
|
|
504
524
|
* @param {Object} params - The parameters to send to the service.
|
|
505
525
|
* @param {string} params.secretType - The secret type.
|
|
506
526
|
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
507
527
|
* @param {string} params.action - The action to perform on the specified secret.
|
|
508
|
-
* @param {SecretAction} params.secretAction - The properties to update for the secret.
|
|
528
|
+
* @param {SecretAction} [params.secretAction] - The properties to update for the secret.
|
|
509
529
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
510
530
|
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecret>>}
|
|
511
531
|
*/
|
|
512
532
|
SecretsManagerV1.prototype.updateSecret = function (params) {
|
|
513
533
|
var _params = __assign({}, params);
|
|
514
|
-
var
|
|
515
|
-
var
|
|
516
|
-
|
|
517
|
-
|
|
534
|
+
var _requiredParams = ['secretType', 'id', 'action'];
|
|
535
|
+
var _validParams = ['secretType', 'id', 'action', 'secretAction', 'headers'];
|
|
536
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
537
|
+
if (_validationErrors) {
|
|
538
|
+
return Promise.reject(_validationErrors);
|
|
518
539
|
}
|
|
519
540
|
var body = _params.secretAction;
|
|
520
541
|
var query = {
|
|
@@ -555,10 +576,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
555
576
|
*/
|
|
556
577
|
SecretsManagerV1.prototype.deleteSecret = function (params) {
|
|
557
578
|
var _params = __assign({}, params);
|
|
558
|
-
var
|
|
559
|
-
var
|
|
560
|
-
|
|
561
|
-
|
|
579
|
+
var _requiredParams = ['secretType', 'id'];
|
|
580
|
+
var _validParams = ['secretType', 'id', 'headers'];
|
|
581
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
582
|
+
if (_validationErrors) {
|
|
583
|
+
return Promise.reject(_validationErrors);
|
|
562
584
|
}
|
|
563
585
|
var path = {
|
|
564
586
|
'secret_type': _params.secretType,
|
|
@@ -577,6 +599,46 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
577
599
|
};
|
|
578
600
|
return this.createRequest(parameters);
|
|
579
601
|
};
|
|
602
|
+
/**
|
|
603
|
+
* List versions of a secret.
|
|
604
|
+
*
|
|
605
|
+
* Retrieves a list of the versions of a secret.
|
|
606
|
+
*
|
|
607
|
+
* A successful request returns the list of the versions along with the metadata of each version.
|
|
608
|
+
*
|
|
609
|
+
* @param {Object} params - The parameters to send to the service.
|
|
610
|
+
* @param {string} params.secretType - The secret type.
|
|
611
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
612
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
613
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecretVersions>>}
|
|
614
|
+
*/
|
|
615
|
+
SecretsManagerV1.prototype.listSecretVersions = function (params) {
|
|
616
|
+
var _params = __assign({}, params);
|
|
617
|
+
var _requiredParams = ['secretType', 'id'];
|
|
618
|
+
var _validParams = ['secretType', 'id', 'headers'];
|
|
619
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
620
|
+
if (_validationErrors) {
|
|
621
|
+
return Promise.reject(_validationErrors);
|
|
622
|
+
}
|
|
623
|
+
var path = {
|
|
624
|
+
'secret_type': _params.secretType,
|
|
625
|
+
'id': _params.id,
|
|
626
|
+
};
|
|
627
|
+
var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'listSecretVersions');
|
|
628
|
+
var parameters = {
|
|
629
|
+
options: {
|
|
630
|
+
url: '/api/v1/secrets/{secret_type}/{id}/versions',
|
|
631
|
+
method: 'GET',
|
|
632
|
+
path: path,
|
|
633
|
+
},
|
|
634
|
+
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
635
|
+
headers: extend(true, sdkHeaders, {
|
|
636
|
+
'Accept': 'application/json',
|
|
637
|
+
}, _params.headers),
|
|
638
|
+
}),
|
|
639
|
+
};
|
|
640
|
+
return this.createRequest(parameters);
|
|
641
|
+
};
|
|
580
642
|
/**
|
|
581
643
|
* Get a version of a secret.
|
|
582
644
|
*
|
|
@@ -598,10 +660,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
598
660
|
*/
|
|
599
661
|
SecretsManagerV1.prototype.getSecretVersion = function (params) {
|
|
600
662
|
var _params = __assign({}, params);
|
|
601
|
-
var
|
|
602
|
-
var
|
|
603
|
-
|
|
604
|
-
|
|
663
|
+
var _requiredParams = ['secretType', 'id', 'versionId'];
|
|
664
|
+
var _validParams = ['secretType', 'id', 'versionId', 'headers'];
|
|
665
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
666
|
+
if (_validationErrors) {
|
|
667
|
+
return Promise.reject(_validationErrors);
|
|
605
668
|
}
|
|
606
669
|
var path = {
|
|
607
670
|
'secret_type': _params.secretType,
|
|
@@ -643,10 +706,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
643
706
|
*/
|
|
644
707
|
SecretsManagerV1.prototype.getSecretVersionMetadata = function (params) {
|
|
645
708
|
var _params = __assign({}, params);
|
|
646
|
-
var
|
|
647
|
-
var
|
|
648
|
-
|
|
649
|
-
|
|
709
|
+
var _requiredParams = ['secretType', 'id', 'versionId'];
|
|
710
|
+
var _validParams = ['secretType', 'id', 'versionId', 'headers'];
|
|
711
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
712
|
+
if (_validationErrors) {
|
|
713
|
+
return Promise.reject(_validationErrors);
|
|
650
714
|
}
|
|
651
715
|
var path = {
|
|
652
716
|
'secret_type': _params.secretType,
|
|
@@ -684,10 +748,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
684
748
|
*/
|
|
685
749
|
SecretsManagerV1.prototype.getSecretMetadata = function (params) {
|
|
686
750
|
var _params = __assign({}, params);
|
|
687
|
-
var
|
|
688
|
-
var
|
|
689
|
-
|
|
690
|
-
|
|
751
|
+
var _requiredParams = ['secretType', 'id'];
|
|
752
|
+
var _validParams = ['secretType', 'id', 'headers'];
|
|
753
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
754
|
+
if (_validationErrors) {
|
|
755
|
+
return Promise.reject(_validationErrors);
|
|
691
756
|
}
|
|
692
757
|
var path = {
|
|
693
758
|
'secret_type': _params.secretType,
|
|
@@ -726,10 +791,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
726
791
|
*/
|
|
727
792
|
SecretsManagerV1.prototype.updateSecretMetadata = function (params) {
|
|
728
793
|
var _params = __assign({}, params);
|
|
729
|
-
var
|
|
730
|
-
var
|
|
731
|
-
|
|
732
|
-
|
|
794
|
+
var _requiredParams = ['secretType', 'id', 'metadata', 'resources'];
|
|
795
|
+
var _validParams = ['secretType', 'id', 'metadata', 'resources', 'headers'];
|
|
796
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
797
|
+
if (_validationErrors) {
|
|
798
|
+
return Promise.reject(_validationErrors);
|
|
733
799
|
}
|
|
734
800
|
var body = {
|
|
735
801
|
'metadata': _params.metadata,
|
|
@@ -777,10 +843,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
777
843
|
*/
|
|
778
844
|
SecretsManagerV1.prototype.putPolicy = function (params) {
|
|
779
845
|
var _params = __assign({}, params);
|
|
780
|
-
var
|
|
781
|
-
var
|
|
782
|
-
|
|
783
|
-
|
|
846
|
+
var _requiredParams = ['secretType', 'id', 'metadata', 'resources'];
|
|
847
|
+
var _validParams = ['secretType', 'id', 'metadata', 'resources', 'policy', 'headers'];
|
|
848
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
849
|
+
if (_validationErrors) {
|
|
850
|
+
return Promise.reject(_validationErrors);
|
|
784
851
|
}
|
|
785
852
|
var body = {
|
|
786
853
|
'metadata': _params.metadata,
|
|
@@ -825,10 +892,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
825
892
|
*/
|
|
826
893
|
SecretsManagerV1.prototype.getPolicy = function (params) {
|
|
827
894
|
var _params = __assign({}, params);
|
|
828
|
-
var
|
|
829
|
-
var
|
|
830
|
-
|
|
831
|
-
|
|
895
|
+
var _requiredParams = ['secretType', 'id'];
|
|
896
|
+
var _validParams = ['secretType', 'id', 'policy', 'headers'];
|
|
897
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
898
|
+
if (_validationErrors) {
|
|
899
|
+
return Promise.reject(_validationErrors);
|
|
832
900
|
}
|
|
833
901
|
var query = {
|
|
834
902
|
'policy': _params.policy,
|
|
@@ -866,17 +934,18 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
866
934
|
* configuration](#create_config_element) method.
|
|
867
935
|
*
|
|
868
936
|
* @param {Object} params - The parameters to send to the service.
|
|
869
|
-
* @param {string} params.secretType -
|
|
937
|
+
* @param {string} params.secretType - The secret type.
|
|
870
938
|
* @param {EngineConfig} params.engineConfig - Properties to update for a secrets engine.
|
|
871
939
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
872
940
|
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.Empty>>}
|
|
873
941
|
*/
|
|
874
942
|
SecretsManagerV1.prototype.putConfig = function (params) {
|
|
875
943
|
var _params = __assign({}, params);
|
|
876
|
-
var
|
|
877
|
-
var
|
|
878
|
-
|
|
879
|
-
|
|
944
|
+
var _requiredParams = ['secretType', 'engineConfig'];
|
|
945
|
+
var _validParams = ['secretType', 'engineConfig', 'headers'];
|
|
946
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
947
|
+
if (_validationErrors) {
|
|
948
|
+
return Promise.reject(_validationErrors);
|
|
880
949
|
}
|
|
881
950
|
var body = _params.engineConfig;
|
|
882
951
|
var path = {
|
|
@@ -910,10 +979,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
910
979
|
*/
|
|
911
980
|
SecretsManagerV1.prototype.getConfig = function (params) {
|
|
912
981
|
var _params = __assign({}, params);
|
|
913
|
-
var
|
|
914
|
-
var
|
|
915
|
-
|
|
916
|
-
|
|
982
|
+
var _requiredParams = ['secretType'];
|
|
983
|
+
var _validParams = ['secretType', 'headers'];
|
|
984
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
985
|
+
if (_validationErrors) {
|
|
986
|
+
return Promise.reject(_validationErrors);
|
|
917
987
|
}
|
|
918
988
|
var path = {
|
|
919
989
|
'secret_type': _params.secretType,
|
|
@@ -938,7 +1008,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
938
1008
|
*
|
|
939
1009
|
* Adds a configuration element to the specified secret type.
|
|
940
1010
|
*
|
|
941
|
-
* Use this method to define the configurations that are required to enable the
|
|
1011
|
+
* Use this method to define the configurations that are required to enable the public certificates (`public_cert`)
|
|
942
1012
|
* engine. You can add up to 10 certificate authority and DNS provider configurations for your instance.
|
|
943
1013
|
*
|
|
944
1014
|
* @param {Object} params - The parameters to send to the service.
|
|
@@ -947,16 +1017,17 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
947
1017
|
* @param {string} params.name - The human-readable name to assign to your configuration.
|
|
948
1018
|
* @param {string} params.type - The type of configuration. Value options differ depending on the `config_element`
|
|
949
1019
|
* property that you want to define.
|
|
950
|
-
* @param {
|
|
1020
|
+
* @param {JsonObject} params.config - The configuration to define for the specified secret type.
|
|
951
1021
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
952
1022
|
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSingleConfigElement>>}
|
|
953
1023
|
*/
|
|
954
1024
|
SecretsManagerV1.prototype.createConfigElement = function (params) {
|
|
955
1025
|
var _params = __assign({}, params);
|
|
956
|
-
var
|
|
957
|
-
var
|
|
958
|
-
|
|
959
|
-
|
|
1026
|
+
var _requiredParams = ['secretType', 'configElement', 'name', 'type', 'config'];
|
|
1027
|
+
var _validParams = ['secretType', 'configElement', 'name', 'type', 'config', 'headers'];
|
|
1028
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
1029
|
+
if (_validationErrors) {
|
|
1030
|
+
return Promise.reject(_validationErrors);
|
|
960
1031
|
}
|
|
961
1032
|
var body = {
|
|
962
1033
|
'name': _params.name,
|
|
@@ -997,10 +1068,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
997
1068
|
*/
|
|
998
1069
|
SecretsManagerV1.prototype.getConfigElements = function (params) {
|
|
999
1070
|
var _params = __assign({}, params);
|
|
1000
|
-
var
|
|
1001
|
-
var
|
|
1002
|
-
|
|
1003
|
-
|
|
1071
|
+
var _requiredParams = ['secretType', 'configElement'];
|
|
1072
|
+
var _validParams = ['secretType', 'configElement', 'headers'];
|
|
1073
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
1074
|
+
if (_validationErrors) {
|
|
1075
|
+
return Promise.reject(_validationErrors);
|
|
1004
1076
|
}
|
|
1005
1077
|
var path = {
|
|
1006
1078
|
'secret_type': _params.secretType,
|
|
@@ -1035,10 +1107,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1035
1107
|
*/
|
|
1036
1108
|
SecretsManagerV1.prototype.getConfigElement = function (params) {
|
|
1037
1109
|
var _params = __assign({}, params);
|
|
1038
|
-
var
|
|
1039
|
-
var
|
|
1040
|
-
|
|
1041
|
-
|
|
1110
|
+
var _requiredParams = ['secretType', 'configElement', 'configName'];
|
|
1111
|
+
var _validParams = ['secretType', 'configElement', 'configName', 'headers'];
|
|
1112
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
1113
|
+
if (_validationErrors) {
|
|
1114
|
+
return Promise.reject(_validationErrors);
|
|
1042
1115
|
}
|
|
1043
1116
|
var path = {
|
|
1044
1117
|
'secret_type': _params.secretType,
|
|
@@ -1071,16 +1144,17 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1071
1144
|
* @param {string} params.configName - The name of your configuration.
|
|
1072
1145
|
* @param {string} params.type - The type of configuration. Value options differ depending on the `config_element`
|
|
1073
1146
|
* property that you want to define.
|
|
1074
|
-
* @param {JsonObject} params.config -
|
|
1147
|
+
* @param {JsonObject} params.config - Properties that describe a configuration, which depends on type.
|
|
1075
1148
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1076
1149
|
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSingleConfigElement>>}
|
|
1077
1150
|
*/
|
|
1078
1151
|
SecretsManagerV1.prototype.updateConfigElement = function (params) {
|
|
1079
1152
|
var _params = __assign({}, params);
|
|
1080
|
-
var
|
|
1081
|
-
var
|
|
1082
|
-
|
|
1083
|
-
|
|
1153
|
+
var _requiredParams = ['secretType', 'configElement', 'configName', 'type', 'config'];
|
|
1154
|
+
var _validParams = ['secretType', 'configElement', 'configName', 'type', 'config', 'headers'];
|
|
1155
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
1156
|
+
if (_validationErrors) {
|
|
1157
|
+
return Promise.reject(_validationErrors);
|
|
1084
1158
|
}
|
|
1085
1159
|
var body = {
|
|
1086
1160
|
'type': _params.type,
|
|
@@ -1122,10 +1196,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1122
1196
|
*/
|
|
1123
1197
|
SecretsManagerV1.prototype.deleteConfigElement = function (params) {
|
|
1124
1198
|
var _params = __assign({}, params);
|
|
1125
|
-
var
|
|
1126
|
-
var
|
|
1127
|
-
|
|
1128
|
-
|
|
1199
|
+
var _requiredParams = ['secretType', 'configElement', 'configName'];
|
|
1200
|
+
var _validParams = ['secretType', 'configElement', 'configName', 'headers'];
|
|
1201
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
1202
|
+
if (_validationErrors) {
|
|
1203
|
+
return Promise.reject(_validationErrors);
|
|
1129
1204
|
}
|
|
1130
1205
|
var path = {
|
|
1131
1206
|
'secret_type': _params.secretType,
|
|
@@ -1164,6 +1239,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1164
1239
|
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
1165
1240
|
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
1166
1241
|
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
1242
|
+
SecretType["KV"] = "kv";
|
|
1167
1243
|
})(SecretType = CreateSecretConstants.SecretType || (CreateSecretConstants.SecretType = {}));
|
|
1168
1244
|
})(CreateSecretConstants = SecretsManagerV1.CreateSecretConstants || (SecretsManagerV1.CreateSecretConstants = {}));
|
|
1169
1245
|
/** Constants for the `listSecrets` operation. */
|
|
@@ -1177,6 +1253,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1177
1253
|
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
1178
1254
|
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
1179
1255
|
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
1256
|
+
SecretType["KV"] = "kv";
|
|
1180
1257
|
})(SecretType = ListSecretsConstants.SecretType || (ListSecretsConstants.SecretType = {}));
|
|
1181
1258
|
})(ListSecretsConstants = SecretsManagerV1.ListSecretsConstants || (SecretsManagerV1.ListSecretsConstants = {}));
|
|
1182
1259
|
/** Constants for the `listAllSecrets` operation. */
|
|
@@ -1203,6 +1280,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1203
1280
|
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
1204
1281
|
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
1205
1282
|
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
1283
|
+
SecretType["KV"] = "kv";
|
|
1206
1284
|
})(SecretType = GetSecretConstants.SecretType || (GetSecretConstants.SecretType = {}));
|
|
1207
1285
|
})(GetSecretConstants = SecretsManagerV1.GetSecretConstants || (SecretsManagerV1.GetSecretConstants = {}));
|
|
1208
1286
|
/** Constants for the `updateSecret` operation. */
|
|
@@ -1216,11 +1294,13 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1216
1294
|
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
1217
1295
|
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
1218
1296
|
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
1297
|
+
SecretType["KV"] = "kv";
|
|
1219
1298
|
})(SecretType = UpdateSecretConstants.SecretType || (UpdateSecretConstants.SecretType = {}));
|
|
1220
1299
|
/** The action to perform on the specified secret. */
|
|
1221
1300
|
var Action;
|
|
1222
1301
|
(function (Action) {
|
|
1223
1302
|
Action["ROTATE"] = "rotate";
|
|
1303
|
+
Action["RESTORE"] = "restore";
|
|
1224
1304
|
Action["DELETE_CREDENTIALS"] = "delete_credentials";
|
|
1225
1305
|
})(Action = UpdateSecretConstants.Action || (UpdateSecretConstants.Action = {}));
|
|
1226
1306
|
})(UpdateSecretConstants = SecretsManagerV1.UpdateSecretConstants || (SecretsManagerV1.UpdateSecretConstants = {}));
|
|
@@ -1235,16 +1315,35 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1235
1315
|
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
1236
1316
|
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
1237
1317
|
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
1318
|
+
SecretType["KV"] = "kv";
|
|
1238
1319
|
})(SecretType = DeleteSecretConstants.SecretType || (DeleteSecretConstants.SecretType = {}));
|
|
1239
1320
|
})(DeleteSecretConstants = SecretsManagerV1.DeleteSecretConstants || (SecretsManagerV1.DeleteSecretConstants = {}));
|
|
1321
|
+
/** Constants for the `listSecretVersions` operation. */
|
|
1322
|
+
var ListSecretVersionsConstants;
|
|
1323
|
+
(function (ListSecretVersionsConstants) {
|
|
1324
|
+
/** The secret type. */
|
|
1325
|
+
var SecretType;
|
|
1326
|
+
(function (SecretType) {
|
|
1327
|
+
SecretType["ARBITRARY"] = "arbitrary";
|
|
1328
|
+
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
1329
|
+
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
1330
|
+
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
1331
|
+
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
1332
|
+
SecretType["KV"] = "kv";
|
|
1333
|
+
})(SecretType = ListSecretVersionsConstants.SecretType || (ListSecretVersionsConstants.SecretType = {}));
|
|
1334
|
+
})(ListSecretVersionsConstants = SecretsManagerV1.ListSecretVersionsConstants || (SecretsManagerV1.ListSecretVersionsConstants = {}));
|
|
1240
1335
|
/** Constants for the `getSecretVersion` operation. */
|
|
1241
1336
|
var GetSecretVersionConstants;
|
|
1242
1337
|
(function (GetSecretVersionConstants) {
|
|
1243
1338
|
/** The secret type. */
|
|
1244
1339
|
var SecretType;
|
|
1245
1340
|
(function (SecretType) {
|
|
1341
|
+
SecretType["ARBITRARY"] = "arbitrary";
|
|
1342
|
+
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
1246
1343
|
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
1247
1344
|
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
1345
|
+
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
1346
|
+
SecretType["KV"] = "kv";
|
|
1248
1347
|
})(SecretType = GetSecretVersionConstants.SecretType || (GetSecretVersionConstants.SecretType = {}));
|
|
1249
1348
|
})(GetSecretVersionConstants = SecretsManagerV1.GetSecretVersionConstants || (SecretsManagerV1.GetSecretVersionConstants = {}));
|
|
1250
1349
|
/** Constants for the `getSecretVersionMetadata` operation. */
|
|
@@ -1253,8 +1352,12 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1253
1352
|
/** The secret type. */
|
|
1254
1353
|
var SecretType;
|
|
1255
1354
|
(function (SecretType) {
|
|
1355
|
+
SecretType["ARBITRARY"] = "arbitrary";
|
|
1356
|
+
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
1256
1357
|
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
1257
1358
|
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
1359
|
+
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
1360
|
+
SecretType["KV"] = "kv";
|
|
1258
1361
|
})(SecretType = GetSecretVersionMetadataConstants.SecretType || (GetSecretVersionMetadataConstants.SecretType = {}));
|
|
1259
1362
|
})(GetSecretVersionMetadataConstants = SecretsManagerV1.GetSecretVersionMetadataConstants || (SecretsManagerV1.GetSecretVersionMetadataConstants = {}));
|
|
1260
1363
|
/** Constants for the `getSecretMetadata` operation. */
|
|
@@ -1268,6 +1371,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1268
1371
|
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
1269
1372
|
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
1270
1373
|
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
1374
|
+
SecretType["KV"] = "kv";
|
|
1271
1375
|
})(SecretType = GetSecretMetadataConstants.SecretType || (GetSecretMetadataConstants.SecretType = {}));
|
|
1272
1376
|
})(GetSecretMetadataConstants = SecretsManagerV1.GetSecretMetadataConstants || (SecretsManagerV1.GetSecretMetadataConstants = {}));
|
|
1273
1377
|
/** Constants for the `updateSecretMetadata` operation. */
|
|
@@ -1281,6 +1385,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1281
1385
|
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
1282
1386
|
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
1283
1387
|
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
1388
|
+
SecretType["KV"] = "kv";
|
|
1284
1389
|
})(SecretType = UpdateSecretMetadataConstants.SecretType || (UpdateSecretMetadataConstants.SecretType = {}));
|
|
1285
1390
|
})(UpdateSecretMetadataConstants = SecretsManagerV1.UpdateSecretMetadataConstants || (SecretsManagerV1.UpdateSecretMetadataConstants = {}));
|
|
1286
1391
|
/** Constants for the `putPolicy` operation. */
|
|
@@ -1316,7 +1421,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1316
1421
|
/** Constants for the `putConfig` operation. */
|
|
1317
1422
|
var PutConfigConstants;
|
|
1318
1423
|
(function (PutConfigConstants) {
|
|
1319
|
-
/**
|
|
1424
|
+
/** The secret type. */
|
|
1320
1425
|
var SecretType;
|
|
1321
1426
|
(function (SecretType) {
|
|
1322
1427
|
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|