Rotated secrets always triggers a new secret to be generated #107
Labels
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Extra attention is needed
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What version of Go-Guardian are you using ?
What did you do?
Trying to get rotated secrets working and have been looking at https://play.golang.org/p/5N-5fWa0mfN (posted by @shaj13) for some help. This is also found somewhere in the examples but can't find it right now.
The issue is that jwt.SecretsKeeper's methods Get and KID doesn't use pointers in it's signature definitions so changes to r.LastRotation in KID is not saved to the keeper struct.
For example this
func (r RotatedSecrets) KID() string
should be thisfunc (r *RotatedSecrets) KID() string
?What did you expect to see?
That
time.Now().After(r.LastRotation)
would be false if within specified rotation duration.What did you see instead?
That
time.Now().After(r.LastRotation)
is always true as r.LastRotation is always 0.The text was updated successfully, but these errors were encountered: