Skip to content

Commit

Permalink
Merge pull request #145 from IBM/prerelease
Browse files Browse the repository at this point in the history
Support for IAM service authorization
  • Loading branch information
IdanAdar authored Sep 23, 2024
2 parents cd13dd8 + bff3b60 commit 143acf8
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 10 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ A Node.js client library to interact with the [IBM Cloud® Secrets Manager APIs]
</details>

## Overview

The IBM Cloud Secrets Manager Node.js SDK allows developers to programmatically interact with the following IBM Cloud
services:

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"dependencies": {
"extend": "^3.0.2",
"ibm-cloud-sdk-core": "^5.0.0"
"ibm-cloud-sdk-core": "^5.0.2"
},
"devDependencies": {
"@ibm-cloud/sdk-test-utilities": "^1.0.0",
Expand Down
32 changes: 30 additions & 2 deletions secrets-manager/v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

/**
* IBM OpenAPI SDK Code Generator Version: 3.94.1-71478489-20240820-161623
* IBM OpenAPI SDK Code Generator Version: 3.95.0-d0e386be-20240906-183310
*/

/* eslint-disable max-classes-per-file */
Expand Down Expand Up @@ -4155,6 +4155,8 @@ namespace SecretsManagerV2 {
created_at: string;
/** The date when a resource was modified. The date format follows `RFC 3339`. */
updated_at: string;
/** This parameter indicates whether the API key configuration is disabled. */
disabled?: boolean;
/** An IBM Cloud API key that can create and manage service IDs. The API key must be assigned the Editor
* platform role on the Access Groups Service and the Operator platform role on the IAM Identity Service. For more
* information, see the
Expand Down Expand Up @@ -4210,6 +4212,8 @@ namespace SecretsManagerV2 {
created_at: string;
/** The date when a resource was modified. The date format follows `RFC 3339`. */
updated_at: string;
/** This parameter indicates whether the API key configuration is disabled. */
disabled?: boolean;
}
export namespace IAMCredentialsConfigurationMetadata {
export namespace Constants {
Expand Down Expand Up @@ -4246,7 +4250,13 @@ namespace SecretsManagerV2 {
* information, see the
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-configure-iam-engine).
*/
api_key: string;
api_key?: string;
/** This parameter indicates whether the API key configuration is disabled.
*
* If it is set to `disabled`, the IAM credentials engine doesn't use the configured API key for credentials
* management.
*/
disabled?: boolean;
}

/**
Expand All @@ -4266,6 +4276,12 @@ namespace SecretsManagerV2 {
config_type: IAMCredentialsConfigurationPrototype.Constants.ConfigType | string;
/** The API key that is used to set the iam_credentials engine. */
api_key: string;
/** This parameter indicates whether the API key configuration is disabled.
*
* If it is set to `true`, the IAM credentials engine doesn't use the configured API key for credentials
* management.
*/
disabled?: boolean;
}
export namespace IAMCredentialsConfigurationPrototype {
export namespace Constants {
Expand Down Expand Up @@ -4361,6 +4377,10 @@ namespace SecretsManagerV2 {
* include the `access_groups` parameter.
*/
service_id?: string;
/** The ID of the account in which the IAM credentials are created. Use this field only if the target account is
* not the same as the account of the Secrets Manager instance. Otherwise, the field can be omitted.
*/
account_id?: string;
/** Indicates whether an `iam_credentials` secret was created with a static service ID.
*
* If it is set to `true`, the service ID for the secret was provided by the user at secret creation. If it is set
Expand Down Expand Up @@ -4499,6 +4519,10 @@ namespace SecretsManagerV2 {
* include the `access_groups` parameter.
*/
service_id?: string;
/** The ID of the account in which the IAM credentials are created. Use this field only if the target account is
* not the same as the account of the Secrets Manager instance. Otherwise, the field can be omitted.
*/
account_id?: string;
/** Indicates whether an `iam_credentials` secret was created with a static service ID.
*
* If it is set to `true`, the service ID for the secret was provided by the user at secret creation. If it is set
Expand Down Expand Up @@ -4642,6 +4666,10 @@ namespace SecretsManagerV2 {
* include the `access_groups` parameter.
*/
service_id?: string;
/** The ID of the account in which the IAM credentials are created. Use this field only if the target account is
* not the same as the account of the Secrets Manager instance. Otherwise, the field can be omitted.
*/
account_id?: string;
/** (IAM credentials) This parameter indicates whether to reuse the service ID and API key for future read
* operations.
*
Expand Down
4 changes: 2 additions & 2 deletions test/unit/secrets-manager.v2.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2960,9 +2960,9 @@ describe('SecretsManagerV2', () => {
const serviceUrl = secretsManagerServiceOptions.url;
const path = '/api/v2/configurations';
const mockPagerResponse1 =
'{"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}';
'{"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}';
const mockPagerResponse2 =
'{"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}';
'{"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}';

beforeEach(() => {
unmock_createRequest();
Expand Down

0 comments on commit 143acf8

Please sign in to comment.