Skip to content

Commit

Permalink
new services section
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Jan 7, 2025
1 parent 697efa7 commit d291475
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ extension FileBasedConfiguration {
public enum SectionType {
case profile
case ssoSession
case services
}

/// Source of file based config
Expand Down Expand Up @@ -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
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions Test/AwsCommonRuntimeKitTests/Resources/example_profile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d291475

Please sign in to comment.