Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

fix: make GetRoleARN support GovCloud #220

Merged
merged 1 commit into from
Oct 1, 2019

Conversation

raylu
Copy link
Contributor

@raylu raylu commented Sep 24, 2019

GovCloud support was added in #197 / b4e7839 and #204 / 9787f11.
Taking the role as an env var was added in #208 / 396d453, which added
GetRoleARN which ignored region and, thus, broke GovCloud.
Both of these were released as v0.23.0, so no version of aws-okta
supported GovCloud.

Separately, GetRoleARN was split into a lib function and a Provider
function in #218 / e13ae0f, which left behind a code duplication TODO
and an unused Provider function.

lib/provider.go Outdated
return "", err
// GetRoleARN uses temporary credentials to call AWS's get-caller-identity and
// returns the assumed role's name and ARN.
func (p *Provider) GetRoleARN(creds credentials.Value) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

lib.GetRoleARN was added so we could pass the credentials in without breaking API compatibility of Provider#GetRoleARN. I realize the API is gross and probably nobody imports it externally, but we can't be sure.

How about just adding a new function and method GetRoleARNWithRegion? I realize this contributes to API sprawl, but we can tackle that in v3.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done (and restored the old lib.GetRoleARN)!

GovCloud support was added in segmentio#197 / b4e7839 and segmentio#204 / 9787f11.
Taking the role as an env var was added in segmentio#208 / 396d453, which added
GetRoleARN which ignored region and, thus, broke GovCloud.
Both of these were released as v0.23.0, so no version of aws-okta
supported GovCloud.

Separately, GetRoleARN was split into a lib function and a Provider
function in segmentio#218 / e13ae0f, which left behind a code duplication TODO
and an unused Provider function.

This adds Provider.GetRoleARNWithRegion.
@nickatsegment nickatsegment merged commit 02acf14 into segmentio:master Oct 1, 2019
@raylu
Copy link
Contributor Author

raylu commented Oct 8, 2019

could we get a 0.24.2 release to pick this up? v0.24.1...master

@eculver
Copy link
Contributor

eculver commented Oct 9, 2019

I think a release is in order but I think this might warrant a 0.25 release given that it's adding new functionality. @nickatsegment you have any issues w/ cutting v0.25.0?

@nickatsegment
Copy link
Contributor

Yeah, kind of on the fence on that one, but meh, minor versions are cheap

@eculver
Copy link
Contributor

eculver commented Oct 10, 2019

v0.25.0 is out and contains these changes.

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.

3 participants