-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: Password-less login with WebAuthn #195
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16b1749
to
97bc9fd
Compare
Open
b09cfb4
to
86e70a3
Compare
0829802
to
64154d5
Compare
6ccd1a8
to
32faeec
Compare
1e0f68c
to
d9e503e
Compare
95fd0ec
to
e3917a8
Compare
Signed-off-by: guacamole <gunjanwalecha@gmail.com>
Signed-off-by: jay-dee7 <jasdeepsingh.uppal@gmail.com>
Instead of one large interface to cover for everything, we now have multiple, smaller interfaces to make our backend more composable. Refactor goes like this: ```go // Postgres Core type PgTxnHandler interface { NewTxn(ctx context.Context) (pgx.Tx, error) Abort(ctx context.Context, txn pgx.Tx) error Commit(ctx context.Context, txn pgx.Tx) error } // User specific type UserReader interface { PgTxnHandler ... } type UserWriter interface { PgTxnHandler ... } type UserDeleter interface { PgTxnHandler ... } type UserReadWriteDeleter interface { PgTxnHandler ... } // WebAuthn specific type WebAuthn interface { PgTxnHandler UserReader UserWriter GetWebAuthNSessionData(ctx context.Context, userId string, sessionType string) (*webauthn.SessionData, error) AddWebAuthSessionData(ctx context.Context, userId string, sessionData *webauthn.SessionData, sessionType string) error GetWebAuthNCredentials(ctx context.Context, userId string) (*webauthn.Credential, error) AddWebAuthNCredentials(ctx context.Context, userId string, credential *webauthn.Credential) error } ```
We have some utility methods in `auth` package which can be used in different packages. We now make rewrite those methods as public functions.
guacamole
reviewed
Mar 25, 2023
guacamole
reviewed
Mar 25, 2023
guacamole
approved these changes
Mar 25, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work @jay-dee7 🥇 💯
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
P1
P1 label is used for this that we see of highest priority. Critical bugs, security issues, etc
Security
Security enhancement related work
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Instead of one large interface to cover for everything, we now have
multiple, smaller interfaces to make our backend more composable.
Refactor goes like this: