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

Omit token field from new auth token db entries #541

Merged
merged 3 commits into from
Nov 18, 2022

Conversation

neelvirdy
Copy link
Contributor

@neelvirdy neelvirdy commented Nov 17, 2022

Only store token hash for newly created API tokens. Phase 3 of #343

Anywhere we query the AuthToken DB for "token = ?", token has already been replaced with "token = ? or token_hash = ?", token, GetTokenHash(token), so this does not effect the validity of any tokens, existing or new.


Demoing creating a token, using it to re-authenticate, revoke another token, and create yet another token.

Screen.Recording.2022-11-17.at.6.48.12.PM.mov

This is the state of the DB after this flow:
image

dbmgr/dbmgr.go Outdated Show resolved Hide resolved
Copy link
Contributor

@en0ma en0ma left a comment

Choose a reason for hiding this comment

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

LGTM

@neelvirdy neelvirdy merged commit ec7f947 into application-research:dev Nov 18, 2022
@neelvirdy neelvirdy deleted the nvirdy/omit-token branch November 18, 2022 18:48
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