Skip to content

Commit 143acf8

Browse files
authored
Merge pull request #145 from IBM/prerelease
Support for IAM service authorization
2 parents cd13dd8 + bff3b60 commit 143acf8

File tree

5 files changed

+37
-10
lines changed

5 files changed

+37
-10
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ A Node.js client library to interact with the [IBM Cloud® Secrets Manager APIs]
2020
</details>
2121

2222
## Overview
23-
2423
The IBM Cloud Secrets Manager Node.js SDK allows developers to programmatically interact with the following IBM Cloud
2524
services:
2625

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
},
3737
"dependencies": {
3838
"extend": "^3.0.2",
39-
"ibm-cloud-sdk-core": "^5.0.0"
39+
"ibm-cloud-sdk-core": "^5.0.2"
4040
},
4141
"devDependencies": {
4242
"@ibm-cloud/sdk-test-utilities": "^1.0.0",

secrets-manager/v2.ts

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
/**
18-
* IBM OpenAPI SDK Code Generator Version: 3.94.1-71478489-20240820-161623
18+
* IBM OpenAPI SDK Code Generator Version: 3.95.0-d0e386be-20240906-183310
1919
*/
2020

2121
/* eslint-disable max-classes-per-file */
@@ -4155,6 +4155,8 @@ namespace SecretsManagerV2 {
41554155
created_at: string;
41564156
/** The date when a resource was modified. The date format follows `RFC 3339`. */
41574157
updated_at: string;
4158+
/** This parameter indicates whether the API key configuration is disabled. */
4159+
disabled?: boolean;
41584160
/** An IBM Cloud API key that can create and manage service IDs. The API key must be assigned the Editor
41594161
* platform role on the Access Groups Service and the Operator platform role on the IAM Identity Service. For more
41604162
* information, see the
@@ -4210,6 +4212,8 @@ namespace SecretsManagerV2 {
42104212
created_at: string;
42114213
/** The date when a resource was modified. The date format follows `RFC 3339`. */
42124214
updated_at: string;
4215+
/** This parameter indicates whether the API key configuration is disabled. */
4216+
disabled?: boolean;
42134217
}
42144218
export namespace IAMCredentialsConfigurationMetadata {
42154219
export namespace Constants {
@@ -4246,7 +4250,13 @@ namespace SecretsManagerV2 {
42464250
* information, see the
42474251
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-configure-iam-engine).
42484252
*/
4249-
api_key: string;
4253+
api_key?: string;
4254+
/** This parameter indicates whether the API key configuration is disabled.
4255+
*
4256+
* If it is set to `disabled`, the IAM credentials engine doesn't use the configured API key for credentials
4257+
* management.
4258+
*/
4259+
disabled?: boolean;
42504260
}
42514261

42524262
/**
@@ -4266,6 +4276,12 @@ namespace SecretsManagerV2 {
42664276
config_type: IAMCredentialsConfigurationPrototype.Constants.ConfigType | string;
42674277
/** The API key that is used to set the iam_credentials engine. */
42684278
api_key: string;
4279+
/** This parameter indicates whether the API key configuration is disabled.
4280+
*
4281+
* If it is set to `true`, the IAM credentials engine doesn't use the configured API key for credentials
4282+
* management.
4283+
*/
4284+
disabled?: boolean;
42694285
}
42704286
export namespace IAMCredentialsConfigurationPrototype {
42714287
export namespace Constants {
@@ -4361,6 +4377,10 @@ namespace SecretsManagerV2 {
43614377
* include the `access_groups` parameter.
43624378
*/
43634379
service_id?: string;
4380+
/** The ID of the account in which the IAM credentials are created. Use this field only if the target account is
4381+
* not the same as the account of the Secrets Manager instance. Otherwise, the field can be omitted.
4382+
*/
4383+
account_id?: string;
43644384
/** Indicates whether an `iam_credentials` secret was created with a static service ID.
43654385
*
43664386
* If it is set to `true`, the service ID for the secret was provided by the user at secret creation. If it is set
@@ -4499,6 +4519,10 @@ namespace SecretsManagerV2 {
44994519
* include the `access_groups` parameter.
45004520
*/
45014521
service_id?: string;
4522+
/** The ID of the account in which the IAM credentials are created. Use this field only if the target account is
4523+
* not the same as the account of the Secrets Manager instance. Otherwise, the field can be omitted.
4524+
*/
4525+
account_id?: string;
45024526
/** Indicates whether an `iam_credentials` secret was created with a static service ID.
45034527
*
45044528
* If it is set to `true`, the service ID for the secret was provided by the user at secret creation. If it is set
@@ -4642,6 +4666,10 @@ namespace SecretsManagerV2 {
46424666
* include the `access_groups` parameter.
46434667
*/
46444668
service_id?: string;
4669+
/** The ID of the account in which the IAM credentials are created. Use this field only if the target account is
4670+
* not the same as the account of the Secrets Manager instance. Otherwise, the field can be omitted.
4671+
*/
4672+
account_id?: string;
46454673
/** (IAM credentials) This parameter indicates whether to reuse the service ID and API key for future read
46464674
* operations.
46474675
*

test/unit/secrets-manager.v2.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2960,9 +2960,9 @@ describe('SecretsManagerV2', () => {
29602960
const serviceUrl = secretsManagerServiceOptions.url;
29612961
const path = '/api/v2/configurations';
29622962
const mockPagerResponse1 =
2963-
'{"next":{"href":"https://myhost.com/somePath?offset=1"},"total_count":2,"configurations":[{"config_type":"iam_credentials_configuration","name":"my-secret-engine-config","secret_type":"arbitrary","created_by":"iam-ServiceId-e4a2f0a4-3c76-4bef-b1f2-fbeae11c0f21","created_at":"2022-04-12T23:20:50.520Z","updated_at":"2022-04-12T23:20:50.520Z"}],"limit":1}';
2963+
'{"next":{"href":"https://myhost.com/somePath?offset=1"},"total_count":2,"configurations":[{"config_type":"iam_credentials_configuration","name":"my-secret-engine-config","secret_type":"arbitrary","created_by":"iam-ServiceId-e4a2f0a4-3c76-4bef-b1f2-fbeae11c0f21","created_at":"2022-04-12T23:20:50.520Z","updated_at":"2022-04-12T23:20:50.520Z","disabled":true}],"limit":1}';
29642964
const mockPagerResponse2 =
2965-
'{"total_count":2,"configurations":[{"config_type":"iam_credentials_configuration","name":"my-secret-engine-config","secret_type":"arbitrary","created_by":"iam-ServiceId-e4a2f0a4-3c76-4bef-b1f2-fbeae11c0f21","created_at":"2022-04-12T23:20:50.520Z","updated_at":"2022-04-12T23:20:50.520Z"}],"limit":1}';
2965+
'{"total_count":2,"configurations":[{"config_type":"iam_credentials_configuration","name":"my-secret-engine-config","secret_type":"arbitrary","created_by":"iam-ServiceId-e4a2f0a4-3c76-4bef-b1f2-fbeae11c0f21","created_at":"2022-04-12T23:20:50.520Z","updated_at":"2022-04-12T23:20:50.520Z","disabled":true}],"limit":1}';
29662966

29672967
beforeEach(() => {
29682968
unmock_createRequest();

0 commit comments

Comments
 (0)