-
Notifications
You must be signed in to change notification settings - Fork 269
Cleaning up the auth package #134
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
Conversation
if err := decode(s, &claims); err != nil { | ||
return err | ||
} | ||
if err := decode(s, t); err != nil { |
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.
I think it's worth adding a comment explaining why you need to decode twice.
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.
Done
auth/auth.go
Outdated
verifyTokenMsg := "See https://firebase.google.com/docs/auth/admin/verify-id-tokens for details on how to " + | ||
"retrieve a valid ID token." | ||
verifyTokenMsg := "see https://firebase.google.com/docs/auth/admin/verify-id-tokens for details on how to " + | ||
"retrieve a valid id token." |
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.
Technically, go error messages shouldn't end with punctuation.
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.
Done
auth/auth.go
Outdated
|
||
projectIDMsg := "Make sure the ID token comes from the same Firebase project as the credential used to" + | ||
projectIDMsg := "make sure the id token comes from the same Firebase project as the credential used to" + | ||
" authenticate this SDK." |
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.
Technically, go error messages shouldn't end with punctuation.
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.
Done
return err | ||
} | ||
|
||
for _, r := range []string{"iss", "aud", "exp", "iat", "sub", "uid"} { |
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.
Maybe another comment here like "Delete the standard claims from the custom claims map."
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.
Done
* context signatures * VerifyIDToken context * custom token context * fix context arguments * custom token with claims context * remove TODO * integration_iid_name * propagate ctx * propagate to private functions * snippets and tests ctx * integration test user2 fix * error message * Revert "integration test user2 fix" This reverts commit 57148ce. * add context to AE, fix integration test after merge. * Revert "error message" This reverts commit db7c34a. * Merged with latest dev * Using the 1.6 import for context * Dropping call to WithContext * Cleaning up the auth package (#134) * Cleaning up the auth package * Variable grouping * Removing some punctuation; Changed id to ID in error messages * Adding a minor comment * Cleaning up the auth (user management) code (#136) * Cleaning up the auth (user management) code * Added a few more tests * Removed the fields inner type from UserToCreate and UserToUpdate * Renamed _req variables; More consistent error messages
* Breaking context change (#88) * context signatures * VerifyIDToken context * custom token context * fix context arguments * custom token with claims context * remove TODO * integration_iid_name * propagate ctx * propagate to private functions * snippets and tests ctx * integration test user2 fix * error message * Revert "integration test user2 fix" This reverts commit 57148ce. * add context to AE, fix integration test after merge. * Revert "error message" This reverts commit db7c34a. * Merged with latest dev * Using the 1.6 import for context * Dropping call to WithContext * Cleaning up the auth package (#134) * Cleaning up the auth package * Variable grouping * Removing some punctuation; Changed id to ID in error messages * Adding a minor comment * Cleaning up the auth (user management) code (#136) * Cleaning up the auth (user management) code * Added a few more tests * Removed the fields inner type from UserToCreate and UserToUpdate * Renamed _req variables; More consistent error messages * Removing golint checks from 1.6.x build (#141) * Removing golint checks from 1.6.x build * Minor reformat * Bumped version to 3.0.0 (#142) * Bumped version to 3.0.0 * Updated changelog
* context signatures * VerifyIDToken context * custom token context * fix context arguments * custom token with claims context * remove TODO * integration_iid_name * propagate ctx * propagate to private functions * snippets and tests ctx * integration test user2 fix * error message * Revert "integration test user2 fix" This reverts commit 57148ce. * add context to AE, fix integration test after merge. * Revert "error message" This reverts commit db7c34a. * Merged with latest dev * Using the 1.6 import for context * Dropping call to WithContext * Cleaning up the auth package (#134) * Cleaning up the auth package * Variable grouping * Removing some punctuation; Changed id to ID in error messages * Adding a minor comment * Cleaning up the auth (user management) code (#136) * Cleaning up the auth (user management) code * Added a few more tests * Removed the fields inner type from UserToCreate and UserToUpdate * Renamed _req variables; More consistent error messages
Some minor syntactic changes are being made to the v3.0 branch in anticipation of the upcoming cookie management API.