From 4c3189a2ea4f9f321b2a90dd7a4da820c0682a69 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Khan Date: Tue, 28 Jan 2025 14:41:36 -0800 Subject: [PATCH] lint --- source/aws_profile.c | 3 ++- source/credentials.c | 7 ++++++- source/credentials_provider_environment.c | 5 ++--- tests/credentials_provider_ecs_tests.c | 4 +++- tests/credentials_tests.c | 7 ++++--- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/source/aws_profile.c b/source/aws_profile.c index 4f6db9df..1195c70e 100644 --- a/source/aws_profile.c +++ b/source/aws_profile.c @@ -38,5 +38,6 @@ struct aws_credentials *aws_credentials_new_from_profile( const struct aws_string *session_token = s_profile_get_property_value(profile, s_session_token_profile_var); const struct aws_string *account_id = s_profile_get_property_value(profile, s_account_id_profile_var); - return aws_credentials_new_from_string_with_account_id(allocator, access_key, secret_key, session_token, account_id, UINT64_MAX); + return aws_credentials_new_from_string_with_account_id( + allocator, access_key, secret_key, session_token, account_id, UINT64_MAX); } diff --git a/source/credentials.c b/source/credentials.c index bfe77b06..4cc1392c 100644 --- a/source/credentials.c +++ b/source/credentials.c @@ -362,7 +362,12 @@ struct aws_credentials *aws_credentials_new_from_string_with_account_id( } return aws_credentials_new_with_account_id( - allocator, access_key_cursor, secret_access_key_cursor, session_token_cursor, account_id_cursor, expiration_timepoint_seconds); + allocator, + access_key_cursor, + secret_access_key_cursor, + session_token_cursor, + account_id_cursor, + expiration_timepoint_seconds); } struct aws_credentials *aws_credentials_new_ecc( diff --git a/source/credentials_provider_environment.c b/source/credentials_provider_environment.c index 0c6096d8..64f49c56 100644 --- a/source/credentials_provider_environment.c +++ b/source/credentials_provider_environment.c @@ -34,9 +34,8 @@ static int s_credentials_provider_environment_get_credentials_async( aws_get_environment_value(allocator, s_account_id_env_var, &account_id); if (access_key_id != NULL && access_key_id->len > 0 && secret_access_key != NULL && secret_access_key->len > 0) { - credentials = - aws_credentials_new_from_string_with_account_id(allocator, access_key_id, secret_access_key, session_token, account_id - ,UINT64_MAX); + credentials = aws_credentials_new_from_string_with_account_id( + allocator, access_key_id, secret_access_key, session_token, account_id, UINT64_MAX); if (credentials == NULL) { error_code = aws_last_error(); } diff --git a/tests/credentials_provider_ecs_tests.c b/tests/credentials_provider_ecs_tests.c index 1e3a5e85..ddb49688 100644 --- a/tests/credentials_provider_ecs_tests.c +++ b/tests/credentials_provider_ecs_tests.c @@ -781,7 +781,9 @@ static int s_credentials_provider_ecs_basic_success_with_account_id(struct aws_a return 0; } -AWS_TEST_CASE(credentials_provider_ecs_basic_success_with_account_id, s_credentials_provider_ecs_basic_success_with_account_id); +AWS_TEST_CASE( + credentials_provider_ecs_basic_success_with_account_id, + s_credentials_provider_ecs_basic_success_with_account_id); static int s_credentials_provider_ecs_basic_success_token_file(struct aws_allocator *allocator, void *ctx) { (void)ctx; diff --git a/tests/credentials_tests.c b/tests/credentials_tests.c index 593e2d8c..7fb0ce89 100644 --- a/tests/credentials_tests.c +++ b/tests/credentials_tests.c @@ -914,7 +914,9 @@ AWS_STATIC_STRING_FROM_LITERAL( "[profile default]\naws_access_key_id=fake_access_key2\naws_secret_access_key=fake_secret_key2\n"); AWS_STATIC_STRING_FROM_LITERAL( s_account_id_config_contents, - "[profile default]\naws_access_key_id=fake_access_key\naws_secret_access_key=fake_secret_key\naws_account_id=fake_account_id"); + "[profile " + "default]\naws_access_key_id=fake_access_key\naws_secret_access_key=fake_secret_key\naws_account_id=fake_account_" + "id"); AWS_STATIC_STRING_FROM_LITERAL( s_credentials_contents, @@ -978,8 +980,7 @@ int s_verify_account_id_credentials_callback(struct aws_get_credentials_test_cal ASSERT_CURSOR_VALUE_STRING_EQUALS(aws_credentials_get_access_key_id(callback_results->credentials), s_fake_access); ASSERT_CURSOR_VALUE_STRING_EQUALS( aws_credentials_get_secret_access_key(callback_results->credentials), s_fake_secret); - ASSERT_CURSOR_VALUE_STRING_EQUALS( - aws_credentials_get_account_id(callback_results->credentials), s_fake_account_id); + ASSERT_CURSOR_VALUE_STRING_EQUALS(aws_credentials_get_account_id(callback_results->credentials), s_fake_account_id); ASSERT_TRUE(aws_credentials_get_session_token(callback_results->credentials).len == 0); return AWS_OP_SUCCESS;