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 Method to ResetToken when max ttl is reached #161

Closed

Conversation

RafaelMontegordoFelix
Copy link
Contributor

Hello, i'am using the library and i face the problem of token ttl.
I'am using .net core and i'am setting the IVaultClient as a singleton, to be injected where i needed.
With this i can renew the token, but when Max ttl is reached renew is not possible anymore.
When renew is not possible, i need to inicialize again the IVaultClient, but beeing this a singleton, i beliave that replacing this is not good practice. (I could use scopped instance, but it would generate allot of tokens and add stress to the vault.)

So i remember that we could reset the current token and force the get of the new token.

Can you please review my idea and give me your thouths about this.
Is this something that you are willing to accept?

Thanks

@rajanadar
Copy link
Owner

hi @RafaelMontegordoFelix

I like your idea. Thanks. Initially I was reluctant to have the whole auto-renewal logic in VaultSharp with timers etc. So I never proceeded with it.

But your idea is a nice middle ground. It ensures that the timer tracking logic is left to host apps and when finally they want to re-fetch the token, then they have a hook into VaultSharp without bothering the singleton.

Since the csproj has your own details as well. Let me absorb the core idea.

rajanadar added a commit that referenced this pull request Nov 21, 2020
@rajanadar
Copy link
Owner

fixed in the above commit.

@rajanadar rajanadar closed this Nov 21, 2020
@rajanadar
Copy link
Owner

@rajanadar rajanadar mentioned this pull request Jan 12, 2021
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.

3 participants