@ibm-cloud/secrets-manager 2.0.8 → 2.0.10
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/CHANGELOG.md +4 -0
- package/README.md +1 -3
- package/examples/secrets-manager.v2.test.js +129 -2
- package/package.json +2 -2
- package/secrets-manager/v2.d.ts +2127 -838
- package/secrets-manager/v2.js +814 -136
- package/secrets-manager/v2.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## [2.0.10](https://github.com/IBM/secrets-manager-node-sdk/compare/v2.0.9...v2.0.10) (2025-05-05)
|
|
2
|
+
|
|
3
|
+
## [2.0.9](https://github.com/IBM/secrets-manager-node-sdk/compare/v2.0.8...v2.0.9) (2025-02-17)
|
|
4
|
+
|
|
1
5
|
## [2.0.8](https://github.com/IBM/secrets-manager-node-sdk/compare/v2.0.7...v2.0.8) (2024-10-07)
|
|
2
6
|
|
|
3
7
|
## [2.0.7](https://github.com/IBM/secrets-manager-node-sdk/compare/v2.0.6...v2.0.7) (2024-09-23)
|
package/README.md
CHANGED
|
@@ -50,12 +50,10 @@ With IAM authentication, you supply an API key that is used to generate an acces
|
|
|
50
50
|
included in each API request to Secrets Manager. Access tokens are valid for a limited amount of time and must be
|
|
51
51
|
regenerated.
|
|
52
52
|
|
|
53
|
-
Authentication for this SDK is accomplished by
|
|
54
|
-
using [IAM authenticators](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md#authentication). Import
|
|
53
|
+
Authentication for this SDK is accomplished by using [IAM authenticators](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md#authentication). Import
|
|
55
54
|
authenticators from `@ibm-cloud/secrets-manager/auth`.
|
|
56
55
|
|
|
57
56
|
### Examples
|
|
58
|
-
|
|
59
57
|
#### Programmatic credentials
|
|
60
58
|
|
|
61
59
|
```js
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jest-environment node
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* (C) Copyright IBM Corp.
|
|
5
|
+
* (C) Copyright IBM Corp. 2025.
|
|
6
6
|
*
|
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
* you may not use this file except in compliance with the License.
|
|
@@ -720,6 +720,107 @@ describe('SecretsManagerV2', () => {
|
|
|
720
720
|
// end-create_secret_version_action
|
|
721
721
|
});
|
|
722
722
|
|
|
723
|
+
test('listSecretTasks request example', async () => {
|
|
724
|
+
consoleLogMock.mockImplementation((output) => {
|
|
725
|
+
originalLog(output);
|
|
726
|
+
});
|
|
727
|
+
consoleWarnMock.mockImplementation((output) => {
|
|
728
|
+
// if an error occurs, display the message and then fail the test
|
|
729
|
+
originalWarn(output);
|
|
730
|
+
expect(true).toBeFalsy();
|
|
731
|
+
});
|
|
732
|
+
|
|
733
|
+
originalLog('listSecretTasks() result:');
|
|
734
|
+
// begin-list_secret_tasks
|
|
735
|
+
|
|
736
|
+
const params = {
|
|
737
|
+
secretId: secretIdForGetSecretLink,
|
|
738
|
+
};
|
|
739
|
+
|
|
740
|
+
let res;
|
|
741
|
+
try {
|
|
742
|
+
res = await secretsManagerService.listSecretTasks(params);
|
|
743
|
+
console.log(JSON.stringify(res.result, null, 2));
|
|
744
|
+
} catch (err) {
|
|
745
|
+
console.warn(err);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
// end-list_secret_tasks
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
test('getSecretTask request example', async () => {
|
|
752
|
+
consoleLogMock.mockImplementation((output) => {
|
|
753
|
+
originalLog(output);
|
|
754
|
+
});
|
|
755
|
+
consoleWarnMock.mockImplementation((output) => {
|
|
756
|
+
// if an error occurs, display the message and then fail the test
|
|
757
|
+
originalWarn(output);
|
|
758
|
+
expect(true).toBeFalsy();
|
|
759
|
+
});
|
|
760
|
+
|
|
761
|
+
originalLog('getSecretTask() result:');
|
|
762
|
+
// begin-get_secret_task
|
|
763
|
+
|
|
764
|
+
const params = {
|
|
765
|
+
secretId: secretIdForGetSecretLink,
|
|
766
|
+
id: secretIdForGetSecretLink,
|
|
767
|
+
};
|
|
768
|
+
|
|
769
|
+
let res;
|
|
770
|
+
try {
|
|
771
|
+
res = await secretsManagerService.getSecretTask(params);
|
|
772
|
+
console.log(JSON.stringify(res.result, null, 2));
|
|
773
|
+
} catch (err) {
|
|
774
|
+
console.warn(err);
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
// end-get_secret_task
|
|
778
|
+
});
|
|
779
|
+
|
|
780
|
+
test('replaceSecretTask request example', async () => {
|
|
781
|
+
consoleLogMock.mockImplementation((output) => {
|
|
782
|
+
originalLog(output);
|
|
783
|
+
});
|
|
784
|
+
consoleWarnMock.mockImplementation((output) => {
|
|
785
|
+
// if an error occurs, display the message and then fail the test
|
|
786
|
+
originalWarn(output);
|
|
787
|
+
expect(true).toBeFalsy();
|
|
788
|
+
});
|
|
789
|
+
|
|
790
|
+
originalLog('replaceSecretTask() result:');
|
|
791
|
+
// begin-replace_secret_task
|
|
792
|
+
|
|
793
|
+
// Request models needed by this operation.
|
|
794
|
+
|
|
795
|
+
// CustomCredentialsNewCredentials
|
|
796
|
+
const customCredentialsNewCredentialsModel = {
|
|
797
|
+
id: 'b49ad24d-81d4-5ebc-b9b9-b0937d1c84d5',
|
|
798
|
+
payload: { token: 'xF9v7OztItL5DOnFgHfS9NCT1sLTUew8KYZcZfxI' },
|
|
799
|
+
};
|
|
800
|
+
|
|
801
|
+
// SecretTaskPrototypeUpdateSecretTaskCredentialsCreated
|
|
802
|
+
const secretTaskPrototypeModel = {
|
|
803
|
+
status: 'credentials_created',
|
|
804
|
+
credentials: customCredentialsNewCredentialsModel,
|
|
805
|
+
};
|
|
806
|
+
|
|
807
|
+
const params = {
|
|
808
|
+
secretId: secretIdForGetSecretLink,
|
|
809
|
+
id: secretIdForGetSecretLink,
|
|
810
|
+
taskPut: secretTaskPrototypeModel,
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
let res;
|
|
814
|
+
try {
|
|
815
|
+
res = await secretsManagerService.replaceSecretTask(params);
|
|
816
|
+
console.log(JSON.stringify(res.result, null, 2));
|
|
817
|
+
} catch (err) {
|
|
818
|
+
console.warn(err);
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
// end-replace_secret_task
|
|
822
|
+
});
|
|
823
|
+
|
|
723
824
|
test('listSecretsLocks request example', async () => {
|
|
724
825
|
consoleLogMock.mockImplementation((output) => {
|
|
725
826
|
originalLog(output);
|
|
@@ -884,7 +985,7 @@ describe('SecretsManagerV2', () => {
|
|
|
884
985
|
limit: 10,
|
|
885
986
|
sort: 'config_type',
|
|
886
987
|
search: 'example',
|
|
887
|
-
secretTypes: ['iam_credentials', 'public_cert', 'private_cert'],
|
|
988
|
+
secretTypes: ['iam_credentials', 'public_cert', 'private_cert', 'custom_credentials'],
|
|
888
989
|
};
|
|
889
990
|
|
|
890
991
|
const allResults = [];
|
|
@@ -1217,6 +1318,32 @@ describe('SecretsManagerV2', () => {
|
|
|
1217
1318
|
// end-delete_secret
|
|
1218
1319
|
});
|
|
1219
1320
|
|
|
1321
|
+
test('deleteSecretTask request example', async () => {
|
|
1322
|
+
consoleLogMock.mockImplementation((output) => {
|
|
1323
|
+
originalLog(output);
|
|
1324
|
+
});
|
|
1325
|
+
consoleWarnMock.mockImplementation((output) => {
|
|
1326
|
+
// if an error occurs, display the message and then fail the test
|
|
1327
|
+
originalWarn(output);
|
|
1328
|
+
expect(true).toBeFalsy();
|
|
1329
|
+
});
|
|
1330
|
+
|
|
1331
|
+
// begin-delete_secret_task
|
|
1332
|
+
|
|
1333
|
+
const params = {
|
|
1334
|
+
secretId: secretIdForGetSecretLink,
|
|
1335
|
+
id: secretIdForGetSecretLink,
|
|
1336
|
+
};
|
|
1337
|
+
|
|
1338
|
+
try {
|
|
1339
|
+
await secretsManagerService.deleteSecretTask(params);
|
|
1340
|
+
} catch (err) {
|
|
1341
|
+
console.warn(err);
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
// end-delete_secret_task
|
|
1345
|
+
});
|
|
1346
|
+
|
|
1220
1347
|
test('deleteConfiguration request example', async () => {
|
|
1221
1348
|
consoleLogMock.mockImplementation((output) => {
|
|
1222
1349
|
originalLog(output);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibm-cloud/secrets-manager",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.10",
|
|
4
4
|
"description": "Client library for IBM Cloud Secrets Manager",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"extend": "^3.0.2",
|
|
39
|
-
"ibm-cloud-sdk-core": "^5.
|
|
39
|
+
"ibm-cloud-sdk-core": "^5.3.2"
|
|
40
40
|
},
|
|
41
41
|
"jest": {
|
|
42
42
|
"collectCoverage": true,
|