From d291475a87008a17cc51f228129c929004f0ca80 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Khan Date: Tue, 7 Jan 2025 08:49:24 -0800 Subject: [PATCH 1/2] new services section --- .../AwsCommonRuntimeKit/sdkutils/FileBasedConfiguration.swift | 2 ++ Test/AwsCommonRuntimeKitTests/Resources/example_profile.txt | 3 +++ .../sdkutils/FileBasedConfigurationTests.swift | 3 +++ aws-common-runtime/aws-c-sdkutils | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/AwsCommonRuntimeKit/sdkutils/FileBasedConfiguration.swift b/Source/AwsCommonRuntimeKit/sdkutils/FileBasedConfiguration.swift index d967cedd3..803157178 100644 --- a/Source/AwsCommonRuntimeKit/sdkutils/FileBasedConfiguration.swift +++ b/Source/AwsCommonRuntimeKit/sdkutils/FileBasedConfiguration.swift @@ -135,6 +135,7 @@ extension FileBasedConfiguration { public enum SectionType { case profile case ssoSession + case services } /// Source of file based config @@ -197,6 +198,7 @@ extension FileBasedConfiguration.SectionType { switch self { case .profile: return AWS_PROFILE_SECTION_TYPE_PROFILE case .ssoSession: return AWS_PROFILE_SECTION_TYPE_SSO_SESSION + case .services: return AWS_PROFILE_SECTION_TYPE_SERVICES } } } diff --git a/Test/AwsCommonRuntimeKitTests/Resources/example_profile.txt b/Test/AwsCommonRuntimeKitTests/Resources/example_profile.txt index bfe634507..911cdfd39 100644 --- a/Test/AwsCommonRuntimeKitTests/Resources/example_profile.txt +++ b/Test/AwsCommonRuntimeKitTests/Resources/example_profile.txt @@ -11,3 +11,6 @@ credential_process = echo '{"Version": 1, "AccessKeyId": "AccessKey123", "Secret aws_access_key_id = example_access_key_id aws_secret_access_key = example_secret_access_key +[services test-service] +s3 = test-url + diff --git a/Test/AwsCommonRuntimeKitTests/sdkutils/FileBasedConfigurationTests.swift b/Test/AwsCommonRuntimeKitTests/sdkutils/FileBasedConfigurationTests.swift index 2a69e9254..3542c9c45 100644 --- a/Test/AwsCommonRuntimeKitTests/sdkutils/FileBasedConfigurationTests.swift +++ b/Test/AwsCommonRuntimeKitTests/sdkutils/FileBasedConfigurationTests.swift @@ -31,6 +31,9 @@ class FileBasedConfigurationTests: XCBaseTestCase { XCTAssertEqual("accessKey1", credSection.getProperty(name: "aws_access_key_id")?.value) XCTAssertEqual(credSection.propertyCount, 2) + let servicesSection = fileBasedConfiguration.getSection(name: "test-service", sectionType: .services)! + XCTAssertEqual("test-url", servicesSection.getProperty(name: "s3")?.value) + XCTAssertEqual(servicesSection.propertyCount, 1) } func testCollectionOutOfScope() throws { diff --git a/aws-common-runtime/aws-c-sdkutils b/aws-common-runtime/aws-c-sdkutils index ce09f7976..db8625aea 160000 --- a/aws-common-runtime/aws-c-sdkutils +++ b/aws-common-runtime/aws-c-sdkutils @@ -1 +1 @@ -Subproject commit ce09f79768653dbdc810fc14cad8685dd90acba1 +Subproject commit db8625aea8c38861d1005fe7869cc63909ba454b From 4eccd981ca912a1110a0a95cb3ba7d95ef2b0264 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Khan Date: Wed, 8 Jan 2025 11:37:26 -0800 Subject: [PATCH 2/2] latest sdk utils --- aws-common-runtime/aws-c-sdkutils | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws-common-runtime/aws-c-sdkutils b/aws-common-runtime/aws-c-sdkutils index db8625aea..1ae8664f9 160000 --- a/aws-common-runtime/aws-c-sdkutils +++ b/aws-common-runtime/aws-c-sdkutils @@ -1 +1 @@ -Subproject commit db8625aea8c38861d1005fe7869cc63909ba454b +Subproject commit 1ae8664f90cb5ab5e23b161a31e021c6d3a28e72