Skip to content

Commit

Permalink
rename error code
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Jan 11, 2024
1 parent 69715ca commit b04d960
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/aws/auth/auth.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ enum aws_auth_errors {
AWS_AUTH_SSO_TOKEN_EXPIRED,
AWS_AUTH_CREDENTIALS_PROVIDER_SSO_SOURCE_FAILURE,
AWS_AUTH_IMDS_CLIENT_SOURCE_FAILURE,
AWS_AUTH_PROFILE_CREDENTIALS_PROVIDER_CYCLE_FAILURE,
AWS_AUTH_PROFILE_STS_CREDENTIALS_PROVIDER_CYCLE_FAILURE,

AWS_AUTH_ERROR_END_RANGE = AWS_ERROR_ENUM_END_RANGE(AWS_C_AUTH_PACKAGE_ID)
};
Expand Down
2 changes: 1 addition & 1 deletion source/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static struct aws_error_info s_errors[] = {
AWS_AUTH_IMDS_CLIENT_SOURCE_FAILURE,
"Failed to source the IMDS resource"),
AWS_DEFINE_ERROR_INFO_AUTH(
AWS_AUTH_PROFILE_CREDENTIALS_PROVIDER_CYCLE_FAILURE,
AWS_AUTH_PROFILE_STS_CREDENTIALS_PROVIDER_CYCLE_FAILURE,
"Failed to resolve credentials because the profile contains a cycle in the assumeRole chain.")
};
/* clang-format on */
Expand Down
2 changes: 1 addition & 1 deletion source/credentials_provider_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ static struct aws_credentials_provider *s_credentials_provider_new_profile_inter
/* profiles can contain self reference but no circular chain */
if (!profile_contains_static_cred || aws_hash_table_get_entry_count(source_profiles_table) > 1) {
AWS_LOGF_ERROR(AWS_LS_AUTH_CREDENTIALS_PROVIDER, "assumeRole chain contains a circular reference");
aws_raise_error(AWS_AUTH_PROFILE_CREDENTIALS_PROVIDER_CYCLE_FAILURE);
aws_raise_error(AWS_AUTH_PROFILE_STS_CREDENTIALS_PROVIDER_CYCLE_FAILURE);
goto on_finished;
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/credentials_provider_sts_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ static int s_credentials_provider_sts_from_profile_config_with_chain_cycle_fn(

struct aws_credentials_provider *provider = aws_credentials_provider_new_profile(allocator, &options);
ASSERT_NULL(provider);
ASSERT_INT_EQUALS(AWS_AUTH_PROFILE_CREDENTIALS_PROVIDER_CYCLE_FAILURE, aws_last_error());
ASSERT_INT_EQUALS(AWS_AUTH_PROFILE_STS_CREDENTIALS_PROVIDER_CYCLE_FAILURE, aws_last_error());

ASSERT_SUCCESS(s_aws_sts_tester_cleanup());
aws_string_destroy(config_file_str);
Expand Down Expand Up @@ -1117,7 +1117,7 @@ static int s_credentials_provider_sts_from_profile_config_with_chain_cycle_and_s

struct aws_credentials_provider *provider = aws_credentials_provider_new_profile(allocator, &options);
ASSERT_NULL(provider);
ASSERT_INT_EQUALS(AWS_AUTH_PROFILE_CREDENTIALS_PROVIDER_CYCLE_FAILURE, aws_last_error());
ASSERT_INT_EQUALS(AWS_AUTH_PROFILE_STS_CREDENTIALS_PROVIDER_CYCLE_FAILURE, aws_last_error());

ASSERT_SUCCESS(s_aws_sts_tester_cleanup());
aws_string_destroy(config_file_str);
Expand Down

0 comments on commit b04d960

Please sign in to comment.