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

Fix token refresh #3

Merged
merged 7 commits into from
Mar 8, 2018
Merged

Fix token refresh #3

merged 7 commits into from
Mar 8, 2018

Conversation

maxlaverse
Copy link

  • Stores the Token between calls
  • Add tests

Copy link
Member

@jtnord jtnord left a comment

Choose a reason for hiding this comment

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

LGTM

break;
case "expires_in":
try {
token.expire = System.currentTimeMillis() + Long.parseLong(pair.getValue()) * 1000 - EARLY_EXPIRE_DELAY;
Copy link
Member

Choose a reason for hiding this comment

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

is 100ms enough here - what if I wanted to grab this for use in a build in a pipeline - there could be a few minutes delay before starting a script that needs the credential and the use of the credential?

Copy link
Author

@maxlaverse maxlaverse Mar 5, 2018

Choose a reason for hiding this comment

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

You're right. I overlooked it thought it was seconds. I don't know what a good value would be but 5 minutes sounds reasonnable.

@maxlaverse
Copy link
Author

@jtnord Do you have an Openshift installation do test it ?
I want to add some integration tests to fake the oauth server but I don't think I'll have time today.

@jtnord
Copy link
Member

jtnord commented Mar 5, 2018

@maxlaverse I only have k8s not openshift distribution.

@maxlaverse
Copy link
Author

maxlaverse commented Mar 5, 2018

I will have to check if getToken() is sometimes called with different URLs :/

@maxlaverse maxlaverse merged commit c88effe into master Mar 8, 2018
@maxlaverse maxlaverse deleted the fix_token_refresh branch March 8, 2018 18:35
@maxlaverse
Copy link
Author

Thanks for the review @jtnord

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