@ibm-cloud/secrets-manager 1.0.31 → 1.0.34
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 +9 -8
- package/secrets-manager/v1.d.ts +2022 -194
- package/secrets-manager/v1.js +733 -47
- package/secrets-manager/v1.js.map +1 -1
package/secrets-manager/v1.js
CHANGED
|
@@ -39,7 +39,7 @@ 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.51.0-5b8b699d-20220613-200818
|
|
43
43
|
*/
|
|
44
44
|
var extend = require("extend");
|
|
45
45
|
var ibm_cloud_sdk_core_1 = require("ibm-cloud-sdk-core");
|
|
@@ -71,9 +71,6 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
71
71
|
if (options.serviceUrl) {
|
|
72
72
|
_this.setServiceUrl(options.serviceUrl);
|
|
73
73
|
}
|
|
74
|
-
else {
|
|
75
|
-
_this.setServiceUrl(SecretsManagerV1.DEFAULT_SERVICE_URL);
|
|
76
|
-
}
|
|
77
74
|
return _this;
|
|
78
75
|
}
|
|
79
76
|
/*************************
|
|
@@ -109,7 +106,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
109
106
|
/**
|
|
110
107
|
* Create a secret group.
|
|
111
108
|
*
|
|
112
|
-
*
|
|
109
|
+
* Create a secret group that you can use to organize secrets and control who on your team has access to them.
|
|
113
110
|
*
|
|
114
111
|
* A successful request returns the ID value of the secret group, along with other metadata. To learn more about
|
|
115
112
|
* secret groups, check out the
|
|
@@ -152,7 +149,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
152
149
|
/**
|
|
153
150
|
* List secret groups.
|
|
154
151
|
*
|
|
155
|
-
*
|
|
152
|
+
* List the secret groups that are available in your Secrets Manager instance.
|
|
156
153
|
*
|
|
157
154
|
* @param {Object} [params] - The parameters to send to the service.
|
|
158
155
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
@@ -183,7 +180,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
183
180
|
/**
|
|
184
181
|
* Get a secret group.
|
|
185
182
|
*
|
|
186
|
-
*
|
|
183
|
+
* Get the metadata of an existing secret group by specifying the ID of the group.
|
|
187
184
|
*
|
|
188
185
|
* @param {Object} params - The parameters to send to the service.
|
|
189
186
|
* @param {string} params.id - The v4 UUID that uniquely identifies the secret group.
|
|
@@ -219,7 +216,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
219
216
|
/**
|
|
220
217
|
* Update a secret group.
|
|
221
218
|
*
|
|
222
|
-
*
|
|
219
|
+
* Update the metadata of an existing secret group, such as its name or description.
|
|
223
220
|
*
|
|
224
221
|
* @param {Object} params - The parameters to send to the service.
|
|
225
222
|
* @param {string} params.id - The v4 UUID that uniquely identifies the secret group.
|
|
@@ -263,7 +260,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
263
260
|
/**
|
|
264
261
|
* Delete a secret group.
|
|
265
262
|
*
|
|
266
|
-
*
|
|
263
|
+
* Delete a secret group by specifying the ID of the secret group.
|
|
267
264
|
*
|
|
268
265
|
* **Note:** To delete a secret group, it must be empty. If you need to remove a secret group that contains secrets,
|
|
269
266
|
* you must first [delete the secrets](#delete-secret) that are associated with the group.
|
|
@@ -355,7 +352,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
355
352
|
/**
|
|
356
353
|
* List secrets by type.
|
|
357
354
|
*
|
|
358
|
-
*
|
|
355
|
+
* List the secrets in your Secrets Manager instance based on the type that you specify.
|
|
359
356
|
*
|
|
360
357
|
* @param {Object} params - The parameters to send to the service.
|
|
361
358
|
* @param {string} params.secretType - The secret type.
|
|
@@ -364,12 +361,12 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
364
361
|
* resources.
|
|
365
362
|
*
|
|
366
363
|
* **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 secrets, use
|
|
367
|
-
* `../secrets/{
|
|
364
|
+
* `../secrets/{secret_type}?limit=5`.
|
|
368
365
|
* @param {number} [params.offset] - The number of secrets to skip. By specifying `offset`, you retrieve a subset of
|
|
369
366
|
* items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
|
|
370
367
|
*
|
|
371
368
|
* **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
|
|
372
|
-
*
|
|
369
|
+
* `..?offset=25&limit=25`.
|
|
373
370
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
374
371
|
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecrets>>}
|
|
375
372
|
*/
|
|
@@ -407,7 +404,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
407
404
|
/**
|
|
408
405
|
* List all secrets.
|
|
409
406
|
*
|
|
410
|
-
*
|
|
407
|
+
* List all of the secrets in your Secrets Manager instance.
|
|
411
408
|
*
|
|
412
409
|
* @param {Object} [params] - The parameters to send to the service.
|
|
413
410
|
* @param {number} [params.limit] - The number of secrets to retrieve. By default, list operations return the first
|
|
@@ -415,28 +412,28 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
415
412
|
* resources.
|
|
416
413
|
*
|
|
417
414
|
* **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 secrets, use
|
|
418
|
-
* `../secrets/{
|
|
415
|
+
* `../secrets/{secret_type}?limit=5`.
|
|
419
416
|
* @param {number} [params.offset] - The number of secrets to skip. By specifying `offset`, you retrieve a subset of
|
|
420
417
|
* items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
|
|
421
418
|
*
|
|
422
419
|
* **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
|
|
423
|
-
*
|
|
420
|
+
* `..?offset=25&limit=25`.
|
|
424
421
|
* @param {string} [params.search] - Filter secrets that contain the specified string. The fields that are searched
|
|
425
422
|
* include: id, name, description, labels, secret_type.
|
|
426
423
|
*
|
|
427
424
|
* **Usage:** If you want to list only the secrets that contain the string "text", use
|
|
428
|
-
* `../secrets/{
|
|
425
|
+
* `../secrets/{secret_type}?search=text`.
|
|
429
426
|
* @param {string} [params.sortBy] - Sort a list of secrets by the specified field.
|
|
430
427
|
*
|
|
431
428
|
* **Usage:** To sort a list of secrets by their creation date, use
|
|
432
|
-
* `../secrets/{
|
|
429
|
+
* `../secrets/{secret_type}?sort_by=creation_date`.
|
|
433
430
|
* @param {string[]} [params.groups] - Filter secrets by groups.
|
|
434
431
|
*
|
|
435
432
|
* You can apply multiple filters by using a comma-separated list of secret group IDs. If you need to filter secrets
|
|
436
433
|
* that are in the default secret group, use the `default` keyword.
|
|
437
434
|
*
|
|
438
435
|
* **Usage:** To retrieve a list of secrets that are associated with an existing secret group or the default group,
|
|
439
|
-
* use
|
|
436
|
+
* use `..?groups={secret_group_ID},default`.
|
|
440
437
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
441
438
|
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecrets>>}
|
|
442
439
|
*/
|
|
@@ -515,7 +512,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
515
512
|
/**
|
|
516
513
|
* Invoke an action on a secret.
|
|
517
514
|
*
|
|
518
|
-
*
|
|
515
|
+
* Invoke an action on a specified secret. This method supports the following actions:
|
|
519
516
|
*
|
|
520
517
|
* - `rotate`: Replace the value of a secret.
|
|
521
518
|
* - `restore`: Restore a previous version of an `iam_credentials` secret.
|
|
@@ -567,7 +564,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
567
564
|
/**
|
|
568
565
|
* Delete a secret.
|
|
569
566
|
*
|
|
570
|
-
*
|
|
567
|
+
* Delete a secret by specifying the ID of the secret.
|
|
571
568
|
*
|
|
572
569
|
* @param {Object} params - The parameters to send to the service.
|
|
573
570
|
* @param {string} params.secretType - The secret type.
|
|
@@ -603,7 +600,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
603
600
|
/**
|
|
604
601
|
* List versions of a secret.
|
|
605
602
|
*
|
|
606
|
-
*
|
|
603
|
+
* List the versions of a secret.
|
|
607
604
|
*
|
|
608
605
|
* A successful request returns the list of the versions along with the metadata of each version.
|
|
609
606
|
*
|
|
@@ -643,7 +640,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
643
640
|
/**
|
|
644
641
|
* Get a version of a secret.
|
|
645
642
|
*
|
|
646
|
-
*
|
|
643
|
+
* Get a version of a secret by specifying the ID of the version or the alias `previous`.
|
|
647
644
|
*
|
|
648
645
|
* A successful request returns the secret data that is associated with the specified version of your secret, along
|
|
649
646
|
* with other metadata.
|
|
@@ -687,10 +684,61 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
687
684
|
};
|
|
688
685
|
return this.createRequest(parameters);
|
|
689
686
|
};
|
|
687
|
+
/**
|
|
688
|
+
* Invoke an action on a version of a secret.
|
|
689
|
+
*
|
|
690
|
+
* Invoke an action on a specified version of a secret. This method supports the following actions:
|
|
691
|
+
*
|
|
692
|
+
* - `revoke`: Revoke a version of a private certificate.
|
|
693
|
+
*
|
|
694
|
+
* @param {Object} params - The parameters to send to the service.
|
|
695
|
+
* @param {string} params.secretType - The secret type.
|
|
696
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
697
|
+
* @param {string} params.versionId - The v4 UUID that uniquely identifies the secret version. You can also use
|
|
698
|
+
* `previous` to retrieve the previous version.
|
|
699
|
+
*
|
|
700
|
+
* **Note:** To find the version ID of a secret, use the [Get secret metadata](#get-secret-metadata) method and check
|
|
701
|
+
* the response details.
|
|
702
|
+
* @param {string} params.action - The action to perform on the specified secret version.
|
|
703
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
704
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecret>>}
|
|
705
|
+
*/
|
|
706
|
+
SecretsManagerV1.prototype.updateSecretVersion = function (params) {
|
|
707
|
+
var _params = __assign({}, params);
|
|
708
|
+
var _requiredParams = ['secretType', 'id', 'versionId', 'action'];
|
|
709
|
+
var _validParams = ['secretType', 'id', 'versionId', 'action', 'headers'];
|
|
710
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
711
|
+
if (_validationErrors) {
|
|
712
|
+
return Promise.reject(_validationErrors);
|
|
713
|
+
}
|
|
714
|
+
var query = {
|
|
715
|
+
'action': _params.action,
|
|
716
|
+
};
|
|
717
|
+
var path = {
|
|
718
|
+
'secret_type': _params.secretType,
|
|
719
|
+
'id': _params.id,
|
|
720
|
+
'version_id': _params.versionId,
|
|
721
|
+
};
|
|
722
|
+
var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'updateSecretVersion');
|
|
723
|
+
var parameters = {
|
|
724
|
+
options: {
|
|
725
|
+
url: '/api/v1/secrets/{secret_type}/{id}/versions/{version_id}',
|
|
726
|
+
method: 'POST',
|
|
727
|
+
qs: query,
|
|
728
|
+
path: path,
|
|
729
|
+
},
|
|
730
|
+
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
731
|
+
headers: extend(true, sdkHeaders, {
|
|
732
|
+
'Accept': 'application/json',
|
|
733
|
+
}, _params.headers),
|
|
734
|
+
}),
|
|
735
|
+
};
|
|
736
|
+
return this.createRequest(parameters);
|
|
737
|
+
};
|
|
690
738
|
/**
|
|
691
739
|
* Get secret version metadata.
|
|
692
740
|
*
|
|
693
|
-
*
|
|
741
|
+
* Get the metadata of a secret version by specifying the ID of the version or the alias `previous`.
|
|
694
742
|
*
|
|
695
743
|
* A successful request returns the metadata that is associated with the specified version of your secret.
|
|
696
744
|
*
|
|
@@ -736,7 +784,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
736
784
|
/**
|
|
737
785
|
* Get secret metadata.
|
|
738
786
|
*
|
|
739
|
-
*
|
|
787
|
+
* Get the details of a secret by specifying its ID.
|
|
740
788
|
*
|
|
741
789
|
* A successful request returns only metadata about the secret, such as its name and creation date. To retrieve the
|
|
742
790
|
* value of a secret, use the [Get a secret](#get-secret) or [Get a version of a secret](#get-secret-version) methods.
|
|
@@ -777,7 +825,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
777
825
|
/**
|
|
778
826
|
* Update secret metadata.
|
|
779
827
|
*
|
|
780
|
-
*
|
|
828
|
+
* Update the metadata of a secret, such as its name or description.
|
|
781
829
|
*
|
|
782
830
|
* To update the actual contents of a secret, rotate the secret by using the [Invoke an action on a
|
|
783
831
|
* secret](#update-secret) method.
|
|
@@ -823,15 +871,450 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
823
871
|
};
|
|
824
872
|
return this.createRequest(parameters);
|
|
825
873
|
};
|
|
874
|
+
/*************************
|
|
875
|
+
* locks
|
|
876
|
+
************************/
|
|
877
|
+
/**
|
|
878
|
+
* List secret locks.
|
|
879
|
+
*
|
|
880
|
+
* List the locks that are associated with a specified secret.
|
|
881
|
+
*
|
|
882
|
+
* @param {Object} params - The parameters to send to the service.
|
|
883
|
+
* @param {string} params.secretType - The secret type.
|
|
884
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
885
|
+
* @param {number} [params.limit] - The number of secrets with locks to retrieve. By default, list operations return
|
|
886
|
+
* the first 25 items. To retrieve a different set of items, use `limit` with `offset` to page through your available
|
|
887
|
+
* resources.
|
|
888
|
+
*
|
|
889
|
+
* **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 with locks, use
|
|
890
|
+
* `..?limit=5`.
|
|
891
|
+
* @param {number} [params.offset] - The number of secrets to skip. By specifying `offset`, you retrieve a subset of
|
|
892
|
+
* items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
|
|
893
|
+
*
|
|
894
|
+
* **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
|
|
895
|
+
* `..?offset=25&limit=25`.
|
|
896
|
+
* @param {string} [params.search] - Filter locks that contain the specified string in the field "name".
|
|
897
|
+
*
|
|
898
|
+
* **Usage:** If you want to list only the locks that contain the string "text" in the field "name", use
|
|
899
|
+
* `..?search=text`.
|
|
900
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
901
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecretLocks>>}
|
|
902
|
+
*/
|
|
903
|
+
SecretsManagerV1.prototype.getLocks = function (params) {
|
|
904
|
+
var _params = __assign({}, params);
|
|
905
|
+
var _requiredParams = ['secretType', 'id'];
|
|
906
|
+
var _validParams = ['secretType', 'id', 'limit', 'offset', 'search', 'headers'];
|
|
907
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
908
|
+
if (_validationErrors) {
|
|
909
|
+
return Promise.reject(_validationErrors);
|
|
910
|
+
}
|
|
911
|
+
var query = {
|
|
912
|
+
'limit': _params.limit,
|
|
913
|
+
'offset': _params.offset,
|
|
914
|
+
'search': _params.search,
|
|
915
|
+
};
|
|
916
|
+
var path = {
|
|
917
|
+
'secret_type': _params.secretType,
|
|
918
|
+
'id': _params.id,
|
|
919
|
+
};
|
|
920
|
+
var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getLocks');
|
|
921
|
+
var parameters = {
|
|
922
|
+
options: {
|
|
923
|
+
url: '/api/v1/locks/{secret_type}/{id}',
|
|
924
|
+
method: 'GET',
|
|
925
|
+
qs: query,
|
|
926
|
+
path: path,
|
|
927
|
+
},
|
|
928
|
+
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
929
|
+
headers: extend(true, sdkHeaders, {
|
|
930
|
+
'Accept': 'application/json',
|
|
931
|
+
}, _params.headers),
|
|
932
|
+
}),
|
|
933
|
+
};
|
|
934
|
+
return this.createRequest(parameters);
|
|
935
|
+
};
|
|
936
|
+
/**
|
|
937
|
+
* Lock a secret.
|
|
938
|
+
*
|
|
939
|
+
* Create a lock on the current version of a secret.
|
|
940
|
+
*
|
|
941
|
+
* A lock can be used to prevent a secret from being deleted or modified while it's in use by your applications. A
|
|
942
|
+
* successful request attaches a new lock to your secret, or replaces a lock of the same name if it already exists.
|
|
943
|
+
* Additionally, you can use this method to clear any matching locks on a secret by using one of the following
|
|
944
|
+
* optional lock modes:
|
|
945
|
+
*
|
|
946
|
+
* - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret.
|
|
947
|
+
* - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if
|
|
948
|
+
* it doesn't have any locks.
|
|
949
|
+
*
|
|
950
|
+
* For more information about locking secrets, check out the
|
|
951
|
+
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secret-locks).
|
|
952
|
+
*
|
|
953
|
+
* @param {Object} params - The parameters to send to the service.
|
|
954
|
+
* @param {string} params.secretType - The secret type.
|
|
955
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
956
|
+
* @param {LockSecretBodyLocksItem[]} [params.locks] - The lock data to be attached to a secret version.
|
|
957
|
+
* @param {string} [params.mode] - An optional lock mode. At lock creation, you can set one of the following modes to
|
|
958
|
+
* clear any matching locks on a secret version.
|
|
959
|
+
*
|
|
960
|
+
* - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret.
|
|
961
|
+
* - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if
|
|
962
|
+
* it doesn't have any locks.
|
|
963
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
964
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretLocks>>}
|
|
965
|
+
*/
|
|
966
|
+
SecretsManagerV1.prototype.lockSecret = function (params) {
|
|
967
|
+
var _params = __assign({}, params);
|
|
968
|
+
var _requiredParams = ['secretType', 'id'];
|
|
969
|
+
var _validParams = ['secretType', 'id', 'locks', 'mode', 'headers'];
|
|
970
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
971
|
+
if (_validationErrors) {
|
|
972
|
+
return Promise.reject(_validationErrors);
|
|
973
|
+
}
|
|
974
|
+
var body = {
|
|
975
|
+
'locks': _params.locks,
|
|
976
|
+
};
|
|
977
|
+
var query = {
|
|
978
|
+
'mode': _params.mode,
|
|
979
|
+
};
|
|
980
|
+
var path = {
|
|
981
|
+
'secret_type': _params.secretType,
|
|
982
|
+
'id': _params.id,
|
|
983
|
+
};
|
|
984
|
+
var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'lockSecret');
|
|
985
|
+
var parameters = {
|
|
986
|
+
options: {
|
|
987
|
+
url: '/api/v1/locks/{secret_type}/{id}/lock',
|
|
988
|
+
method: 'POST',
|
|
989
|
+
body: body,
|
|
990
|
+
qs: query,
|
|
991
|
+
path: path,
|
|
992
|
+
},
|
|
993
|
+
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
994
|
+
headers: extend(true, sdkHeaders, {
|
|
995
|
+
'Accept': 'application/json',
|
|
996
|
+
'Content-Type': 'application/json',
|
|
997
|
+
}, _params.headers),
|
|
998
|
+
}),
|
|
999
|
+
};
|
|
1000
|
+
return this.createRequest(parameters);
|
|
1001
|
+
};
|
|
1002
|
+
/**
|
|
1003
|
+
* Unlock a secret.
|
|
1004
|
+
*
|
|
1005
|
+
* Delete one or more locks that are associated with the current version of a secret.
|
|
1006
|
+
*
|
|
1007
|
+
* A successful request deletes the locks that you specify. To remove all locks, you can pass `{"locks": ["*"]}` in in
|
|
1008
|
+
* the request body. Otherwise, specify the names of the locks that you want to delete. For example, `{"locks":
|
|
1009
|
+
* ["lock1", "lock2"]}`.
|
|
1010
|
+
*
|
|
1011
|
+
* **Note:** A secret is considered unlocked and able to be revoked or deleted only after all of its locks are
|
|
1012
|
+
* removed. To understand whether a secret contains locks, check the `locks_total` field that is returned as part of
|
|
1013
|
+
* the metadata of your secret.
|
|
1014
|
+
*
|
|
1015
|
+
* @param {Object} params - The parameters to send to the service.
|
|
1016
|
+
* @param {string} params.secretType - The secret type.
|
|
1017
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
1018
|
+
* @param {string[]} [params.locks] - A comma-separated list of locks to delete.
|
|
1019
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1020
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretLocks>>}
|
|
1021
|
+
*/
|
|
1022
|
+
SecretsManagerV1.prototype.unlockSecret = function (params) {
|
|
1023
|
+
var _params = __assign({}, params);
|
|
1024
|
+
var _requiredParams = ['secretType', 'id'];
|
|
1025
|
+
var _validParams = ['secretType', 'id', 'locks', 'headers'];
|
|
1026
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
1027
|
+
if (_validationErrors) {
|
|
1028
|
+
return Promise.reject(_validationErrors);
|
|
1029
|
+
}
|
|
1030
|
+
var body = {
|
|
1031
|
+
'locks': _params.locks,
|
|
1032
|
+
};
|
|
1033
|
+
var path = {
|
|
1034
|
+
'secret_type': _params.secretType,
|
|
1035
|
+
'id': _params.id,
|
|
1036
|
+
};
|
|
1037
|
+
var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'unlockSecret');
|
|
1038
|
+
var parameters = {
|
|
1039
|
+
options: {
|
|
1040
|
+
url: '/api/v1/locks/{secret_type}/{id}/unlock',
|
|
1041
|
+
method: 'POST',
|
|
1042
|
+
body: body,
|
|
1043
|
+
path: path,
|
|
1044
|
+
},
|
|
1045
|
+
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1046
|
+
headers: extend(true, sdkHeaders, {
|
|
1047
|
+
'Accept': 'application/json',
|
|
1048
|
+
'Content-Type': 'application/json',
|
|
1049
|
+
}, _params.headers),
|
|
1050
|
+
}),
|
|
1051
|
+
};
|
|
1052
|
+
return this.createRequest(parameters);
|
|
1053
|
+
};
|
|
1054
|
+
/**
|
|
1055
|
+
* List secret version locks.
|
|
1056
|
+
*
|
|
1057
|
+
* List the locks that are associated with a specified secret version.
|
|
1058
|
+
*
|
|
1059
|
+
* @param {Object} params - The parameters to send to the service.
|
|
1060
|
+
* @param {string} params.secretType - The secret type.
|
|
1061
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
1062
|
+
* @param {string} params.versionId - The v4 UUID that uniquely identifies the secret version. You can also use
|
|
1063
|
+
* `previous` to retrieve the previous version.
|
|
1064
|
+
*
|
|
1065
|
+
* **Note:** To find the version ID of a secret, use the [Get secret metadata](#get-secret-metadata) method and check
|
|
1066
|
+
* the response details.
|
|
1067
|
+
* @param {number} [params.limit] - The number of secrets with locks to retrieve. By default, list operations return
|
|
1068
|
+
* the first 25 items. To retrieve a different set of items, use `limit` with `offset` to page through your available
|
|
1069
|
+
* resources.
|
|
1070
|
+
*
|
|
1071
|
+
* **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 with locks, use
|
|
1072
|
+
* `..?limit=5`.
|
|
1073
|
+
* @param {number} [params.offset] - The number of secrets to skip. By specifying `offset`, you retrieve a subset of
|
|
1074
|
+
* items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
|
|
1075
|
+
*
|
|
1076
|
+
* **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
|
|
1077
|
+
* `..?offset=25&limit=25`.
|
|
1078
|
+
* @param {string} [params.search] - Filter locks that contain the specified string in the field "name".
|
|
1079
|
+
*
|
|
1080
|
+
* **Usage:** If you want to list only the locks that contain the string "text" in the field "name", use
|
|
1081
|
+
* `..?search=text`.
|
|
1082
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1083
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecretLocks>>}
|
|
1084
|
+
*/
|
|
1085
|
+
SecretsManagerV1.prototype.getSecretVersionLocks = function (params) {
|
|
1086
|
+
var _params = __assign({}, params);
|
|
1087
|
+
var _requiredParams = ['secretType', 'id', 'versionId'];
|
|
1088
|
+
var _validParams = ['secretType', 'id', 'versionId', 'limit', 'offset', 'search', 'headers'];
|
|
1089
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
1090
|
+
if (_validationErrors) {
|
|
1091
|
+
return Promise.reject(_validationErrors);
|
|
1092
|
+
}
|
|
1093
|
+
var query = {
|
|
1094
|
+
'limit': _params.limit,
|
|
1095
|
+
'offset': _params.offset,
|
|
1096
|
+
'search': _params.search,
|
|
1097
|
+
};
|
|
1098
|
+
var path = {
|
|
1099
|
+
'secret_type': _params.secretType,
|
|
1100
|
+
'id': _params.id,
|
|
1101
|
+
'version_id': _params.versionId,
|
|
1102
|
+
};
|
|
1103
|
+
var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getSecretVersionLocks');
|
|
1104
|
+
var parameters = {
|
|
1105
|
+
options: {
|
|
1106
|
+
url: '/api/v1/locks/{secret_type}/{id}/versions/{version_id}',
|
|
1107
|
+
method: 'GET',
|
|
1108
|
+
qs: query,
|
|
1109
|
+
path: path,
|
|
1110
|
+
},
|
|
1111
|
+
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1112
|
+
headers: extend(true, sdkHeaders, {
|
|
1113
|
+
'Accept': 'application/json',
|
|
1114
|
+
}, _params.headers),
|
|
1115
|
+
}),
|
|
1116
|
+
};
|
|
1117
|
+
return this.createRequest(parameters);
|
|
1118
|
+
};
|
|
1119
|
+
/**
|
|
1120
|
+
* Lock a secret version.
|
|
1121
|
+
*
|
|
1122
|
+
* Create a lock on the specified version of a secret.
|
|
1123
|
+
*
|
|
1124
|
+
* A lock can be used to prevent a secret from being deleted or modified while it's in use by your applications. A
|
|
1125
|
+
* successful request attaches a new lock to the specified version, or replaces a lock of the same name if it already
|
|
1126
|
+
* exists. Additionally, you can use this method to clear any matching locks on a secret version by using one of the
|
|
1127
|
+
* following optional lock modes:
|
|
1128
|
+
*
|
|
1129
|
+
* - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret.
|
|
1130
|
+
* - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if
|
|
1131
|
+
* it doesn't have any locks.
|
|
1132
|
+
*
|
|
1133
|
+
* For more information about locking secrets, check out the
|
|
1134
|
+
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secret-locks).
|
|
1135
|
+
*
|
|
1136
|
+
* @param {Object} params - The parameters to send to the service.
|
|
1137
|
+
* @param {string} params.secretType - The secret type.
|
|
1138
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
1139
|
+
* @param {string} params.versionId - The v4 UUID that uniquely identifies the secret version. You can also use
|
|
1140
|
+
* `previous` to retrieve the previous version.
|
|
1141
|
+
*
|
|
1142
|
+
* **Note:** To find the version ID of a secret, use the [Get secret metadata](#get-secret-metadata) method and check
|
|
1143
|
+
* the response details.
|
|
1144
|
+
* @param {LockSecretBodyLocksItem[]} [params.locks] - The lock data to be attached to a secret version.
|
|
1145
|
+
* @param {string} [params.mode] - An optional lock mode. At lock creation, you can set one of the following modes to
|
|
1146
|
+
* clear any matching locks on a secret version.
|
|
1147
|
+
*
|
|
1148
|
+
* - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret.
|
|
1149
|
+
* - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if
|
|
1150
|
+
* it doesn't have any locks.
|
|
1151
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1152
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretLocks>>}
|
|
1153
|
+
*/
|
|
1154
|
+
SecretsManagerV1.prototype.lockSecretVersion = function (params) {
|
|
1155
|
+
var _params = __assign({}, params);
|
|
1156
|
+
var _requiredParams = ['secretType', 'id', 'versionId'];
|
|
1157
|
+
var _validParams = ['secretType', 'id', 'versionId', 'locks', 'mode', 'headers'];
|
|
1158
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
1159
|
+
if (_validationErrors) {
|
|
1160
|
+
return Promise.reject(_validationErrors);
|
|
1161
|
+
}
|
|
1162
|
+
var body = {
|
|
1163
|
+
'locks': _params.locks,
|
|
1164
|
+
};
|
|
1165
|
+
var query = {
|
|
1166
|
+
'mode': _params.mode,
|
|
1167
|
+
};
|
|
1168
|
+
var path = {
|
|
1169
|
+
'secret_type': _params.secretType,
|
|
1170
|
+
'id': _params.id,
|
|
1171
|
+
'version_id': _params.versionId,
|
|
1172
|
+
};
|
|
1173
|
+
var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'lockSecretVersion');
|
|
1174
|
+
var parameters = {
|
|
1175
|
+
options: {
|
|
1176
|
+
url: '/api/v1/locks/{secret_type}/{id}/versions/{version_id}/lock',
|
|
1177
|
+
method: 'POST',
|
|
1178
|
+
body: body,
|
|
1179
|
+
qs: query,
|
|
1180
|
+
path: path,
|
|
1181
|
+
},
|
|
1182
|
+
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1183
|
+
headers: extend(true, sdkHeaders, {
|
|
1184
|
+
'Accept': 'application/json',
|
|
1185
|
+
'Content-Type': 'application/json',
|
|
1186
|
+
}, _params.headers),
|
|
1187
|
+
}),
|
|
1188
|
+
};
|
|
1189
|
+
return this.createRequest(parameters);
|
|
1190
|
+
};
|
|
1191
|
+
/**
|
|
1192
|
+
* Unlock a secret version.
|
|
1193
|
+
*
|
|
1194
|
+
* Delete one or more locks that are associated with the specified secret version.
|
|
1195
|
+
*
|
|
1196
|
+
* A successful request deletes the locks that you specify. To remove all locks, you can pass `{"locks": ["*"]}` in in
|
|
1197
|
+
* the request body. Otherwise, specify the names of the locks that you want to delete. For example, `{"locks":
|
|
1198
|
+
* ["lock-1", "lock-2"]}`.
|
|
1199
|
+
*
|
|
1200
|
+
* **Note:** A secret is considered unlocked and able to be revoked or deleted only after all of its locks are
|
|
1201
|
+
* removed. To understand whether a secret contains locks, check the `locks_total` field that is returned as part of
|
|
1202
|
+
* the metadata of your secret.
|
|
1203
|
+
*
|
|
1204
|
+
* @param {Object} params - The parameters to send to the service.
|
|
1205
|
+
* @param {string} params.secretType - The secret type.
|
|
1206
|
+
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
1207
|
+
* @param {string} params.versionId - The v4 UUID that uniquely identifies the secret version. You can also use
|
|
1208
|
+
* `previous` to retrieve the previous version.
|
|
1209
|
+
*
|
|
1210
|
+
* **Note:** To find the version ID of a secret, use the [Get secret metadata](#get-secret-metadata) method and check
|
|
1211
|
+
* the response details.
|
|
1212
|
+
* @param {string[]} [params.locks] - A comma-separated list of locks to delete.
|
|
1213
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1214
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretLocks>>}
|
|
1215
|
+
*/
|
|
1216
|
+
SecretsManagerV1.prototype.unlockSecretVersion = function (params) {
|
|
1217
|
+
var _params = __assign({}, params);
|
|
1218
|
+
var _requiredParams = ['secretType', 'id', 'versionId'];
|
|
1219
|
+
var _validParams = ['secretType', 'id', 'versionId', 'locks', 'headers'];
|
|
1220
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
1221
|
+
if (_validationErrors) {
|
|
1222
|
+
return Promise.reject(_validationErrors);
|
|
1223
|
+
}
|
|
1224
|
+
var body = {
|
|
1225
|
+
'locks': _params.locks,
|
|
1226
|
+
};
|
|
1227
|
+
var path = {
|
|
1228
|
+
'secret_type': _params.secretType,
|
|
1229
|
+
'id': _params.id,
|
|
1230
|
+
'version_id': _params.versionId,
|
|
1231
|
+
};
|
|
1232
|
+
var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'unlockSecretVersion');
|
|
1233
|
+
var parameters = {
|
|
1234
|
+
options: {
|
|
1235
|
+
url: '/api/v1/locks/{secret_type}/{id}/versions/{version_id}/unlock',
|
|
1236
|
+
method: 'POST',
|
|
1237
|
+
body: body,
|
|
1238
|
+
path: path,
|
|
1239
|
+
},
|
|
1240
|
+
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1241
|
+
headers: extend(true, sdkHeaders, {
|
|
1242
|
+
'Accept': 'application/json',
|
|
1243
|
+
'Content-Type': 'application/json',
|
|
1244
|
+
}, _params.headers),
|
|
1245
|
+
}),
|
|
1246
|
+
};
|
|
1247
|
+
return this.createRequest(parameters);
|
|
1248
|
+
};
|
|
1249
|
+
/**
|
|
1250
|
+
* List all secrets and locks.
|
|
1251
|
+
*
|
|
1252
|
+
* List the lock details that are associated with all secrets in your Secrets Manager instance.
|
|
1253
|
+
*
|
|
1254
|
+
* @param {Object} [params] - The parameters to send to the service.
|
|
1255
|
+
* @param {number} [params.limit] - The number of secrets with locks to retrieve. By default, list operations return
|
|
1256
|
+
* the first 25 items. To retrieve a different set of items, use `limit` with `offset` to page through your available
|
|
1257
|
+
* resources.
|
|
1258
|
+
*
|
|
1259
|
+
* **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 with locks, use
|
|
1260
|
+
* `..?limit=5`.
|
|
1261
|
+
* @param {number} [params.offset] - The number of secrets to skip. By specifying `offset`, you retrieve a subset of
|
|
1262
|
+
* items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
|
|
1263
|
+
*
|
|
1264
|
+
* **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
|
|
1265
|
+
* `..?offset=25&limit=25`.
|
|
1266
|
+
* @param {string} [params.search] - Filter locks that contain the specified string in the field "name".
|
|
1267
|
+
*
|
|
1268
|
+
* **Usage:** If you want to list only the locks that contain the string "text" in the field "name", use
|
|
1269
|
+
* `..?search=text`.
|
|
1270
|
+
* @param {string[]} [params.groups] - Filter secrets by groups.
|
|
1271
|
+
*
|
|
1272
|
+
* You can apply multiple filters by using a comma-separated list of secret group IDs. If you need to filter secrets
|
|
1273
|
+
* that are in the default secret group, use the `default` keyword.
|
|
1274
|
+
*
|
|
1275
|
+
* **Usage:** To retrieve a list of secrets that are associated with an existing secret group or the default group,
|
|
1276
|
+
* use `..?groups={secret_group_ID},default`.
|
|
1277
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1278
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetInstanceLocks>>}
|
|
1279
|
+
*/
|
|
1280
|
+
SecretsManagerV1.prototype.listInstanceSecretsLocks = function (params) {
|
|
1281
|
+
var _params = __assign({}, params);
|
|
1282
|
+
var _requiredParams = [];
|
|
1283
|
+
var _validParams = ['limit', 'offset', 'search', 'groups', 'headers'];
|
|
1284
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
1285
|
+
if (_validationErrors) {
|
|
1286
|
+
return Promise.reject(_validationErrors);
|
|
1287
|
+
}
|
|
1288
|
+
var query = {
|
|
1289
|
+
'limit': _params.limit,
|
|
1290
|
+
'offset': _params.offset,
|
|
1291
|
+
'search': _params.search,
|
|
1292
|
+
'groups': _params.groups,
|
|
1293
|
+
};
|
|
1294
|
+
var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'listInstanceSecretsLocks');
|
|
1295
|
+
var parameters = {
|
|
1296
|
+
options: {
|
|
1297
|
+
url: '/api/v1/locks',
|
|
1298
|
+
method: 'GET',
|
|
1299
|
+
qs: query,
|
|
1300
|
+
},
|
|
1301
|
+
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1302
|
+
headers: extend(true, sdkHeaders, {
|
|
1303
|
+
'Accept': 'application/json',
|
|
1304
|
+
}, _params.headers),
|
|
1305
|
+
}),
|
|
1306
|
+
};
|
|
1307
|
+
return this.createRequest(parameters);
|
|
1308
|
+
};
|
|
826
1309
|
/*************************
|
|
827
1310
|
* policies
|
|
828
1311
|
************************/
|
|
829
1312
|
/**
|
|
830
1313
|
* Set secret policies.
|
|
831
1314
|
*
|
|
832
|
-
*
|
|
833
|
-
* policy](
|
|
834
|
-
*
|
|
1315
|
+
* Create or update one or more policies, such as an [automatic rotation
|
|
1316
|
+
* policy](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-automatic-rotation), for the specified
|
|
1317
|
+
* secret.
|
|
835
1318
|
*
|
|
836
1319
|
* @param {Object} params - The parameters to send to the service.
|
|
837
1320
|
* @param {string} params.secretType - The secret type.
|
|
@@ -882,7 +1365,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
882
1365
|
/**
|
|
883
1366
|
* List secret policies.
|
|
884
1367
|
*
|
|
885
|
-
*
|
|
1368
|
+
* List the rotation policies that are associated with a specified secret.
|
|
886
1369
|
*
|
|
887
1370
|
* @param {Object} params - The parameters to send to the service.
|
|
888
1371
|
* @param {string} params.secretType - The secret type.
|
|
@@ -928,11 +1411,11 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
928
1411
|
/**
|
|
929
1412
|
* Set the configuration of a secret type.
|
|
930
1413
|
*
|
|
931
|
-
*
|
|
1414
|
+
* Set the configuration for the specified secret type.
|
|
932
1415
|
*
|
|
933
1416
|
* Use this method to configure the IAM credentials (`iam_credentials`) engine for your service instance. Looking to
|
|
934
|
-
*
|
|
935
|
-
* configuration](#create_config_element) method.
|
|
1417
|
+
* order or generate certificates? To configure the public certificates (`public_cert`) or private certificates
|
|
1418
|
+
* (`private_cert`) engines, use the [Add a configuration](#create_config_element) method.
|
|
936
1419
|
*
|
|
937
1420
|
* @param {Object} params - The parameters to send to the service.
|
|
938
1421
|
* @param {string} params.secretType - The secret type.
|
|
@@ -971,7 +1454,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
971
1454
|
/**
|
|
972
1455
|
* Get the configuration of a secret type.
|
|
973
1456
|
*
|
|
974
|
-
*
|
|
1457
|
+
* Get the configuration that is associated with the specified secret type.
|
|
975
1458
|
*
|
|
976
1459
|
* @param {Object} params - The parameters to send to the service.
|
|
977
1460
|
* @param {string} params.secretType - The secret type.
|
|
@@ -1007,17 +1490,17 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1007
1490
|
/**
|
|
1008
1491
|
* Add a configuration.
|
|
1009
1492
|
*
|
|
1010
|
-
*
|
|
1493
|
+
* Add a configuration element to the specified secret type.
|
|
1011
1494
|
*
|
|
1012
1495
|
* Use this method to define the configurations that are required to enable the public certificates (`public_cert`)
|
|
1013
|
-
*
|
|
1496
|
+
* and private certificates (`private_cert`) engines.
|
|
1014
1497
|
*
|
|
1015
1498
|
* You can add multiple configurations for your instance as follows:
|
|
1016
1499
|
*
|
|
1017
1500
|
* - Up to 10 public certificate authority configurations
|
|
1018
1501
|
* - Up to 10 DNS provider configurations
|
|
1019
|
-
* - Up to 10 private root
|
|
1020
|
-
* - Up to 10 private intermediate
|
|
1502
|
+
* - Up to 10 private root certificate authority configurations
|
|
1503
|
+
* - Up to 10 private intermediate certificate authority configurations
|
|
1021
1504
|
* - Up to 10 certificate templates.
|
|
1022
1505
|
*
|
|
1023
1506
|
* @param {Object} params - The parameters to send to the service.
|
|
@@ -1067,7 +1550,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1067
1550
|
/**
|
|
1068
1551
|
* List configurations.
|
|
1069
1552
|
*
|
|
1070
|
-
*
|
|
1553
|
+
* List the configuration elements that are associated with a specified secret type.
|
|
1071
1554
|
*
|
|
1072
1555
|
* @param {Object} params - The parameters to send to the service.
|
|
1073
1556
|
* @param {string} params.secretType - The secret type.
|
|
@@ -1105,7 +1588,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1105
1588
|
/**
|
|
1106
1589
|
* Get a configuration.
|
|
1107
1590
|
*
|
|
1108
|
-
*
|
|
1591
|
+
* Get the details of a specific configuration that is associated with a secret type.
|
|
1109
1592
|
*
|
|
1110
1593
|
* @param {Object} params - The parameters to send to the service.
|
|
1111
1594
|
* @param {string} params.secretType - The secret type.
|
|
@@ -1145,7 +1628,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1145
1628
|
/**
|
|
1146
1629
|
* Update a configuration.
|
|
1147
1630
|
*
|
|
1148
|
-
*
|
|
1631
|
+
* Update a configuration element that is associated with the specified secret type.
|
|
1149
1632
|
*
|
|
1150
1633
|
* @param {Object} params - The parameters to send to the service.
|
|
1151
1634
|
* @param {string} params.secretType - The secret type.
|
|
@@ -1191,10 +1674,74 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1191
1674
|
};
|
|
1192
1675
|
return this.createRequest(parameters);
|
|
1193
1676
|
};
|
|
1677
|
+
/**
|
|
1678
|
+
* Invoke an action on a configuration.
|
|
1679
|
+
*
|
|
1680
|
+
* Invoke an action on a specified configuration element. This method supports the following actions:
|
|
1681
|
+
*
|
|
1682
|
+
* - `sign_intermediate`: Sign an intermediate certificate authority.
|
|
1683
|
+
* - `sign_csr`: Sign a certificate signing request.
|
|
1684
|
+
* - `set_signed`: Set a signed intermediate certificate authority.
|
|
1685
|
+
* - `revoke`: Revoke an internally signed intermediate certificate authority certificate.
|
|
1686
|
+
* - `rotate_crl`: Rotate the certificate revocation list (CRL) of an intermediate certificate authority.
|
|
1687
|
+
*
|
|
1688
|
+
* @param {Object} params - The parameters to send to the service.
|
|
1689
|
+
* @param {string} params.secretType - The secret type.
|
|
1690
|
+
* @param {string} params.configElement - The configuration element on which the action is applied.
|
|
1691
|
+
* @param {string} params.configName - The name of the certificate authority.
|
|
1692
|
+
* @param {string} params.action - The action to perform on the specified configuration element.
|
|
1693
|
+
* @param {ConfigAction} [params.config] - Properties that describe an action on a configuration element.
|
|
1694
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1695
|
+
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ConfigElementActionResult>>}
|
|
1696
|
+
*/
|
|
1697
|
+
SecretsManagerV1.prototype.actionOnConfigElement = function (params) {
|
|
1698
|
+
var _params = __assign({}, params);
|
|
1699
|
+
var _requiredParams = ['secretType', 'configElement', 'configName', 'action'];
|
|
1700
|
+
var _validParams = [
|
|
1701
|
+
'secretType',
|
|
1702
|
+
'configElement',
|
|
1703
|
+
'configName',
|
|
1704
|
+
'action',
|
|
1705
|
+
'config',
|
|
1706
|
+
'headers',
|
|
1707
|
+
];
|
|
1708
|
+
var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
|
|
1709
|
+
if (_validationErrors) {
|
|
1710
|
+
return Promise.reject(_validationErrors);
|
|
1711
|
+
}
|
|
1712
|
+
var body = {
|
|
1713
|
+
'config': _params.config,
|
|
1714
|
+
};
|
|
1715
|
+
var query = {
|
|
1716
|
+
'action': _params.action,
|
|
1717
|
+
};
|
|
1718
|
+
var path = {
|
|
1719
|
+
'secret_type': _params.secretType,
|
|
1720
|
+
'config_element': _params.configElement,
|
|
1721
|
+
'config_name': _params.configName,
|
|
1722
|
+
};
|
|
1723
|
+
var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'actionOnConfigElement');
|
|
1724
|
+
var parameters = {
|
|
1725
|
+
options: {
|
|
1726
|
+
url: '/api/v1/config/{secret_type}/{config_element}/{config_name}',
|
|
1727
|
+
method: 'POST',
|
|
1728
|
+
body: body,
|
|
1729
|
+
qs: query,
|
|
1730
|
+
path: path,
|
|
1731
|
+
},
|
|
1732
|
+
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1733
|
+
headers: extend(true, sdkHeaders, {
|
|
1734
|
+
'Accept': 'application/json',
|
|
1735
|
+
'Content-Type': 'application/json',
|
|
1736
|
+
}, _params.headers),
|
|
1737
|
+
}),
|
|
1738
|
+
};
|
|
1739
|
+
return this.createRequest(parameters);
|
|
1740
|
+
};
|
|
1194
1741
|
/**
|
|
1195
1742
|
* Delete a configuration.
|
|
1196
1743
|
*
|
|
1197
|
-
*
|
|
1744
|
+
* Delete a configuration element from the specified secret type.
|
|
1198
1745
|
*
|
|
1199
1746
|
* @param {Object} params - The parameters to send to the service.
|
|
1200
1747
|
* @param {string} params.secretType - The secret type.
|
|
@@ -1235,7 +1782,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1235
1782
|
/**
|
|
1236
1783
|
* Register with Event Notifications.
|
|
1237
1784
|
*
|
|
1238
|
-
*
|
|
1785
|
+
* Create a registration between a Secrets Manager instance and [Event
|
|
1239
1786
|
* Notifications](https://cloud.ibm.com/apidocs/event-notifications).
|
|
1240
1787
|
*
|
|
1241
1788
|
* A successful request adds Secrets Manager as a source that you can reference from your Event Notifications
|
|
@@ -1289,7 +1836,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1289
1836
|
/**
|
|
1290
1837
|
* Get Event Notifications registration details.
|
|
1291
1838
|
*
|
|
1292
|
-
*
|
|
1839
|
+
* Get the details of an existing registration between a Secrets Manager instance and Event Notifications.
|
|
1293
1840
|
*
|
|
1294
1841
|
* @param {Object} [params] - The parameters to send to the service.
|
|
1295
1842
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
@@ -1320,7 +1867,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1320
1867
|
/**
|
|
1321
1868
|
* Unregister from Event Notifications.
|
|
1322
1869
|
*
|
|
1323
|
-
*
|
|
1870
|
+
* Delete a registration between a Secrets Manager instance and Event Notifications.
|
|
1324
1871
|
*
|
|
1325
1872
|
* A successful request removes your Secrets Manager instance as a source in Event Notifications.
|
|
1326
1873
|
*
|
|
@@ -1349,7 +1896,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1349
1896
|
return this.createRequest(parameters);
|
|
1350
1897
|
};
|
|
1351
1898
|
/**
|
|
1352
|
-
* Send test event.
|
|
1899
|
+
* Send a test event.
|
|
1353
1900
|
*
|
|
1354
1901
|
* Send a test event from a Secrets Manager instance to a configured [Event
|
|
1355
1902
|
* Notifications](https://cloud.ibm.com/apidocs/event-notifications) instance.
|
|
@@ -1382,7 +1929,6 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1382
1929
|
};
|
|
1383
1930
|
return this.createRequest(parameters);
|
|
1384
1931
|
};
|
|
1385
|
-
SecretsManagerV1.DEFAULT_SERVICE_URL = 'https://secrets-manager.cloud.ibm.com';
|
|
1386
1932
|
SecretsManagerV1.DEFAULT_SERVICE_NAME = 'secrets_manager';
|
|
1387
1933
|
return SecretsManagerV1;
|
|
1388
1934
|
}(ibm_cloud_sdk_core_1.BaseService));
|
|
@@ -1423,7 +1969,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1423
1969
|
/** Constants for the `listAllSecrets` operation. */
|
|
1424
1970
|
var ListAllSecretsConstants;
|
|
1425
1971
|
(function (ListAllSecretsConstants) {
|
|
1426
|
-
/** Sort a list of secrets by the specified field. **Usage:** To sort a list of secrets by their creation date, use `../secrets/{
|
|
1972
|
+
/** 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`. */
|
|
1427
1973
|
var SortBy;
|
|
1428
1974
|
(function (SortBy) {
|
|
1429
1975
|
SortBy["ID"] = "id";
|
|
@@ -1516,6 +2062,20 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1516
2062
|
SecretType["KV"] = "kv";
|
|
1517
2063
|
})(SecretType = GetSecretVersionConstants.SecretType || (GetSecretVersionConstants.SecretType = {}));
|
|
1518
2064
|
})(GetSecretVersionConstants = SecretsManagerV1.GetSecretVersionConstants || (SecretsManagerV1.GetSecretVersionConstants = {}));
|
|
2065
|
+
/** Constants for the `updateSecretVersion` operation. */
|
|
2066
|
+
var UpdateSecretVersionConstants;
|
|
2067
|
+
(function (UpdateSecretVersionConstants) {
|
|
2068
|
+
/** The secret type. */
|
|
2069
|
+
var SecretType;
|
|
2070
|
+
(function (SecretType) {
|
|
2071
|
+
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2072
|
+
})(SecretType = UpdateSecretVersionConstants.SecretType || (UpdateSecretVersionConstants.SecretType = {}));
|
|
2073
|
+
/** The action to perform on the specified secret version. */
|
|
2074
|
+
var Action;
|
|
2075
|
+
(function (Action) {
|
|
2076
|
+
Action["REVOKE"] = "revoke";
|
|
2077
|
+
})(Action = UpdateSecretVersionConstants.Action || (UpdateSecretVersionConstants.Action = {}));
|
|
2078
|
+
})(UpdateSecretVersionConstants = SecretsManagerV1.UpdateSecretVersionConstants || (SecretsManagerV1.UpdateSecretVersionConstants = {}));
|
|
1519
2079
|
/** Constants for the `getSecretVersionMetadata` operation. */
|
|
1520
2080
|
var GetSecretVersionMetadataConstants;
|
|
1521
2081
|
(function (GetSecretVersionMetadataConstants) {
|
|
@@ -1561,6 +2121,108 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1561
2121
|
SecretType["KV"] = "kv";
|
|
1562
2122
|
})(SecretType = UpdateSecretMetadataConstants.SecretType || (UpdateSecretMetadataConstants.SecretType = {}));
|
|
1563
2123
|
})(UpdateSecretMetadataConstants = SecretsManagerV1.UpdateSecretMetadataConstants || (SecretsManagerV1.UpdateSecretMetadataConstants = {}));
|
|
2124
|
+
/** Constants for the `getLocks` operation. */
|
|
2125
|
+
var GetLocksConstants;
|
|
2126
|
+
(function (GetLocksConstants) {
|
|
2127
|
+
/** The secret type. */
|
|
2128
|
+
var SecretType;
|
|
2129
|
+
(function (SecretType) {
|
|
2130
|
+
SecretType["ARBITRARY"] = "arbitrary";
|
|
2131
|
+
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2132
|
+
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2133
|
+
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2134
|
+
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2135
|
+
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2136
|
+
SecretType["KV"] = "kv";
|
|
2137
|
+
})(SecretType = GetLocksConstants.SecretType || (GetLocksConstants.SecretType = {}));
|
|
2138
|
+
})(GetLocksConstants = SecretsManagerV1.GetLocksConstants || (SecretsManagerV1.GetLocksConstants = {}));
|
|
2139
|
+
/** Constants for the `lockSecret` operation. */
|
|
2140
|
+
var LockSecretConstants;
|
|
2141
|
+
(function (LockSecretConstants) {
|
|
2142
|
+
/** The secret type. */
|
|
2143
|
+
var SecretType;
|
|
2144
|
+
(function (SecretType) {
|
|
2145
|
+
SecretType["ARBITRARY"] = "arbitrary";
|
|
2146
|
+
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2147
|
+
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2148
|
+
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2149
|
+
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2150
|
+
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2151
|
+
SecretType["KV"] = "kv";
|
|
2152
|
+
})(SecretType = LockSecretConstants.SecretType || (LockSecretConstants.SecretType = {}));
|
|
2153
|
+
/** An optional lock mode. At lock creation, you can set one of the following modes to clear any matching locks on a secret version. - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret. - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if it doesn't have any locks. */
|
|
2154
|
+
var Mode;
|
|
2155
|
+
(function (Mode) {
|
|
2156
|
+
Mode["EXCLUSIVE"] = "exclusive";
|
|
2157
|
+
Mode["EXCLUSIVE_DELETE"] = "exclusive_delete";
|
|
2158
|
+
})(Mode = LockSecretConstants.Mode || (LockSecretConstants.Mode = {}));
|
|
2159
|
+
})(LockSecretConstants = SecretsManagerV1.LockSecretConstants || (SecretsManagerV1.LockSecretConstants = {}));
|
|
2160
|
+
/** Constants for the `unlockSecret` operation. */
|
|
2161
|
+
var UnlockSecretConstants;
|
|
2162
|
+
(function (UnlockSecretConstants) {
|
|
2163
|
+
/** The secret type. */
|
|
2164
|
+
var SecretType;
|
|
2165
|
+
(function (SecretType) {
|
|
2166
|
+
SecretType["ARBITRARY"] = "arbitrary";
|
|
2167
|
+
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2168
|
+
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2169
|
+
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2170
|
+
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2171
|
+
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2172
|
+
SecretType["KV"] = "kv";
|
|
2173
|
+
})(SecretType = UnlockSecretConstants.SecretType || (UnlockSecretConstants.SecretType = {}));
|
|
2174
|
+
})(UnlockSecretConstants = SecretsManagerV1.UnlockSecretConstants || (SecretsManagerV1.UnlockSecretConstants = {}));
|
|
2175
|
+
/** Constants for the `getSecretVersionLocks` operation. */
|
|
2176
|
+
var GetSecretVersionLocksConstants;
|
|
2177
|
+
(function (GetSecretVersionLocksConstants) {
|
|
2178
|
+
/** The secret type. */
|
|
2179
|
+
var SecretType;
|
|
2180
|
+
(function (SecretType) {
|
|
2181
|
+
SecretType["ARBITRARY"] = "arbitrary";
|
|
2182
|
+
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2183
|
+
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2184
|
+
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2185
|
+
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2186
|
+
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2187
|
+
SecretType["KV"] = "kv";
|
|
2188
|
+
})(SecretType = GetSecretVersionLocksConstants.SecretType || (GetSecretVersionLocksConstants.SecretType = {}));
|
|
2189
|
+
})(GetSecretVersionLocksConstants = SecretsManagerV1.GetSecretVersionLocksConstants || (SecretsManagerV1.GetSecretVersionLocksConstants = {}));
|
|
2190
|
+
/** Constants for the `lockSecretVersion` operation. */
|
|
2191
|
+
var LockSecretVersionConstants;
|
|
2192
|
+
(function (LockSecretVersionConstants) {
|
|
2193
|
+
/** The secret type. */
|
|
2194
|
+
var SecretType;
|
|
2195
|
+
(function (SecretType) {
|
|
2196
|
+
SecretType["ARBITRARY"] = "arbitrary";
|
|
2197
|
+
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2198
|
+
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2199
|
+
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2200
|
+
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2201
|
+
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2202
|
+
SecretType["KV"] = "kv";
|
|
2203
|
+
})(SecretType = LockSecretVersionConstants.SecretType || (LockSecretVersionConstants.SecretType = {}));
|
|
2204
|
+
/** An optional lock mode. At lock creation, you can set one of the following modes to clear any matching locks on a secret version. - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret. - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if it doesn't have any locks. */
|
|
2205
|
+
var Mode;
|
|
2206
|
+
(function (Mode) {
|
|
2207
|
+
Mode["EXCLUSIVE"] = "exclusive";
|
|
2208
|
+
Mode["EXCLUSIVE_DELETE"] = "exclusive_delete";
|
|
2209
|
+
})(Mode = LockSecretVersionConstants.Mode || (LockSecretVersionConstants.Mode = {}));
|
|
2210
|
+
})(LockSecretVersionConstants = SecretsManagerV1.LockSecretVersionConstants || (SecretsManagerV1.LockSecretVersionConstants = {}));
|
|
2211
|
+
/** Constants for the `unlockSecretVersion` operation. */
|
|
2212
|
+
var UnlockSecretVersionConstants;
|
|
2213
|
+
(function (UnlockSecretVersionConstants) {
|
|
2214
|
+
/** The secret type. */
|
|
2215
|
+
var SecretType;
|
|
2216
|
+
(function (SecretType) {
|
|
2217
|
+
SecretType["ARBITRARY"] = "arbitrary";
|
|
2218
|
+
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2219
|
+
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2220
|
+
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2221
|
+
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2222
|
+
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2223
|
+
SecretType["KV"] = "kv";
|
|
2224
|
+
})(SecretType = UnlockSecretVersionConstants.SecretType || (UnlockSecretVersionConstants.SecretType = {}));
|
|
2225
|
+
})(UnlockSecretVersionConstants = SecretsManagerV1.UnlockSecretVersionConstants || (SecretsManagerV1.UnlockSecretVersionConstants = {}));
|
|
1564
2226
|
/** Constants for the `putPolicy` operation. */
|
|
1565
2227
|
var PutPolicyConstants;
|
|
1566
2228
|
(function (PutPolicyConstants) {
|
|
@@ -1711,6 +2373,30 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
|
1711
2373
|
Type["CERTIFICATE_TEMPLATE"] = "certificate_template";
|
|
1712
2374
|
})(Type = UpdateConfigElementConstants.Type || (UpdateConfigElementConstants.Type = {}));
|
|
1713
2375
|
})(UpdateConfigElementConstants = SecretsManagerV1.UpdateConfigElementConstants || (SecretsManagerV1.UpdateConfigElementConstants = {}));
|
|
2376
|
+
/** Constants for the `actionOnConfigElement` operation. */
|
|
2377
|
+
var ActionOnConfigElementConstants;
|
|
2378
|
+
(function (ActionOnConfigElementConstants) {
|
|
2379
|
+
/** The secret type. */
|
|
2380
|
+
var SecretType;
|
|
2381
|
+
(function (SecretType) {
|
|
2382
|
+
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2383
|
+
})(SecretType = ActionOnConfigElementConstants.SecretType || (ActionOnConfigElementConstants.SecretType = {}));
|
|
2384
|
+
/** The configuration element on which the action is applied. */
|
|
2385
|
+
var ConfigElement;
|
|
2386
|
+
(function (ConfigElement) {
|
|
2387
|
+
ConfigElement["ROOT_CERTIFICATE_AUTHORITIES"] = "root_certificate_authorities";
|
|
2388
|
+
ConfigElement["INTERMEDIATE_CERTIFICATE_AUTHORITIES"] = "intermediate_certificate_authorities";
|
|
2389
|
+
})(ConfigElement = ActionOnConfigElementConstants.ConfigElement || (ActionOnConfigElementConstants.ConfigElement = {}));
|
|
2390
|
+
/** The action to perform on the specified configuration element. */
|
|
2391
|
+
var Action;
|
|
2392
|
+
(function (Action) {
|
|
2393
|
+
Action["SIGN_INTERMEDIATE"] = "sign_intermediate";
|
|
2394
|
+
Action["SIGN_CSR"] = "sign_csr";
|
|
2395
|
+
Action["SET_SIGNED"] = "set_signed";
|
|
2396
|
+
Action["REVOKE"] = "revoke";
|
|
2397
|
+
Action["ROTATE_CRL"] = "rotate_crl";
|
|
2398
|
+
})(Action = ActionOnConfigElementConstants.Action || (ActionOnConfigElementConstants.Action = {}));
|
|
2399
|
+
})(ActionOnConfigElementConstants = SecretsManagerV1.ActionOnConfigElementConstants || (SecretsManagerV1.ActionOnConfigElementConstants = {}));
|
|
1714
2400
|
/** Constants for the `deleteConfigElement` operation. */
|
|
1715
2401
|
var DeleteConfigElementConstants;
|
|
1716
2402
|
(function (DeleteConfigElementConstants) {
|