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 the clock skew calculation in auth tokens for IAM-based authentication with AWS RDS #5119

Merged
merged 3 commits into from
May 7, 2024

Conversation

amartinezfayo
Copy link
Member

The function isExpired() is used to know if the current cached token used in IAM-based authentication with AWS RDS backed databases is expired or not.
It's currently subtracting a clock skew to the current time, while it should be adding it so the comparison with the expiration time returns >= 0 to indicate that is expired within the skew.
This is done so it's considered expired some time before it really expires, to avoid using a cached token when it's very close to expiration.

I also took the opportunity to remove the tokenGetter interface that was not being used.

Signed-off-by: Agustín Martínez Fayó <amartinezfayo@gmail.com>
- Use the newly added clockSkew constant

Signed-off-by: Agustín Martínez Fayó <amartinezfayo@gmail.com>
@azdagron azdagron merged commit 00f2ca5 into spiffe:main May 7, 2024
32 checks passed
@amartinezfayo amartinezfayo modified the milestones: 1.9.5, 1.9.6 May 8, 2024
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.

None yet

2 participants