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

One keyring item for session #174

Merged
merged 18 commits into from
Jul 9, 2019
Merged

One keyring item for session #174

merged 18 commits into from
Jul 9, 2019

Conversation

nickatsegment
Copy link
Contributor

@nickatsegment nickatsegment commented Jul 6, 2019

Fixes: #146

Partially addresses #173

Adds a --session-cache-single-item flag and env var to opt into a new session cache that stores all sessions in a single keyring item. The benefit is fewer auth prompts from macOS Keychain. On every upgrade (new aws-okta binary), the user needs to reauth 3 + N (number of sessions) times, but with this new cache, this is always just 3+1.

This refactors the KeyringSessions type into a session cache store and a keying function interface so that we can reuse the existing (bizarre) keying function with a new storage engine.

I might propose in another PR that we use a better keying function. I'm still trying to understand what we want from this cache.

@nickatsegment nickatsegment marked this pull request as ready for review July 9, 2019 00:17
lib/provider.go Outdated Show resolved Hide resolved
Copy link
Contributor

@systemizer systemizer left a comment

Choose a reason for hiding this comment

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

this looks great. im very excited for less entering in my password (although, I have become quite good at it)

@nickatsegment
Copy link
Contributor Author

I'm gonna add some simple tests.

Introduces golang.org/x/xerrors, until we can start to use go 1.13
errors reliably.
Just use stdlib errors + xerrors
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.

Collapse session tokens to single keychain item?
3 participants