Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Add ability to show current token + renew lease #114

Merged
merged 2 commits into from
May 9, 2017

Conversation

djenriquez
Copy link
Owner

@djenriquez djenriquez commented May 1, 2017

Per #91, new functionality allows users to renew lease at any time from the new UI menu displayed at the top right.

In this menu, users now also have the ability to display the token they are currently using in order to use it for other tools that may require a Vault Token.

One thing I did notice that many users may become confused with, is the token renew process, which allows tokens to be renewed up to the maximum mount TTL. For a lot of users, their tokens may already be at max, in which case, this feature does nothing. Another thing I noticed is that when leases are renewed, they are automatically renewed to the mount's max TTL, rather then releasing for the initial TTL deployed. Not sure if this is how the Vault project meant to design these processes but this is how Vault works today. There could be other mount settings that can change these behaviors, but not sure what they are currently.

Reference: hashicorp/vault#1079

@djenriquez djenriquez requested review from msessa and alexunwin May 1, 2017 03:12
@@ -77,7 +129,16 @@ class Header extends React.Component {
</span>
)

if (this.props.tokenIdentity.ttl) {
if (this.state.tokenRenewed) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

Little bit of a hacky solution, but wasn't sure how to update the TTL once renewed since the value came from a super class. I'm definitely open to suggestions if there are better ways to handle this.

<Divider />
<MenuItem
primaryText="Logout"
onTouchTap={logout}
Copy link
Owner Author

Choose a reason for hiding this comment

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

Logout is preserved and added to the icon menu.

@djenriquez
Copy link
Owner Author

@msessa thoughts on this one?

@djenriquez
Copy link
Owner Author

@msessa @alexunwin Hey guys please take a look if you have time today, I'll be merging this in tonight.

@djenriquez
Copy link
Owner Author

Merging in.

@djenriquez djenriquez merged commit f898dca into master May 9, 2017
@djenriquez djenriquez deleted the feature/token-renew branch May 9, 2017 08:11
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.

1 participant