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

Maintenance Patch #72

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Maintenance Patch #72

wants to merge 3 commits into from

Conversation

krbundy
Copy link

@krbundy krbundy commented Nov 11, 2024

Update

A little background on the unsolicited update: I wanted to try rocket for a very low stakes project at work, and needed some very basic authentication and wanted to use SQLite to store data. This go me to some issues with package versions with rocket_auth and the rest of the rocket ecosystem/sqlx. I fixed them (it was shorter than doing the auth myself) and thought I would push my updates here. If this is unwelcome in any way please go ahead and simply reject it.

Overview

This PR includes a lot of updates. They fall into three categories. Overall, the main goal was to bring the package up to sync with the new version of rocket (0.5.1 when I started this, at least) and a newer version of rocket_db_pools (this version created an issue with versions of libsqlite-sys). This lead to a few changes:

  1. Updating dependencies to the newest versions,
  2. upating the code to be compatible with this, (validator and rocket updates where breaking changes)
  3. converting some of the #[throws(error)] declarations to have explicit Result<> return types in some places
  4. I added the sqlite database used in the tests to the .gitignore

Package updates

I pushed everything to use the latest version. Every package. This broke some things (validator no longer includes validate_email() (as an exported function at least) so I wrote a custom on, and added a test for it. It's a simple regex trick but is worked for my purpose; I have only two test cases for it so far.

Also, bumping to a later version of rocket was an issue. the rocket::Outcome enum is changed; Outcome::Failure has become Outcome::Error, which I updated throughout.

I mostly had to change the auth.rs, user.rs, and user_impl.rs files, so I went through and updated those functions to have an explicit return type for them. There are some more #[throws(error) macros around the other files that will have to be dealt with at some point.

I also updated the validator derive macro for Signup to use the new custom validator syntax (again, a breaking change there).

None of the udpate

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.

1 participant