From 24285e8278d083feb9df1ab4357d4105dbedb89b Mon Sep 17 00:00:00 2001 From: Haim Date: Tue, 17 Sep 2024 17:17:41 +0300 Subject: [PATCH 1/3] IAM credetials secrets with S2S authorization Signed-off-by: Haim --- package-lock.json | 8 ++++---- package.json | 2 +- secrets-manager/v2.ts | 30 ++++++++++++++++++++++++++++-- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index a7be5a3..521336f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "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", @@ -5828,9 +5828,9 @@ } }, "node_modules/ibm-cloud-sdk-core": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ibm-cloud-sdk-core/-/ibm-cloud-sdk-core-5.0.1.tgz", - "integrity": "sha512-87Iv6RLP9RD2/Ae8tBgHyfYJjlUm6OtxZB7CydiVBOZJ6u9c+G02ShlZnATrjdMgz8KurIid4T7pw+bP988uiQ==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/ibm-cloud-sdk-core/-/ibm-cloud-sdk-core-5.0.2.tgz", + "integrity": "sha512-uyRvK0h+rb/Y2MBV3UEtss5V9c8x7PaPFvFek9BaulL3mZHR4HNvVC0ulqGobvvRR3c8fFihZ2zmAqzA0s22Fw==", "dependencies": { "@types/debug": "^4.1.12", "@types/node": "~10.14.19", diff --git a/package.json b/package.json index 3c60cbc..d9ab3ce 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/secrets-manager/v2.ts b/secrets-manager/v2.ts index 19bbaad..e9fb5ab 100644 --- a/secrets-manager/v2.ts +++ b/secrets-manager/v2.ts @@ -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 */ @@ -4161,6 +4161,8 @@ namespace SecretsManagerV2 { * [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-configure-iam-engine). */ api_key?: string; + /** This parameter indicates whether the API key configuration is disabled. */ + disabled: boolean; } export namespace IAMCredentialsConfiguration { export namespace Constants { @@ -4246,7 +4248,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; } /** @@ -4266,6 +4274,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 { @@ -4361,6 +4375,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 @@ -4499,6 +4517,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 @@ -4642,6 +4664,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. * From cb50781e64dcfb2f31e59b7df67dafe6df8cac41 Mon Sep 17 00:00:00 2001 From: Haim Date: Wed, 18 Sep 2024 14:45:19 +0300 Subject: [PATCH 2/3] IAM credetials secrets with S2S authorization Signed-off-by: Haim --- secrets-manager/v2.ts | 6 ++++-- test/unit/secrets-manager.v2.test.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/secrets-manager/v2.ts b/secrets-manager/v2.ts index e9fb5ab..46404d5 100644 --- a/secrets-manager/v2.ts +++ b/secrets-manager/v2.ts @@ -4155,14 +4155,14 @@ 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 * [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-configure-iam-engine). */ api_key?: string; - /** This parameter indicates whether the API key configuration is disabled. */ - disabled: boolean; } export namespace IAMCredentialsConfiguration { export namespace Constants { @@ -4212,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 { diff --git a/test/unit/secrets-manager.v2.test.js b/test/unit/secrets-manager.v2.test.js index 5baa3ea..057d842 100644 --- a/test/unit/secrets-manager.v2.test.js +++ b/test/unit/secrets-manager.v2.test.js @@ -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(); From bff3b606415039e9ca74c8910f5771d7656200c5 Mon Sep 17 00:00:00 2001 From: Idan Adar Date: Mon, 23 Sep 2024 07:06:51 +0300 Subject: [PATCH 3/3] patch: support for IAM service authorization --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 630192a..f31eb64 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,6 @@ A Node.js client library to interact with the [IBM Cloud® Secrets Manager APIs] ## Overview - The IBM Cloud Secrets Manager Node.js SDK allows developers to programmatically interact with the following IBM Cloud services: