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(auth): Fix timestamp issue with v1 to v2 migration #2799

Merged
merged 7 commits into from
May 2, 2024

Conversation

vincetran
Copy link
Member

@vincetran vincetran commented Apr 30, 2024

  • PR title and description conform to Pull Request guidelines.

Issue #, if available: #2789

Description of changes:
V1 was storing session expiration timestamp as epoch milliseconds and V2 was reading/storing it as epoch seconds. The migration code did not account for this and users that migrated would store a session expiration that would be many many years in the future.

This change adds some logic to the migration code to detect this and covert from milli to sec for new users that still need to migrate.

This change also adds a check in the isValidSession function for users who have already migrated and needs a way to fix themselves.

How did you test these changes?

Documentation update required?

  • No
  • Yes (Please include a PR link for the documentation update)

General Checklist

  • Added Unit Tests
  • Added Integration Tests
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

V1 was storing session expiration timestamp as epoch milliseconds and V2 was reading/storing it as epoch seconds. The migration code did not account for this and users that migrated would store a session expiration that would be many many years in the future.

This change adds some logic to the migration code to detect this and covert from milli to sec for new users that still need to migrate.

This change also adds a check in the isValidSession function for users who have already migrated and needs a way to fix themselves.
@vincetran vincetran marked this pull request as ready for review May 1, 2024 16:56
@vincetran vincetran requested a review from a team as a code owner May 1, 2024 16:56
@vincetran vincetran requested a review from tylerjroach May 2, 2024 18:07
@vincetran vincetran merged commit d124592 into main May 2, 2024
3 checks passed
@vincetran vincetran deleted the vinctran/2789-fix branch May 2, 2024 20:04
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.

4 participants