-
Notifications
You must be signed in to change notification settings - Fork 146
Sprint 5 into 6 update #41
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
base: sprint-6-final-7-15
Are you sure you want to change the base?
Sprint 5 into 6 update #41
Conversation
* updates to sprint 2 deps and breaking changes * move rand to dev deps * changes after audit * dependency updates * Deps updates and refactor for breaking changes * update deps and refactor breaking changes
* update to password struct impl * new type hashpassword for user stored password * remove hashpassword and refactor validate User * validate_user fn change &string to &str and param name password to raw_password * remove unnecessary clones * change clone to owned in verify_password_hash * add tokio::test to valid_passwords_are_parsed_successfully * change Password to HashedPassword * refactor verify_password_hash password_candidate to &str * refactor compute_password_hash accept password: &str * ch to verify_raw_password from verify_password_hash
auth-service/src/routes/signup.rs
Outdated
| Email::parse(request.email.clone()).map_err(|_| AuthAPIError::InvalidCredentials)?; | ||
| let password = | ||
| Password::parse(request.password.clone()).map_err(|_| AuthAPIError::InvalidCredentials)?; | ||
| let email = Email::parse(request.email).map_err(|e| AuthAPIError::UnexpectedError(e.into()))?; |
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.
Why are we changing this from InvalidCredentials to UnexpectedError?
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.
Pretty sure this would break integration tests
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.
It was an attempt to recreate the section of Err(eyre!("oh no!"))
Since the compute_password_hash was moved to password.rs.
I have reverted it to InvalidCredentials, but I have also added error source tracking to it.
|
@letsgetrusty let me know if the commit I have pushed makes sense to you. Then I will also make the changes to ClickUp |
What does this PR do?
Updated ClickUp Tasks (WIP)
Set up tracing 1.3 Instrument sign-up route handler
Removed fn verify_raw_password and compute_password_hash
https://app.clickup.com/9015495369/v/dc/8cnv2p9-22315/8cnv2p9-40155?block=block-0a61171e-5e7f-49b3-bae4-e452fa051883
Added a new step 3 (Instrument the auth-service/src/domain/password.rs)
https://app.clickup.com/9015495369/v/dc/8cnv2p9-22315/8cnv2p9-40155?block=block-e500b83a-3142-496d-81b1-7ebaa6b19563
Idiomatic errors - part 1
Force an error to occur
compute_password_hashfunction was movedhttps://app.clickup.com/9015495369/v/dc/8cnv2p9-22315/8cnv2p9-40155?block=block-b691e2d1-82c5-46ca-b743-5b6d9062629f
https://app.clickup.com/9015495369/v/dc/8cnv2p9-22315/8cnv2p9-40155?block=block-5ab81358-110d-4125-98dc-6c13bff474e0
Update error reporting for the sign-up route
Update auth-service/src/domain/password.rs to use color_eyre
https://app.clickup.com/9015495369/v/dc/8cnv2p9-22315/8cnv2p9-40155?&block=block-eac22722-3c33-411a-9eed-c9aa15989782
Update error conversion to UserStoreError::UnexpectedError in PostgresUserStore. We need to pass an eyre::Report to UserStoreError::UnexpectedError.
Hiding sensitive data
Update the Password type to SecretString. This will prevent the password type from accidentally being logged!
Update auth-service/src/services/data-stores/postgres_user_store.rs to use the SecretString type