Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add argument/env var to set the session expiry for the AWS credentials. #14

Merged
merged 2 commits into from
Oct 24, 2022

Conversation

tim-fitzgerald
Copy link

This change allows the user to set the expiration time for the AWS credentials retrieved by okta-aws-cli.

@monde monde self-requested a review October 24, 2022 17:03
Copy link
Collaborator

@monde monde left a comment

Choose a reason for hiding this comment

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

@tim-fitzgerald I love this PR. Making the token's ttl configurable was on my TODO list. Thanks for getting that work done.

I do think there are unintended consequences on the HEADDOC-like formatting of help output with the string literals that need to be corrected.

Okta authentication for federated identity providers in support of AWS CLI.
okta-aws-cli handles authentication to the IdP and token exchange with AWS STS
to collect a proper IAM role for the AWS CLI operator.`,

Copy link
Collaborator

Choose a reason for hiding this comment

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

@tim-fitzgerald did you intend to indent the output one character? I think your editor got opinionated on formatting, adding extra white space to blank lines, adding tab characters, and throwing off the sprintf. I use VSCode and I've had to deal with this in HEREDOC-like formatting.

This occurs in cobra command Long value Long is the long message shown in the 'help <this-command>' output. and in resourceUsageTemplate()

Here is the after, note the indentation on help and the dangling % which I think is from a mismatched sprintf

After:
image

Before:
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

go run cmd/okta-aws-cli/main.go --help

internal/sessiontoken/sessiontoken.go Outdated Show resolved Hide resolved
@tim-fitzgerald
Copy link
Author

@monde thanks Mike! Yup overzealous VSCode formatting that I didn't notice. Have reverted those erroneous formatting changes.

Copy link
Collaborator

@monde monde left a comment

Choose a reason for hiding this comment

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

Thank you @tim-fitzgerald ! ship it

@monde monde merged commit e2ef579 into okta:master Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants