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

Export session expiration timestamp as environment variable #190

Closed
timoguin opened this issue Aug 13, 2019 · 8 comments
Closed

Export session expiration timestamp as environment variable #190

timoguin opened this issue Aug 13, 2019 · 8 comments
Labels

Comments

@timoguin
Copy link

Since the expiration timestamps from the STS sessions are available in the session cache, it would be nice to provide them as environment variables to the subshell, something like AWS_SESSION_EXPIRATION perhaps. It would also be nice if the CLI printed how much time was left in the session to stderr.

@nickatsegment
Copy link
Contributor

Yep, those are good ideas. PRs appreciated :)

Do you think time remaining is best? Or the datetime at which it expires?

Minor detail: I think maybe AWS_OKTA_SESSION_EXPIRATION is slightly better so as to not be confused with official AWS_* vars.

@timoguin
Copy link
Author

AWS_OKTA_SESSION_EXPIRATION makes sense to me. I think time remaining will be the useful metric. Perhaps we should print both? Something like so: Session expires in 15m at <timestamp>.

@timoguin
Copy link
Author

Also, should we print the same info for the Okta session on a separate line? I'm not sure if that would be too noisy or not. Maybe when debug is on?

@timoguin
Copy link
Author

I'm also happy to submit a PR for this as soon as I have the time.

@nickatsegment
Copy link
Contributor

@timoguin you're my new favourite.

@nickatsegment
Copy link
Contributor

Also, should we print the same info for the Okta session on a separate line? I'm not sure if that would be too noisy or not. Maybe when debug is on?

I think stick it all in debug-level for now, to get it shipped. We can promote later

@stale
Copy link

stale bot commented Oct 27, 2019

This issue has been automatically marked stale because it has not had any activity in the last 60 days. If no further activity occurs within 7 days, it will be closed. Closed does not mean "never", just that it has no momentum to get accomplished any time soon.
See CONTRIBUTING.md for more info.

@stale stale bot added the stale label Oct 27, 2019
@timoguin
Copy link
Author

Closed by #230. The AWS_OKTA_SESSION_EXPIRATION env variable is now exported as a Unix timestamp. (I'll probably create a follow-up to print this in local time.) Looks like the debug logs already print the remaining time for the session:

DEBU[0000] Using session DGD3, expires in 11h6m12.402131s

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants