Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.

return empty string if resolver passed empty role #280

Merged
merged 1 commit into from
Aug 16, 2019

Conversation

Joseph-Irving
Copy link
Contributor

#276 introduced a bug if you don't set assume-role-arn

arnResolver.Resolve(config.AssumeRoleArn) returns something like arn:aws:iam::xxxxxxxxx:role/ when passed an empty assume role arn, which prevents the Default Gateway from using the instance role, it instead trys to assume this non existent role.

So I've changed arnResolver.Resolve to return "" if the role is empty, restoring the old behaviour

@codecov
Copy link

codecov bot commented Aug 15, 2019

Codecov Report

Merging #280 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #280      +/-   ##
=========================================
+ Coverage   44.13%   44.2%   +0.07%     
=========================================
  Files          25      25              
  Lines         929     932       +3     
=========================================
+ Hits          410     412       +2     
- Misses        475     476       +1     
  Partials       44      44
Impacted Files Coverage Δ
pkg/server/server.go 19.23% <ø> (ø) ⬆️
pkg/aws/sts/arn_resolver.go 100% <100%> (ø) ⬆️
pkg/server/gateway.go 0% <0%> (ø) ⬆️

@@ -30,6 +30,11 @@ func DefaultResolver(prefix string) *Resolver {

// Resolve converts from a role string into the absolute role arn.
func (r *Resolver) Resolve(role string) string {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Joseph-Irving remove this whitespace line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep done

@Joseph-Irving Joseph-Irving merged commit 23626e5 into master Aug 16, 2019
@Joseph-Irving Joseph-Irving deleted the fix_arn_resolver branch August 16, 2019 09:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants