Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package aws-c-auth for openSUSE:Factory 
checked in at 2026-08-06 16:24:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/aws-c-auth (Old)
 and      /work/SRC/openSUSE:Factory/.aws-c-auth.new.16738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "aws-c-auth"

Thu Aug  6 16:24:08 2026 rev:28 rq:1369679 version:0.10.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/aws-c-auth/aws-c-auth.changes    2026-05-26 
16:35:23.731381724 +0200
+++ /work/SRC/openSUSE:Factory/.aws-c-auth.new.16738/aws-c-auth.changes 
2026-08-06 16:25:50.792075235 +0200
@@ -1,0 +2,9 @@
+Tue Aug  4 11:24:31 UTC 2026 - John Paul Adrian Glaubitz 
<[email protected]>
+
+- Update to version 0.10.4
+  * Support s2n-tls on macOS by @sfod in (#296)
+  * Regression Labeler Fix by @azkrishpy in (#297)
+  * profile credentials provider should support sts web identity
+    as well by @TingDaoK in (#298)
+
+-------------------------------------------------------------------

Old:
----
  v0.10.3.tar.gz

New:
----
  v0.10.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ aws-c-auth.spec ++++++
--- /var/tmp/diff_new_pack.P4d2nD/_old  2026-08-06 16:25:52.212124814 +0200
+++ /var/tmp/diff_new_pack.P4d2nD/_new  2026-08-06 16:25:52.216124954 +0200
@@ -20,7 +20,7 @@
 %define library_pkg 1_0_0
 %define library_soversion 1
 Name:           aws-c-auth
-Version:        0.10.3
+Version:        0.10.4
 Release:        0
 Summary:        AWS C99 library implementation of AWS client-side 
authentication
 License:        Apache-2.0

++++++ v0.10.3.tar.gz -> v0.10.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aws-c-auth-0.10.3/.github/workflows/ci.yml 
new/aws-c-auth-0.10.4/.github/workflows/ci.yml
--- old/aws-c-auth-0.10.3/.github/workflows/ci.yml      2026-05-22 
01:57:32.000000000 +0200
+++ new/aws-c-auth-0.10.4/.github/workflows/ci.yml      2026-07-10 
19:12:16.000000000 +0200
@@ -167,8 +167,38 @@
       run: |
         python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ 
env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION 
}}/builder.pyz?run=${{ env.RUN }}', 'builder')"
         chmod a+x builder
+        ./builder build -p ${{ env.PACKAGE_NAME }} 
--cmake-extra=-DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON
+
+  macos-s2n:
+    runs-on: macos-14 # latest
+    env:
+      AWS_CRT_USE_NON_FIPS_TLS_13: 1
+    steps:
+    - uses: aws-actions/configure-aws-credentials@v4
+      with:
+        role-to-assume: ${{ env.CRT_CI_ROLE }}
+        aws-region: ${{ env.AWS_DEFAULT_REGION }}
+    - name: Build ${{ env.PACKAGE_NAME }} + consumers
+      run: |
+        python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ 
env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION 
}}/builder.pyz?run=${{ env.RUN }}', 'builder')"
+        chmod a+x builder
         ./builder build -p ${{ env.PACKAGE_NAME }}
 
+  macos-x64-s2n:
+    runs-on: macos-14-large # latest
+    env:
+      AWS_CRT_USE_NON_FIPS_TLS_13: 1
+    steps:
+    - uses: aws-actions/configure-aws-credentials@v4
+      with:
+        role-to-assume: ${{ env.CRT_CI_ROLE }}
+        aws-region: ${{ env.AWS_DEFAULT_REGION }}
+    - name: Build ${{ env.PACKAGE_NAME }} + consumers
+      run: |
+        python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ 
env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION 
}}/builder.pyz?run=${{ env.RUN }}', 'builder')"
+        chmod a+x builder
+        ./builder build -p ${{ env.PACKAGE_NAME }} 
--cmake-extra=-DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON
+
   # Test downstream repos.
   # This should not be required because we can run into a chicken and egg 
problem if there is a change that needs some fix in a downstream repo.
   downstream:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/aws-c-auth-0.10.3/.github/workflows/issue-regression-labeler.yml 
new/aws-c-auth-0.10.4/.github/workflows/issue-regression-labeler.yml
--- old/aws-c-auth-0.10.3/.github/workflows/issue-regression-labeler.yml        
2026-05-22 01:57:32.000000000 +0200
+++ new/aws-c-auth-0.10.4/.github/workflows/issue-regression-labeler.yml        
2026-07-10 19:12:16.000000000 +0200
@@ -24,9 +24,12 @@
     - name: Manage regression label
       env:
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        IS_REGRESSION: ${{ steps.check_regression.outputs.is_regression }}
+        ISSUE_NUMBER: ${{ github.event.issue.number }}
+        REPO: ${{ github.repository }}
       run: |
-        if [ "${{ steps.check_regression.outputs.is_regression }}" == "true" 
]; then
-          gh issue edit ${{ github.event.issue.number }} --add-label 
"potential-regression" -R ${{ github.repository }}
+        if [ "$IS_REGRESSION" == "true" ]; then
+          gh issue edit "$ISSUE_NUMBER" --add-label "potential-regression" -R 
"$REPO"
         else
-          gh issue edit ${{ github.event.issue.number }} --remove-label 
"potential-regression" -R ${{ github.repository }}
+          gh issue edit "$ISSUE_NUMBER" --remove-label "potential-regression" 
-R "$REPO"
         fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/aws-c-auth-0.10.3/source/credentials_provider_profile.c 
new/aws-c-auth-0.10.4/source/credentials_provider_profile.c
--- old/aws-c-auth-0.10.3/source/credentials_provider_profile.c 2026-05-22 
01:57:32.000000000 +0200
+++ new/aws-c-auth-0.10.4/source/credentials_provider_profile.c 2026-07-10 
19:12:16.000000000 +0200
@@ -29,6 +29,7 @@
 AWS_STRING_FROM_LITERAL(s_access_key_id_profile_var, "aws_access_key_id");
 AWS_STRING_FROM_LITERAL(s_secret_access_key_profile_var, 
"aws_secret_access_key");
 AWS_STATIC_STRING_FROM_LITERAL(s_credentials_process, "credential_process");
+AWS_STATIC_STRING_FROM_LITERAL(s_web_identity_token_file_name, 
"web_identity_token_file");
 
 static struct aws_byte_cursor s_default_session_name_pfx =
     AWS_BYTE_CUR_INIT_FROM_STRING_LITERAL("aws-common-runtime-profile-config");
@@ -240,7 +241,18 @@
     const struct aws_credentials_provider_profile_options *options,
     struct aws_hash_table *source_profiles_table);
 
-/* use the selected property that specifies a role_arn to load an STS based 
provider. */
+/*
+ * Create a credentials provider for a profile that has role_arn set.
+ *
+ * The credential source for the assume-role operation is resolved in the 
following
+ * priority order:
+ *
+ *   2. Profile: assume role with source_profile
+ *   3. Profile: assume role with credential_source (Ec2InstanceMetadata, 
Environment, EcsContainer)
+ *   4. Profile: web identity token (web_identity_token_file)
+ *
+ * If none of these are present, the function returns NULL.
+ */
 static struct aws_credentials_provider *s_create_sts_based_provider(
     struct aws_allocator *allocator,
     const struct aws_profile_property *role_arn_property,
@@ -262,6 +274,8 @@
         aws_profile_get_property(profile, s_source_profile_name);
     const struct aws_profile_property *credential_source_property =
         aws_profile_get_property(profile, s_credential_source_name);
+    const struct aws_profile_property *web_identity_token_file_property =
+        aws_profile_get_property(profile, s_web_identity_token_file_name);
 
     /* role_session_name */
     const struct aws_profile_property *role_session_name = 
aws_profile_get_property(profile, s_role_session_name_name);
@@ -432,12 +446,46 @@
                 
aws_string_c_str(aws_profile_property_get_value(credential_source_property)));
             aws_raise_error(AWS_ERROR_INVALID_ARGUMENT);
         }
+    } else if (web_identity_token_file_property) {
+        /*
+         * Neither source_profile nor credential_source is set.
+         * Check if web_identity_token_file is available as the credential 
source.
+         */
+        AWS_LOGF_INFO(
+            AWS_LS_AUTH_CREDENTIALS_PROVIDER,
+            "static: profile %s has role_arn and web_identity_token_file, 
attempting to create an STS web identity "
+            "credentials provider.",
+            aws_string_c_str(aws_profile_get_name(profile)));
+
+        struct aws_credentials_provider_sts_web_identity_options 
web_identity_options = {
+            .bootstrap = options->bootstrap,
+            .tls_ctx = tls_ctx,
+            .function_table = options->function_table,
+            .proxy_ev_settings = options->proxy_ev_settings,
+            .config_profile_collection_cached = merged_profiles,
+            .profile_name_override = 
aws_byte_cursor_from_string(aws_profile_get_name(profile)),
+            .shutdown_options = options->shutdown_options,
+        };
+        provider = aws_credentials_provider_new_sts_web_identity(allocator, 
&web_identity_options);
     }
 done:
     aws_tls_ctx_release(tls_ctx);
     return provider;
 }
 
+/*
+ * Resolve credentials from a profile. The credential source is determined by 
the following
+ * priority order:
+ *
+ *   1. Profile: static credentials (aws_access_key_id / aws_secret_access_key)
+ *   2. Profile: assume role with source_profile
+ *   3. Profile: assume role with credential_source
+ *   4. Profile: web identity token (web_identity_token_file)
+ *   5. Profile: SSO (not yet supported from profile provider)
+ *   6. Profile: legacy SSO (not yet supported from profile provider)
+ *   7. Profile: login (not yet supported from profile provider)
+ *   8. Profile: process (credential_process)
+ */
 static struct aws_credentials_provider 
*s_credentials_provider_new_profile_internal(
     struct aws_allocator *allocator,
     const struct aws_credentials_provider_profile_options *options,
@@ -544,6 +592,9 @@
         provider = s_create_sts_based_provider(
             allocator, role_arn_property, profile, options, merged_profiles, 
source_profiles_table);
     } else if (process_property && !profile_contains_credentials) {
+        /* TODO: SSO (priority 9), legacy SSO (priority 10), and login 
(priority 11) credentials providers
+         * are not yet supported within the profile credentials provider. They 
should be resolved here
+         * before falling through to credential_process (priority 12) per the 
credentials-provider-chain SEP. */
         provider = s_create_process_based_provider(allocator, profile_name, 
merged_profiles);
     } else {
         provider = s_create_profile_based_provider(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/aws-c-auth-0.10.3/tests/CMakeLists.txt 
new/aws-c-auth-0.10.4/tests/CMakeLists.txt
--- old/aws-c-auth-0.10.3/tests/CMakeLists.txt  2026-05-22 01:57:32.000000000 
+0200
+++ new/aws-c-auth-0.10.4/tests/CMakeLists.txt  2026-07-10 19:12:16.000000000 
+0200
@@ -93,6 +93,7 @@
 add_net_test_case(credentials_provider_sts_web_identity_success_multi_part_doc)
 add_net_test_case(credentials_provider_sts_web_identity_real_new_destroy)
 
add_net_test_case(credentials_provider_sts_web_identity_proxy_routing_enabled_test)
+add_net_test_case(credentials_provider_profile_with_web_identity_config)
 
 add_net_test_case(credentials_provider_sts_direct_config_succeeds)
 
add_net_test_case(credentials_provider_sts_direct_config_with_external_id_succeeds)
@@ -117,6 +118,7 @@
 
add_net_test_case(credentials_provider_sts_from_profile_config_environment_succeeds)
 add_net_test_case(credentials_provider_sts_cache_expiration_conflict)
 add_net_test_case(credentials_provider_sts_proxy_routing_enabled_test)
+add_net_test_case(credentials_provider_sts_from_profile_config_with_web_identity_source)
 
 add_test_case(credentials_provider_process_new_destroy_from_config)
 
add_test_case(credentials_provider_process_new_destroy_from_config_without_token)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/aws-c-auth-0.10.3/tests/credentials_provider_sts_tests.c 
new/aws-c-auth-0.10.4/tests/credentials_provider_sts_tests.c
--- old/aws-c-auth-0.10.3/tests/credentials_provider_sts_tests.c        
2026-05-22 01:57:32.000000000 +0200
+++ new/aws-c-auth-0.10.4/tests/credentials_provider_sts_tests.c        
2026-07-10 19:12:16.000000000 +0200
@@ -210,7 +210,6 @@
     const struct aws_http_make_request_options *options) {
 
     (void)client_connection;
-    (void)options;
     struct aws_mock_http_request *mocked_request = 
&s_tester.mocked_requests[s_tester.num_request++];
     AWS_ZERO_STRUCT(*mocked_request);
     struct aws_byte_cursor path;
@@ -252,18 +251,15 @@
         aws_byte_buf_init(&mocked_request->body, s_tester.allocator, 
(size_t)body_len);
         aws_input_stream_read(input_stream, &mocked_request->body);
     }
-    bool fail_request = false;
 
     if (s_tester.fail_operations) {
-        fail_request = true;
         s_tester.fail_operations--;
         mocked_request->response_code = s_tester.mock_failure_code;
     } else {
         mocked_request->response_code = s_tester.mock_response_code;
     }
-    s_invoke_mock_request_callbacks(options, !fail_request);
 
-    return (struct aws_http_stream *)1;
+    return (struct aws_http_stream *)options;
 }
 
 static int s_aws_http_stream_get_incoming_response_status_mock(
@@ -277,7 +273,9 @@
 }
 
 static int s_aws_http_stream_activate_mock(struct aws_http_stream *stream) {
-    (void)stream;
+    struct aws_http_make_request_options *options = (struct 
aws_http_make_request_options *)stream;
+    bool fail_request = s_tester.fail_operations;
+    s_invoke_mock_request_callbacks(options, !fail_request);
     return AWS_OP_SUCCESS;
 }
 
@@ -2278,3 +2276,132 @@
 AWS_TEST_CASE(
     credentials_provider_sts_proxy_routing_enabled_test,
     s_credentials_provider_sts_proxy_routing_enabled_test)
+
+/*
+ * Profile chaining with web_identity_token_file in source_profile fails.
+ *
+ * Config:
+ *   [default]
+ *   role_arn = <customer-role>
+ *   source_profile = irsa-hop1
+ *
+ *   [irsa-hop1]
+ *   role_arn = <intermediary-role>
+ *   web_identity_token_file = /path/to/token
+ *
+ * Expected: provider construction succeeds (two-hop chain: web_identity -> 
STS assume -> STS assume).
+ */
+static const char *s_source_profile_web_identity_config_file =
+    "[profile default]\n"
+    "role_arn=arn:aws:iam::111122223333:role/customer-role\n"
+    "source_profile=irsa-hop1\n"
+    "\n"
+    "[profile irsa-hop1]\n"
+    "role_arn=arn:aws:iam::111122223333:role/intermediary-role\n"
+    "region=us-east-1\n"
+    "web_identity_token_file=";
+
+static int 
s_credentials_provider_sts_from_profile_config_with_web_identity_source_fn(
+    struct aws_allocator *allocator,
+    void *ctx) {
+    (void)ctx;
+
+    aws_unset_environment_value(s_default_profile_env_variable_name);
+    aws_unset_environment_value(s_default_config_path_env_variable_name);
+    aws_unset_environment_value(s_default_credentials_path_env_variable_name);
+
+    s_aws_sts_tester_init(allocator);
+    s_tester.expected_connection_manager_shutdown_callback_count = 2;
+
+    /* Create a fake token file */
+    struct aws_string *token_file_path = 
aws_create_process_unique_file_name(allocator);
+    struct aws_string *token_contents = aws_string_new_from_c_str(allocator, 
"fake-oidc-token-12345");
+    ASSERT_SUCCESS(aws_create_profile_file(token_file_path, token_contents));
+    aws_string_destroy(token_contents);
+
+    /* Build config: static prefix + token_file_path + newline */
+    struct aws_byte_buf config_buf;
+    aws_byte_buf_init(&config_buf, allocator, 512);
+    struct aws_byte_cursor cursor = 
aws_byte_cursor_from_c_str(s_source_profile_web_identity_config_file);
+    ASSERT_SUCCESS(aws_byte_buf_append_dynamic(&config_buf, &cursor));
+    cursor = aws_byte_cursor_from_string(token_file_path);
+    ASSERT_SUCCESS(aws_byte_buf_append_dynamic(&config_buf, &cursor));
+    cursor = aws_byte_cursor_from_c_str("\n");
+    ASSERT_SUCCESS(aws_byte_buf_append_dynamic(&config_buf, &cursor));
+
+    struct aws_string *config_contents = aws_string_new_from_array(allocator, 
config_buf.buffer, config_buf.len);
+    aws_byte_buf_clean_up(&config_buf);
+
+    struct aws_string *config_file_str = 
aws_create_process_unique_file_name(allocator);
+    struct aws_string *creds_file_str = 
aws_create_process_unique_file_name(allocator);
+
+    ASSERT_SUCCESS(aws_create_profile_file(config_file_str, config_contents));
+    aws_string_destroy(config_contents);
+
+    struct aws_credentials_provider_profile_options options = {
+        .config_file_name_override = 
aws_byte_cursor_from_string(config_file_str),
+        .credentials_file_name_override = 
aws_byte_cursor_from_string(creds_file_str),
+        .profile_name_override = aws_byte_cursor_from_c_str("default"),
+        .bootstrap = s_tester.bootstrap,
+        .tls_ctx = s_tester.tls_ctx,
+        .function_table = &s_mock_function_table,
+        .shutdown_options =
+            {
+                .shutdown_callback = s_on_provider_shutdown,
+            },
+    };
+
+    /* Push response data for the two STS calls:
+     * 1st: AssumeRoleWithWebIdentity response (for irsa-hop1's web identity 
provider)
+     * 2nd: AssumeRole response (for default's STS provider) */
+    static struct aws_byte_cursor s_web_identity_response_doc =
+        
AWS_BYTE_CUR_INIT_FROM_STRING_LITERAL("<AssumeRoleWithWebIdentityResponse>"
+                                              "    
<AssumeRoleWithWebIdentityResult>"
+                                              "        <AssumedRoleUser>"
+                                              "            
<Arn>arn:aws:sts::123456789012:assumed-role/role/app</Arn>"
+                                              "            
<AssumedRoleId>AROA:app</AssumedRoleId>"
+                                              "        </AssumedRoleUser>"
+                                              "        <Credentials>"
+                                              "            
<AccessKeyId>accessKey12345</AccessKeyId>"
+                                              "            
<SecretAccessKey>secretKey12345</SecretAccessKey>"
+                                              "            
<SessionToken>sessionToken123456789</SessionToken>"
+                                              "            
<Expiration>2099-01-01T00:00:00Z</Expiration>"
+                                              "        </Credentials>"
+                                              "    
</AssumeRoleWithWebIdentityResult>"
+                                              
"</AssumeRoleWithWebIdentityResponse>");
+    aws_array_list_push_back(&s_tester.response_data_callbacks, 
&s_web_identity_response_doc);
+    aws_array_list_push_back(&s_tester.response_data_callbacks, 
&s_success_creds_doc);
+    s_tester.mock_response_code = 200;
+
+    /*
+     * With the fix in place, the profile provider detects 
web_identity_token_file in irsa-hop1
+     * and creates an STS web identity provider. The chain is:
+     *   1. AssumeRoleWithWebIdentity (using the token file) for irsa-hop1's 
role_arn
+     *   2. AssumeRole (using creds from step 1) for default's role_arn
+     */
+    struct aws_credentials_provider *provider = 
aws_credentials_provider_new_profile(allocator, &options);
+    ASSERT_NOT_NULL(provider);
+
+    aws_credentials_provider_get_credentials(provider, 
s_get_credentials_callback, NULL);
+
+    s_aws_wait_for_credentials_result();
+
+    ASSERT_SUCCESS(s_verify_credentials(s_tester.credentials));
+
+    aws_credentials_provider_release(provider);
+    s_aws_wait_for_connection_manager_shutdown_callback();
+    s_aws_wait_for_provider_shutdown_callback();
+
+    aws_file_delete(token_file_path);
+    aws_file_delete(config_file_str);
+
+    aws_string_destroy(token_file_path);
+    aws_string_destroy(config_file_str);
+    aws_string_destroy(creds_file_str);
+    ASSERT_SUCCESS(s_aws_sts_tester_cleanup());
+
+    return AWS_OP_SUCCESS;
+}
+AWS_TEST_CASE(
+    credentials_provider_sts_from_profile_config_with_web_identity_source,
+    s_credentials_provider_sts_from_profile_config_with_web_identity_source_fn)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/aws-c-auth-0.10.3/tests/credentials_provider_sts_web_identity_tests.c 
new/aws-c-auth-0.10.4/tests/credentials_provider_sts_web_identity_tests.c
--- old/aws-c-auth-0.10.3/tests/credentials_provider_sts_web_identity_tests.c   
2026-05-22 01:57:32.000000000 +0200
+++ new/aws-c-auth-0.10.4/tests/credentials_provider_sts_web_identity_tests.c   
2026-07-10 19:12:16.000000000 +0200
@@ -1387,3 +1387,98 @@
 AWS_TEST_CASE(
     credentials_provider_sts_web_identity_proxy_routing_enabled_test,
     s_credentials_provider_sts_web_identity_proxy_routing_enabled_test);
+
+/*
+ * aws_credentials_provider_new_profile should support web_identity_token_file
+ * in a profile's configuration (without source_profile or credential_source).
+ *
+ * This is the same scenario as basic_success_config above, but exercises the
+ * code path through the profile provider rather than calling
+ * aws_credentials_provider_new_sts_web_identity directly.
+ *
+ * Config:
+ *   [profile foo]
+ *   region = us-west-2
+ *   role_arn = arn:aws:iam::3333333333:role/test-arn
+ *   role_session_name = 4444444444
+ *   web_identity_token_file = <path>
+ *
+ * Expected: profile provider detects web_identity_token_file, creates an STS
+ *           web identity provider internally, and returns credentials.
+ */
+static int s_credentials_provider_profile_with_web_identity_config(struct 
aws_allocator *allocator, void *ctx) {
+    (void)ctx;
+
+    s_aws_sts_web_identity_tester_init(allocator);
+
+    s_aws_sts_web_identity_test_unset_env_parameters();
+
+    /* Create a real token file on disk */
+    struct aws_string *token_file_path_str = 
aws_create_process_unique_file_name(allocator);
+    ASSERT_TRUE(token_file_path_str != NULL);
+    ASSERT_TRUE(aws_create_profile_file(token_file_path_str, 
s_sts_web_identity_token_contents) == AWS_OP_SUCCESS);
+
+    /* Build config file content with the token file path */
+    struct aws_byte_buf content_buf;
+    struct aws_byte_buf existing_content =
+        
aws_byte_buf_from_c_str(aws_string_c_str(s_sts_web_identity_config_file_contents));
+    aws_byte_buf_init_copy(&content_buf, allocator, &existing_content);
+    struct aws_byte_cursor cursor = 
aws_byte_cursor_from_string(token_file_path_str);
+    ASSERT_TRUE(aws_byte_buf_append_dynamic(&content_buf, &cursor) == 
AWS_OP_SUCCESS);
+    cursor = aws_byte_cursor_from_c_str("\n");
+    ASSERT_TRUE(aws_byte_buf_append_dynamic(&content_buf, &cursor) == 
AWS_OP_SUCCESS);
+
+    struct aws_string *config_file_contents = 
aws_string_new_from_array(allocator, content_buf.buffer, content_buf.len);
+    ASSERT_TRUE(config_file_contents != NULL);
+    aws_byte_buf_clean_up(&content_buf);
+
+    /* Write config file and set environment to point to it */
+    struct aws_string *config_file_path_str = 
aws_create_process_unique_file_name(allocator);
+    ASSERT_TRUE(config_file_path_str != NULL);
+    ASSERT_TRUE(aws_create_profile_file(config_file_path_str, 
config_file_contents) == AWS_OP_SUCCESS);
+    aws_string_destroy(config_file_contents);
+
+    /* Push the mock response for AssumeRoleWithWebIdentity */
+    struct aws_byte_cursor good_response_cursor = 
aws_byte_cursor_from_string(s_good_response);
+    aws_array_list_push_back(&s_tester.response_data_callbacks, 
&good_response_cursor);
+
+    /* Use aws_credentials_provider_new_profile instead of 
aws_credentials_provider_new_sts_web_identity */
+    struct aws_credentials_provider_profile_options options = {
+        .config_file_name_override = 
aws_byte_cursor_from_string(config_file_path_str),
+        .profile_name_override = aws_byte_cursor_from_c_str("foo"),
+        .bootstrap = NULL,
+        .tls_ctx = s_tester.tls_ctx,
+        .function_table = &s_mock_function_table,
+        .shutdown_options =
+            {
+                .shutdown_callback = s_on_shutdown_complete,
+                .shutdown_user_data = NULL,
+            },
+    };
+
+    struct aws_credentials_provider *provider = 
aws_credentials_provider_new_profile(allocator, &options);
+
+    ASSERT_NOT_NULL(provider);
+
+    aws_credentials_provider_get_credentials(provider, 
s_get_credentials_callback, NULL);
+
+    s_aws_wait_for_credentials_result();
+
+    ASSERT_SUCCESS(
+        s_verify_credentials(true /*request made*/, true /*from config*/, true 
/*get creds*/, 1 /*expected attempts*/));
+
+    aws_credentials_provider_release(provider);
+
+    s_aws_wait_for_provider_shutdown_callback();
+
+    aws_file_delete(config_file_path_str);
+    aws_file_delete(token_file_path_str);
+    aws_string_destroy(config_file_path_str);
+    aws_string_destroy(token_file_path_str);
+    s_aws_sts_web_identity_tester_cleanup();
+
+    return 0;
+}
+AWS_TEST_CASE(
+    credentials_provider_profile_with_web_identity_config,
+    s_credentials_provider_profile_with_web_identity_config);

Reply via email to