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

callout: try to renew jwt when expire #4814

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ramonberrutti
Copy link
Contributor

When a jwt with expiration expires, we are going to request request a new one or disconnect the client.

Signed-off-by: Ramon Berrutti ramonberrutti@gmail.com

@ramonberrutti ramonberrutti marked this pull request as ready for review November 23, 2023 22:31
@ramonberrutti ramonberrutti requested a review from a team as a code owner November 23, 2023 22:31
server/client.go Outdated Show resolved Hide resolved
@@ -289,7 +289,7 @@ func (s *Server) processClientOrLeafCallout(c *client, opts *Options) (authorize
}

// Check if we need to set an auth timer if the user jwt expires.
c.setExpiration(arc.Claims(), expiration)
c.setRenewal(arc.Claims(), expiration)
Copy link
Member

Choose a reason for hiding this comment

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

This should have a buffer imo. So if expiration is say 30mins, we should ask for a renewal at some point before 30mins in case auth callout service is slow to respond. So some percentage, say 10-15% (so for 30mins would be 3mins, so timer would be 27m not 30m). We should also set a max offset for smaller ttls.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we want to retry for slow responds?

Copy link
Member

Choose a reason for hiding this comment

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

I do not believe so, at least to start. Just have the buffer so we are not cutting things too close.

@derekcollison
Copy link
Member

Any updates here or are we good for final review?

@ramonberrutti
Copy link
Contributor Author

Any updates here or are we good for final review?

Sorry, we have moved to another solution and forgotten about it.

I am going to update the PR tomorrow

@github-actions github-actions bot added the stale This issue has had no activity in a while label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue has had no activity in a while
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants