Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Jan 28, 2025
1 parent d2c52cc commit 4c3189a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
3 changes: 2 additions & 1 deletion source/aws_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
7 changes: 6 additions & 1 deletion source/credentials.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 2 additions & 3 deletions source/credentials_provider_environment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 3 additions & 1 deletion tests/credentials_provider_ecs_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 4 additions & 3 deletions tests/credentials_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4c3189a

Please sign in to comment.