diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..b2eac0eb5 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,33 @@ +name: docs + +on: + push: + branches: + - master + pull_request: + +env: + RUST_TOOLCHAIN: stable + TOOLCHAIN_PROFILE: minimal + +jobs: + check: + name: Check + runs-on: ubuntu-latest + + permissions: + contents: read + + steps: + - name: Checkout the code + uses: actions/checkout@v4 + - uses: actions-rs/toolchain@v1 + with: + profile: ${{ env.TOOLCHAIN_PROFILE }} + toolchain: ${{ env.RUST_TOOLCHAIN }} + override: true + components: rustfmt + - run: cargo install snipdoc + - run: snipdoc check + + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f6cfa0678..573b57365 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,27 @@ # Changelog ## vNext +* refactor auth middleware for supporting bearer, cookie and query. [https://github.com/loco-rs/loco/pull/560](https://github.com/loco-rs/loco/pull/560) +* SeaORM upgraded: `rc1` -> `rc4`. [https://github.com/loco-rs/loco/pull/585](https://github.com/loco-rs/loco/pull/585) +* Adding Cache to app content. [https://github.com/loco-rs/loco/pull/570](https://github.com/loco-rs/loco/pull/570) * Apply a layer to a specific handler using `layer` method. [https://github.com/loco-rs/loco/pull/554](https://github.com/loco-rs/loco/pull/554) * Add the debug macro to the templates to improve the errors. [https://github.com/loco-rs/loco/pull/547](https://github.com/loco-rs/loco/pull/547) * Opentelemetry initializer. [https://github.com/loco-rs/loco/pull/531](https://github.com/loco-rs/loco/pull/531) -* **Braking changes** Refactored DSL and Pagination. [https://github.com/loco-rs/loco/pull/566](https://github.com/loco-rs/loco/pull/566) +* Refactor auth middleware for supporting bearer, cookie and query [https://github.com/loco-rs/loco/pull/560](https://github.com/loco-rs/loco/pull/560) +* Add redirect response [https://github.com/loco-rs/loco/pull/563](https://github.com/loco-rs/loco/pull/563) +* **Breaking changes** Adding a custom claims `Option` to the `UserClaims` struct (type changed). [https://github.com/loco-rs/loco/pull/578](https://github.com/loco-rs/loco/pull/578) +* **Breaking changes** Refactored DSL and Pagination: namespace changes. [https://github.com/loco-rs/loco/pull/566](https://github.com/loco-rs/loco/pull/566) * Replaced `model::query::dsl::` with `model::query`. * Replaced `model::query::exec::paginate` with `model::query::paginate`. * Updated the `PaginatedResponse` struct. Refer to its usage example [here](https://github.com/loco-rs/loco/blob/master/examples/demo/src/views/notes.rs#L29). -* Refactor auth middleware for supporting bearer, cookie and query [https://github.com/loco-rs/loco/pull/560](https://github.com/loco-rs/loco/pull/560) -* Add redirect response [https://github.com/loco-rs/loco/pull/563](https://github.com/loco-rs/loco/pull/563) +* **Breaking changes** When introducing the Cache system which is much more flexible than having just Redis, we now call the 'redis' member simply a 'queue' which indicates it should be used only for the internal queue and not as a general purpose cache. In the application configuration setting `redis`, change to `queue`. [https://github.com/loco-rs/loco/pull/590](https://github.com/loco-rs/loco/pull/590) +```yaml +# before: +redis: +# after: +queue: +``` +* **Breaking changes** We have made a few parts of the context pluggable, such as the `storage` and new `cache` subsystems, this is why we decided to let you configure the context entirely before starting up your app. As a result, if you have a storage building hook code it should move to `after_context`, see example [here](https://github.com/loco-rs/loco/pull/570/files#diff-5534e8826fb82e5c7f2587d270a51b48009341e79889d1504e6b63b2f0b652bdR83). [https://github.com/loco-rs/loco/pull/570](https://github.com/loco-rs/loco/pull/570) ## v0.4.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4dcc0fa4c..c40fa52a7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,9 +64,19 @@ In case of cli changes we snapshot the binary commands. in case of changes run t LOCO_CI_MODE=true TRYCMD=overwrite cargo test ``` -## Running Docs website -The documentation website based on [zola](https://www.getzola.org/), and you can see the docs [here](./docs-site/). -then cd to `docs-site` and run `zola serve` +## Docs + +The documentation consists of two main components: + ++ The [loco.rs website](https://loco.rs) with its source code available [here](./docs-site/). ++ RustDocs. + +To reduce duplication in documentation and examples, we use [snipdoc](https://github.com/kaplanelad/snipdoc). As part of our CI process, we ensure that the documentation remains consistent. + +Updating the Documentation ++ Download [snipdoc](https://github.com/kaplanelad/snipdoc). ++ Create the snippet in the [yaml file](./snipdoc.yml) or inline the code. ++ Run `snipdoc run`. ## Open A Pull Request diff --git a/Cargo.toml b/Cargo.toml index 00746ed0c..cb39e83b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] -default = ["auth_jwt", "cli", "with-db"] +default = ["auth_jwt", "cli", "with-db", "cache_inmem"] auth_jwt = ["dep:jsonwebtoken"] cli = ["dep:clap"] testing = ["dep:axum-test"] @@ -33,6 +33,8 @@ all_storage = ["storage_aws_s3", "storage_azure", "storage_gcp"] storage_aws_s3 = ["object_store/aws"] storage_azure = ["object_store/azure"] storage_gcp = ["object_store/gcp"] +# Cache feature +cache_inmem = ["dep:moka"] [dependencies] @@ -44,7 +46,7 @@ clap = { version = "4.4.7", features = ["derive"], optional = true } colored = "2" -sea-orm = { version = "1.0.0-rc.1", features = [ +sea-orm = { version = "1.0.0-rc.4", features = [ "sqlx-postgres", # `DATABASE_DRIVER` feature "sqlx-sqlite", "runtime-tokio-rustls", @@ -119,6 +121,9 @@ socketioxide = { version = "0.10.0", features = ["state"], optional = true } # File Upload object_store = { version = "0.9.0", default-features = false } +# cache +moka = { version = "0.12.7", features = ["sync"], optional = true } + [workspace.dependencies] async-trait = { version = "0.1.74" } axum = { version = "0.7.1", features = ["macros"] } @@ -136,7 +141,7 @@ tower-http = { version = "0.5.0", features = [ [dependencies.sea-orm-migration] optional = true -version = "1.0.0-rc.1" +version = "1.0.0-rc.4" features = [ # Enable at least one `ASYNC_RUNTIME` and `DATABASE_DRIVER` feature if you want to run migration via CLI. # View the list of supported features at https://www.sea-ql.org/SeaORM/docs/install-and-config/database-and-async-runtime. diff --git a/README.md b/README.md index ae98e8ee3..e2fb037ea 100644 --- a/README.md +++ b/README.md @@ -1,103 +1,102 @@ +
-![Loco.rs](https://github.com/loco-rs/loco/assets/83390/992d215a-3cd3-42ee-a1c7-de9fd25a5bac) -[![Current Crates.io Version](https://img.shields.io/crates/v/loco-rs.svg)](https://crates.io/crates/loco-rs) -[![Discord channel](https://img.shields.io/badge/discord-Join-us)](https://discord.gg/fTvyBzwKS8) + -# Welcome to Loco! +

Loco

-https://loco.rs +

+ +๐Ÿš‚ Loco is Rust on Rails. + +

+ [![crate](https://img.shields.io/crates/v/loco-rs.svg)](https://crates.io/crates/loco-rs) + [![docs](https://docs.rs/loco-rs/badge.svg)](https://docs.rs/loco-rs) + [![Discord channel](https://img.shields.io/badge/discord-Join-us)](https://discord.gg/fTvyBzwKS8) -Loco is "Rust on Rails". +
-Loco is strongly inspired by Rails. If you know Rails and Rust, you'll feel at home. If you only know Rails and new to Rust, you'll find Loco refreshing. We do not assume you know Rails. + # Loco + #### Loco is strongly inspired by Rails. If you know Rails and Rust, you'll feel at home. If you only know Rails and new to Rust, you'll find Loco refreshing. We do not assume you know Rails. -## Quick Start - + ## Quick Start + ```sh -$ cargo install loco-cli +cargo install loco-cli +cargo install sea-orm-cli # Only when DB is needed ``` + -Now you can create your new app (choose "SaaS app"). + Now you can create your new app (choose "`SaaS` app"). + ```sh -$ loco new -โฏ App name? [myapp]: -โฏ SaaS app (with DB and user auth) - Stateless service (minimal, no db) +โฏ loco new +โœ” โฏ App name? ยท myapp +โœ” โฏ What would you like to build? ยท SaaS app (with DB and user auth) + ๐Ÿš‚ Loco app generated successfully in: myapp ``` + -To configure a database , please run a local postgres database with loco:loco and a db named [insert app]_development. +To configure a database , please run a local postgres database with loco:loco and a db named [insert app]_development. + +```sh +docker run -d -p 5432:5432 \ + -e POSTGRES_USER=loco \ + -e POSTGRES_DB=myapp_development \ + -e POSTGRES_PASSWORD="loco" \ + postgres:15.3-alpine ``` -$ docker run -d -p 5432:5432 -e POSTGRES_USER=loco -e POSTGRES_DB=myapp_development -e POSTGRES_PASSWORD="loco" postgres:15.3-alpine -``` + -Now `cd` into your `myapp` and start your app: + A more advanced set of `docker-compose.yml` and `Dockerfiles` that include Redis and the `mailtutan` mailer are available for [each starter on GitHub](https://github.com/loco-rs/loco/blob/master/starters/saas/.devcontainer/docker-compose.yml). -``` -$ cd myapp -$ cargo loco start -Finished dev [unoptimized + debuginfo] target(s) in 21.63s - Running `target/debug/myapp start` - - : - : - : + Now `cd` into your `myapp` and start your app: -controller/app_routes.rs:203: [Middleware] Adding log trace id + +```sh +$ cargo loco start โ–„ โ–€ - โ–€ โ–„ + โ–€ โ–„ โ–„ โ–€ โ–„ โ–„ โ–„โ–€ โ–„ โ–€โ–„โ–„ โ–„ โ–€ โ–€ โ–€โ–„โ–€โ–ˆโ–„ โ–€โ–ˆโ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–€โ–€โ–ˆ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–€โ–ˆ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–€โ–€โ–€ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–„โ–ˆโ–„ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–„ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–„โ–„โ–„ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–€ - โ–€โ–€โ–€โ–ˆโ–ˆโ–„ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–ˆโ–ˆโ–€ - โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ - -started on port 3000 +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–€โ–ˆ +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–€โ–€โ–€ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–„โ–ˆโ–„ +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–„ +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–„โ–„โ–„ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–€ + โ–€โ–€โ–€โ–ˆโ–ˆโ–„ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–ˆโ–ˆโ–€ + โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ + https://loco.rs + +listening on port 3000 ``` + ## Project Status - -Loco is feature complete, but features are still being added rapidly. - -### What can you build? - -- Stateless APIs -- Complete SaaS products with user authentication -- Purpose-built services such as ML inference endpoints -- Full stack projects with separate frontend project integrated with Loco -- Hobby projects full-stack with backend and HTML frontend - -### What's being done now? - -- View [issues](https://github.com/loco-rs/loco/issues) for what we plan next and what we work on (you're welcome to submit PRs!) -- View [CHANGELOG](https://github.com/loco-rs/loco/blob/master/CHANGELOG.md) for what we already added ++ Stateless APIs ++ Complete `SaaS` products with user authentication ++ Purpose-built services such as ML inference endpoints ++ Full stack projects with separate frontend project integrated with Loco ++ Hobby projects full-stack with backend and HTML frontend ## Powered by Loco - -* [SpectralOps](https://spectralops.io) - various services powered by Loco framework -* [Nativish](https://nativi.sh) - app backend powered by Loco framework - -[open an issue to add yourself here](https://github.com/loco-rs/loco/issues) - ++ [SpectralOps](https://spectralops.io) - various services powered by Loco + framework ++ [Nativish](https://nativi.sh) - app backend powered by Loco framework ## Contributors โœจ - Thanks goes to these wonderful people: - + \ No newline at end of file diff --git a/docs-site/content/blog/frontend-website.md b/docs-site/content/blog/frontend-website.md index bba39181e..b3b70fff5 100644 --- a/docs-site/content/blog/frontend-website.md +++ b/docs-site/content/blog/frontend-website.md @@ -147,7 +147,6 @@ server: ``` Now, run the Loco server again and you should see frontend app serving via Loco - ```sh $ cargo loco start ``` diff --git a/docs-site/content/docs/getting-started/cli.md b/docs-site/content/docs/getting-started/cli.md index 480edb1f0..873760991 100644 --- a/docs-site/content/docs/getting-started/cli.md +++ b/docs-site/content/docs/getting-started/cli.md @@ -16,18 +16,24 @@ flair =[] Create your starter app: -```rust -$ cargo install loco-cli -$ loco new -< follow the guide > + +```sh +โฏ loco new +โœ” โฏ App name? ยท myapp +โœ” โฏ What would you like to build? ยท SaaS app (with DB and user auth) + +๐Ÿš‚ Loco app generated successfully in: +myapp ``` + Now `cd` into your app, set up a convenience `rr` alias and try out the various commands: + +```sh +cargo loco --help ``` -$ cd myapp -$ cargo loco --help -``` + You can now drive your development through the CLI: @@ -49,9 +55,11 @@ $ cargo test To run you app, run: + +```sh +cargo loco start ``` -$ cargo loco start -``` + ## Background workers diff --git a/docs-site/content/docs/getting-started/config.md b/docs-site/content/docs/getting-started/config.md index 80d6a381d..70f9cd305 100644 --- a/docs-site/content/docs/getting-started/config.md +++ b/docs-site/content/docs/getting-started/config.md @@ -61,27 +61,23 @@ config/ ``` To run the application using the 'qa' environment, execute the following command: - -``` -$ LOCO_ENV=qa cargo loco start + +```sh +LOCO_ENV=qa cargo loco start ``` + ## Settings -The configuration files contain knobs to set up your Loco app. You can also have your custom settings, with the `settings:` section. - - -```yaml -# in config/development.yaml -# add the `settings:` section -settings: +The configuration files contain knobs to set up your Loco app. You can also have your custom settings, with the `settings:` section. in `config/development.yaml` add the `settings:` section + +```yaml + settings: allow_list: - google.com - - apple.com - -logger: - # ... -``` + - apple.com + ``` + These setting will appear in `ctx.config.settings` as `serde_json::Value`. You can create your strongly typed settings by adding a struct: diff --git a/docs-site/content/docs/getting-started/deployment.md b/docs-site/content/docs/getting-started/deployment.md index 9b107c936..bd127be30 100644 --- a/docs-site/content/docs/getting-started/deployment.md +++ b/docs-site/content/docs/getting-started/deployment.md @@ -17,9 +17,11 @@ Deployment is super simple in Loco, and this is why this guide is super short. A To deploy, build your production binary for your relevant server architecture: + +```sh +cargo build --release ``` -$ cargo build --release -``` + And copy your binary along with your `config/` folder to the server. You can then run `myapp start` on your server. @@ -33,63 +35,114 @@ There are a few configuration sections that are important to review and set acco - Logger: -```yaml + +```yaml + # Application logging configuration logger: - level: -``` + # Enable or disable logging. + enable: true + # Enable pretty backtrace (sets RUST_BACKTRACE=1) + pretty_backtrace: true + # Log level, options: trace, debug, info, warn or error. + level: debug + # Define the logging format. options: compact, pretty or Json + format: compact + # By default the logger has filtering only logs that came from your code or logs that came from `loco` framework. to see all third party libraries + # Uncomment the line below to override to see all third party libraries you can enable this config and override the logger filters. + # override_filter: trace + ``` + + - Server: - -```yaml -server: + +```yaml + server: # Port on which the server will listen. the server binding is 0.0.0.0:{PORT} - port: 3000 + port: {{get_env(name="NODE_PORT", default=3000)}} # The UI hostname or IP address that mailers will point to. host: http://localhost -``` + # Out of the box middleware configuration. to disable middleware you can changed the `enable` field to `false` of comment the middleware block + ``` + -- Database: -```yaml -database: +- Database: + +```yaml + database: # Database connection URI - uri: postgres://loco:loco@localhost:5432/loco_app -``` + uri: {{get_env(name="DATABASE_URL", default="postgres://loco:loco@localhost:5432/loco_app")}} + # When enabled, the sql query will be logged. + enable_logging: false + # Set the timeout duration when acquiring a connection. + connect_timeout: 500 + # Set the idle duration before closing a connection. + idle_timeout: 500 + # Minimum number of connections for a pool. + min_connections: 1 + # Maximum number of connections for a pool. + max_connections: 1 + # Run migration up when application loaded + auto_migrate: true + # Truncate database when application loaded. This is a dangerous operation, make sure that you using this flag only on dev environments or test mode + dangerously_truncate: false + # Recreating schema when application loaded. This is a dangerous operation, make sure that you using this flag only on dev environments or test mode + dangerously_recreate: false + ``` + -- Mailer: -```yaml -mailer: +- Mailer: + +```yaml + mailer: # SMTP mailer configuration. smtp: # Enable/Disable smtp mailer. enable: true # SMTP server host. e.x localhost, smtp.gmail.com host: localhost -``` - -- Redis: - -``` -redis: + # SMTP server port + port: 1025 + # Use secure connection (SSL/TLS). + secure: false + # auth: + # user: + # password: + ``` + + +- Queue: + +```yaml + queue: # Redis connection URI - uri: redis://127.0.0.1/ -``` + uri: {{get_env(name="REDIS_URL", default="redis://127.0.0.1")}} + # Dangerously flush all data in Redis on startup. dangerous operation, make sure that you using this flag only on dev environments or test mode + dangerously_flush: false + ``` + - JWT secret: - -```yaml -auth: + +```yaml + auth: # JWT authentication jwt: # Secret key for token generation and verification - secret: ... -``` + secret: PqRwLF2rhHe8J22oBeHy + # Token expiration time in seconds + expiration: 604800 # 7 days + ``` + + ## Generate Loco offers a deployment template enabling the creation of a deployment infrastructure. + ```sh cargo loco generate deployment ? โฏ Choose your deployment โ€บ @@ -102,6 +155,8 @@ cargo loco generate deployment skipped (exists): "dockerfile" added: ".dockerignore" ``` + + Deployment Options: diff --git a/docs-site/content/docs/getting-started/guide.md b/docs-site/content/docs/getting-started/guide.md index a83e46104..5201e8d46 100644 --- a/docs-site/content/docs/getting-started/guide.md +++ b/docs-site/content/docs/getting-started/guide.md @@ -43,24 +43,29 @@ You can follow this guide for a step-by-step "bottom up" learning, or you can ju ### Installing + ```sh -$ cargo install loco-cli +cargo install loco-cli +cargo install sea-orm-cli # Only when DB is needed ``` + + ### Creating a new Loco app Now you can create your new app (choose "SaaS app" for built-in authentication). + ```sh -$ loco new +โฏ loco new โœ” โฏ App name? ยท myapp -? โฏ What would you like to build? โ€บ - lightweight-service (minimal, only controllers and views) - Rest API (with DB and user auth) -โฏ SaaS app (with DB and user auth) +โœ” โฏ What would you like to build? ยท SaaS app (with DB and user auth) + ๐Ÿš‚ Loco app generated successfully in: myapp ``` + + You can now switch to to `myapp`: @@ -79,9 +84,15 @@ To configure a database, please run a local postgres database with loco:lo This docker command start up postgresql database server. + ```sh -docker run -d -p 5432:5432 -e POSTGRES_USER=loco -e POSTGRES_DB=myapp_development -e POSTGRES_PASSWORD="loco" postgres:15.3-alpine +docker run -d -p 5432:5432 \ + -e POSTGRES_USER=loco \ + -e POSTGRES_DB=myapp_development \ + -e POSTGRES_PASSWORD="loco" \ + postgres:15.3-alpine ``` + This docker command start up redis server: @@ -91,14 +102,16 @@ docker run -p 6379:6379 -d redis redis-server Use doctor command to check the needed resources: -``` + +```sh $ cargo loco doctor Finished dev [unoptimized + debuginfo] target(s) in 0.32s - Running `target/debug/myapp-cli doctor` + Running `target/debug/myapp-cli doctor` โœ… SeaORM CLI is installed โœ… DB connection: success โœ… Redis connection: success ``` + Here's a rundown of what Loco creates for you by default: @@ -125,32 +138,16 @@ Let's get some responses quickly. For this, we need to start up the server. ### Starting the server + ```sh -$ cargo loco start - - โ–„ โ–€ - โ–€ โ–„ - โ–„ โ–€ โ–„ โ–„ โ–„โ–€ - โ–„ โ–€โ–„โ–„ - โ–„ โ–€ โ–€ โ–€โ–„โ–€โ–ˆโ–„ - โ–€โ–ˆโ–„ -โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–€โ–€โ–ˆ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–€โ–ˆ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–€โ–€โ–€ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–„โ–ˆโ–„ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–„ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–„โ–„โ–„ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–€ - โ–€โ–€โ–€โ–ˆโ–ˆโ–„ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–ˆโ–ˆโ–€ - โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ - https://loco.rs - -listening on port 3000 +cargo loco start ``` + And now, let's see that it's alive: ```sh -$ curl localhost:3000/api/_ping +$ curl localhost:3000/_ping {"ok":true} ``` @@ -159,7 +156,7 @@ The built in `_ping` route will tell your load balancer everything is up. Let's see that all services that are required are up: ```sh -$ curl localhost:3000/api/_health +$ curl localhost:3000/_health {"ok":true} ``` @@ -190,7 +187,7 @@ pub async fn echo(req_body: String) -> String { req_body } -pub async fn hello(State(_ctx): State) -> Result { +pub async fn hello(State(_ctx): State) -> Result { // do something with context (database, etc) format::text("hello") } @@ -205,14 +202,16 @@ pub fn routes() -> Routes { Start the server: + ```sh -$ cargo loco start +cargo loco start ``` + Now, let's test it out: ```sh -$ curl localhost:3000/api/guide +$ curl localhost:3000/guide hello ``` @@ -238,7 +237,7 @@ Next, set up a _hello_ route, this is the contents of `home.rs`: use loco_rs::prelude::*; // _ctx contains your database connection, as well as other app resource that you'll need -async fn hello(State(_ctx): State) -> Result { +async fn hello(State(_ctx): State) -> Result { format::text("ola, mundo") } @@ -276,14 +275,16 @@ impl Hooks for App { That's it. Kill the server and bring it up again: + +```sh +cargo loco start ``` -$ cargo loco start -``` + And hit `/home/hello`: ```sh -$ curl localhost:3000/api/home/hello +$ curl localhost:3000/home/hello ola, mundo ``` @@ -293,18 +294,23 @@ You can take a look at all of your routes with: $ cargo loco routes .. .. -[POST] /auth/login -[POST] /auth/register -[POST] /auth/reset -[POST] /auth/verify +[POST] /api/auth/login +[POST] /api/auth/register +[POST] /api/auth/reset +[POST] /api/auth/verify [GET] /home/hello <---- this is our new route! -[GET] /notes -[POST] /notes +[GET] /api/notes +[POST] /api/notes .. .. $ ``` +
+The SaaS Starter keeps routes under /api because it is client-side ready.
+When using client-side routing like React Router, we want to separate backend routes from client routes: the browser will use /home but not /api/home which is the backend route, and you can call /api/home from the client with no worries. Nevertheless, the routes: /_health and /_ping are exceptions, they stay at the root. +
+ ## MVC and You **Traditional MVC (Model-View-Controller) originated in desktop UI programming paradigms.** However, its applicability to web services led to its rapid adoption. MVC's golden era was around the early 2010s, and since then, many other paradigms and architectures have emerged. @@ -518,14 +524,16 @@ pub fn routes() -> Routes { Now, start the app: + ```sh -$ cargo loco start +cargo loco start ``` + And make a request: ```sh -$ curl localhost:3000/api/articles +$ curl localhost:3000/articles [{"created_at":"...","updated_at":"...","id":1,"title":"how to build apps in 3 steps","content":"use Loco: https://loco.rs"}] ``` @@ -623,9 +631,11 @@ The order of the extractors is important, as changing the order of them can lead You can now test that it works, start the app: + ```sh -$ cargo loco start +cargo loco start ``` + Add a new article: @@ -633,14 +643,14 @@ Add a new article: $ curl -X POST -H "Content-Type: application/json" -d '{ "title": "Your Title", "content": "Your Content xxx" -}' localhost:3000/api/articles +}' localhost:3000/articles {"created_at":"...","updated_at":"...","id":2,"title":"Your Title","content":"Your Content xxx"} ``` Get a list: ```sh -$ curl localhost:3000/api/articles +$ curl localhost:3000/articles [{"created_at":"...","updated_at":"...","id":1,"title":"how to build apps in 3 steps","content":"use Loco: https://loco.rs"},{"created_at":"...","updated_at":"...","id":2,"title":"Your Title","content":"Your Content xxx"} ``` @@ -747,14 +757,14 @@ Now let's add a comment to Article `1`: $ curl -X POST -H "Content-Type: application/json" -d '{ "content": "this rocks", "article_id": 1 -}' localhost:3000/api/comments +}' localhost:3000/comments {"created_at":"...","updated_at":"...","id":4,"content":"this rocks","article_id":1} ``` And, fetch the relation: ```sh -$ curl localhost:3000/api/articles/1/comments +$ curl localhost:3000/articles/1/comments [{"created_at":"...","updated_at":"...","id":4,"content":"this rocks","article_id":1}] ``` diff --git a/docs-site/content/docs/getting-started/starters.md b/docs-site/content/docs/getting-started/starters.md index f9b9e17c6..4f6bb519a 100644 --- a/docs-site/content/docs/getting-started/starters.md +++ b/docs-site/content/docs/getting-started/starters.md @@ -15,20 +15,25 @@ flair =[] Simplify your project setup with Loco's predefined boilerplates, designed to make your development journey smoother. To get started, install our CLI and choose the template that suits your needs. + ```sh cargo install loco-cli +cargo install sea-orm-cli # Only when DB is needed ``` + Create a starter: + ```sh -loco new +โฏ loco new โœ” โฏ App name? ยท myapp -? โฏ What would you like to build? โ€บ -โฏ lightweight-service (minimal, only controllers and views) - Rest API (with DB and user auth) - SaaS app (with DB and user auth) +โœ” โฏ What would you like to build? ยท SaaS app (with DB and user auth) + +๐Ÿš‚ Loco app generated successfully in: +myapp ``` + ## Available Starters diff --git a/docs-site/content/docs/getting-started/tour/index.md b/docs-site/content/docs/getting-started/tour/index.md index 990351953..074a3e8db 100644 --- a/docs-site/content/docs/getting-started/tour/index.md +++ b/docs-site/content/docs/getting-started/tour/index.md @@ -19,73 +19,83 @@ flair =[]
Let's create a blog backend on `loco` in 4 commands. First install `loco-cli` and `sea-orm-cli`: + ```sh -$ cargo install loco-cli -$ cargo install sea-orm-cli +cargo install loco-cli +cargo install sea-orm-cli # Only when DB is needed ``` + -Now you can create your new app (choose "SaaS app"). -```sh -$ loco new -โœ” โฏ App name? ยท myapp -? โฏ What would you like to build? โ€บ - lightweight-service (minimal, only controllers and views) - Rest API (with DB and user auth) -โฏ SaaS app (with DB and user auth) -๐Ÿš‚ Loco app generated successfully in: -myapp -``` + Now you can create your new app (choose "`SaaS` app"). -
-To configure a database , please run a local postgres database with loco:loco and a db named is the [insert app]_development. -
+ ```sh + $ loco new + โœ” โฏ App name? ยท myapp + ? โฏ What would you like to build? โ€บ + lightweight-service (minimal, only controllers and views) + Rest API (with DB and user auth) + โฏ SaaS app (with DB and user auth) + ๐Ÿš‚ Loco app generated successfully in: + myapp + ``` -You can use Docker to run a Postgres instance: +
+ To configure a database , please run a local postgres database with + loco:loco and a db named is the [insert app]_development. +
-When generating a starter, the database name incorporates your application name and the environment. For instance, if you include `myapp`, the database name in the `test.yaml`configuration will be `myapp_test`, and in the `development.yaml` configuration, it will be `myapp_development`. + You can use Docker to run a Postgres instance: + When generating a starter, the database name incorporates your application + name and the environment. For instance, if you include `myapp`, the database + name in the `test.yaml`configuration will be `myapp_test`, and in the + `development.yaml` configuration, it will be `myapp_development`. + + +```sh +docker run -d -p 5432:5432 \ + -e POSTGRES_USER=loco \ + -e POSTGRES_DB=myapp_development \ + -e POSTGRES_PASSWORD="loco" \ + postgres:15.3-alpine ``` -$ docker run -d -p 5432:5432 -e POSTGRES_USER=loco -e POSTGRES_DB=myapp_development -e POSTGRES_PASSWORD="loco" postgres:15.3-alpine -``` + -A more advanced set of `docker-compose.yml` and `Dockerfiles` that include Redis and the `mailtutan` mailer are available for [each starter on GitHub](https://github.com/loco-rs/loco/blob/master/starters/saas/.devcontainer/docker-compose.yml). -Now `cd` into your `myapp` and start your app: + A more advanced set of `docker-compose.yml` and `Dockerfiles` that include Redis and the `mailtutan` mailer are available for [each starter on GitHub](https://github.com/loco-rs/loco/blob/master/starters/saas/.devcontainer/docker-compose.yml). -``` -$ cd myapp -$ cargo loco start -Finished dev [unoptimized + debuginfo] target(s) in 21.63s - Running `target/debug/myapp start` + Now `cd` into your `myapp` and start your app: - : - : - : - -controller/app_routes.rs:203: [Middleware] Adding log trace id + +```sh +$ cargo loco start โ–„ โ–€ - โ–€ โ–„ + โ–€ โ–„ โ–„ โ–€ โ–„ โ–„ โ–„โ–€ โ–„ โ–€โ–„โ–„ โ–„ โ–€ โ–€ โ–€โ–„โ–€โ–ˆโ–„ โ–€โ–ˆโ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–€โ–€โ–ˆ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–€โ–ˆ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–€โ–€โ–€ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–„โ–ˆโ–„ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–„ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–„โ–„โ–„ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–€ - โ–€โ–€โ–€โ–ˆโ–ˆโ–„ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–ˆโ–ˆโ–€ - โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ - -started on port 3000 +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–€โ–ˆ +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–€โ–€โ–€ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–„โ–ˆโ–„ +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–„ +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–„โ–„โ–„ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–€ + โ–€โ–€โ–€โ–ˆโ–ˆโ–„ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–ˆโ–ˆโ–€ + โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ + https://loco.rs + +listening on port 3000 ``` + + -
-You don't have to run things through `cargo` but in development it's highly recommended. If you build `--release`, your binary contains everything including your code and `cargo` or Rust is not needed. -
+
+ You don't have to run things through `cargo` but in development it's highly + recommended. If you build `--release`, your binary contains everything + including your code and `cargo` or Rust is not needed.
## Adding a CRUD API @@ -110,10 +120,29 @@ injected: "tests/requests/mod.rs" Your database have been migrated and model, entities, and a full CRUD controller have been generated automatically. Start your app: - + ```sh $ cargo loco start + + โ–„ โ–€ + โ–€ โ–„ + โ–„ โ–€ โ–„ โ–„ โ–„โ–€ + โ–„ โ–€โ–„โ–„ + โ–„ โ–€ โ–€ โ–€โ–„โ–€โ–ˆโ–„ + โ–€โ–ˆโ–„ +โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–€โ–€โ–ˆ +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–€โ–ˆ +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–€โ–€โ–€ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–„โ–ˆโ–„ +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–„ +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–„โ–„โ–„ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ +โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–€ + โ–€โ–€โ–€โ–ˆโ–ˆโ–„ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–ˆโ–ˆโ–€ + โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ + https://loco.rs + +listening on port 3000 ``` + Next, try adding a `post` with `curl`: @@ -121,13 +150,13 @@ Next, try adding a `post` with `curl`: $ curl -X POST -H "Content-Type: application/json" -d '{ "title": "Your Title", "content": "Your Content xxx" -}' localhost:3000/api/posts +}' localhost:3000/posts ``` You can list your posts: ```sh -$ curl localhost:3000/api/posts +$ curl localhost:3000/posts ``` For those counting -- the commands for creating a blog backend were: @@ -147,20 +176,24 @@ To authenticate, you will need a running redis server. This docker command starts up a redis server: -``` + +```sh docker run -p 6379:6379 -d redis redis-server ``` + Use doctor command to check the needed resources: -``` + +```sh $ cargo loco doctor Finished dev [unoptimized + debuginfo] target(s) in 0.32s - Running `target/debug/myapp-cli doctor` + Running `target/debug/myapp-cli doctor` โœ… SeaORM CLI is installed โœ… DB connection: success โœ… Redis connection: success ``` + ### Registering a New User diff --git a/docs-site/content/docs/the-app/cache.md b/docs-site/content/docs/the-app/cache.md new file mode 100644 index 000000000..ec590f161 --- /dev/null +++ b/docs-site/content/docs/the-app/cache.md @@ -0,0 +1,41 @@ ++++ +title = "Cache" +description = "" +date = 2024-02-07T08:00:00+00:00 +updated = 2024-02-07T08:00:00+00:00 +draft = false +weight = 20 +sort_by = "weight" +template = "docs/page.html" + +[extra] +lead = "" +toc = true +top = false +flair =[] ++++ + +`Loco` provides an cache layer to improve application performance by storing frequently accessed data. + +## Default Behavior + +By default, `Loco` initializes a `Null` cache driver. This means any interaction with the cache will return an error, effectively bypassing the cache functionality. + +## Enabling Caching + +To enable caching and configure a specific cache driver, you can replace the default `Null` driver with your preferred implementation. + +In your `app.rs` file, define a function named `after_context` function as a Hook in the `app.rs` file and import the `cache` module from `loco_rs`. + +Here's an example using an in-memory cache driver: + +```rust +use loco_rs::cache; + +async fn after_context(ctx: AppContext) -> Result { + Ok(AppContext { + cache: cache::Cache::new(cache::drivers::inmem::new()).into(), + ..ctx + }) +} +``` \ No newline at end of file diff --git a/docs-site/content/docs/the-app/models.md b/docs-site/content/docs/the-app/models.md index ecdf07416..70635dc55 100644 --- a/docs-site/content/docs/the-app/models.md +++ b/docs-site/content/docs/the-app/models.md @@ -103,9 +103,9 @@ For schema data types, you can use the following mapping to understand the schem ("int", "integer_null"), ("int!", "integer"), ("int^", "integer_uniq"), -("big_integer", "big_integer_null"), -("big_integer!", "big_integer"), -("big_integer^", "big_integer_uniq"), +("big_int", "big_integer_null"), +("big_int!", "big_integer"), +("big_int^", "big_integer_uniq"), ("float", "float_null"), ("float!", "float"), ("double", "double_null"), diff --git a/docs-site/content/docs/the-app/storage.md b/docs-site/content/docs/the-app/storage.md index 52284c81c..665fcb247 100644 --- a/docs-site/content/docs/the-app/storage.md +++ b/docs-site/content/docs/the-app/storage.md @@ -25,17 +25,17 @@ By default, in-memory and disk storage come out of the box. To work with cloud p - `storage_gcp` - `all_storage` +By default loco initialize a `Null` provider, meaning any work with the storage will return an error. + ## Setup -Add the `storage` function as a Hook in the `app.rs` file and import the `storage` module from `loco_rs`. +Add the `after_context` function as a Hook in the `app.rs` file and import the `storage` module from `loco_rs`. ```rust use loco_rs::storage; -impl Hooks for App { - async fn storage(_config: &Config, environment: &Environment) -> Result> { - return Ok(None); - } +async fn after_context(ctx: AppContext) -> Result { + Ok(ctx) } ``` @@ -59,13 +59,13 @@ In this example, we initialize the in-memory driver and create a new storage wit ```rust use loco_rs::storage; -async fn storage( - _config: &Config, - environment: &Environment, - ) -> Result> { - let storage = Storage::single(storage::drivers::mem::new()); - return Ok(Some(storage)); - } + +async fn after_context(ctx: AppContext) -> Result { + Ok(AppContext { + storage: Storage::single(storage::drivers::mem::new()).into(), + ..ctx + }) +} ``` ### Multiple Drivers @@ -175,11 +175,7 @@ async fn upload_file( })?; let path = PathBuf::from("folder").join(file_name); - ctx.storage - .as_ref() - .unwrap() - .upload(path.as_path(), &content) - .await?; + ctx.storage.as_ref().upload(path.as_path(), &content).await?; file = Some(path); } @@ -209,7 +205,7 @@ async fn can_register() { let res: views::upload::Response = serde_json::from_str(&response.text()).unwrap(); - let stored_file: String = ctx.storage.unwrap().download(&res.path).await.unwrap(); + let stored_file: String = ctx.storage.as_ref().download(&res.path).await.unwrap(); assert_eq!(stored_file, file_content); }) diff --git a/docs-site/templates/shortcodes/get_env.html b/docs-site/templates/shortcodes/get_env.html new file mode 100644 index 000000000..e69de29bb diff --git a/examples/demo/Cargo.lock b/examples/demo/Cargo.lock index 053332ec0..22a376ae7 100644 --- a/examples/demo/Cargo.lock +++ b/examples/demo/Cargo.lock @@ -29,9 +29,9 @@ dependencies = [ [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher", @@ -54,9 +54,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom", "once_cell", @@ -65,9 +65,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -78,9 +78,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -108,9 +108,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -129,47 +129,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -177,15 +178,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arc-swap" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "argon2" @@ -228,22 +229,21 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener 5.0.0", - "event-listener-strategy 0.5.0", + "event-listener-strategy 0.5.2", "futures-core", "pin-project-lite", ] [[package]] name = "async-compression" -version = "0.4.6" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" +checksum = "9c90a406b4495d129f00461241616194cb8a032c8d1c53c657f0961d5f8e0498" dependencies = [ "brotli", "flate2", @@ -257,15 +257,14 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.8.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" dependencies = [ - "async-lock 3.3.0", "async-task", "concurrent-queue", - "fastrand 2.0.1", - "futures-lite 2.2.0", + "fastrand 2.1.0", + "futures-lite 2.3.0", "slab", ] @@ -275,12 +274,12 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ - "async-channel 2.2.0", + "async-channel 2.3.1", "async-executor", - "async-io 2.3.1", + "async-io 2.3.2", "async-lock 3.3.0", "blocking", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "once_cell", "tokio", ] @@ -307,18 +306,18 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" +checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" dependencies = [ "async-lock 3.3.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "parking", - "polling 3.4.0", - "rustix 0.38.31", + "polling 3.7.0", + "rustix 0.38.34", "slab", "tracing", "windows-sys 0.52.0", @@ -390,24 +389,24 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "async-task" -version = "4.7.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -425,27 +424,6 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" -[[package]] -name = "atomic-write-file" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edcdbedc2236483ab103a53415653d6b4442ea6141baf1ffa85df29635e88436" -dependencies = [ - "nix", - "rand", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "auto-future" version = "1.0.0" @@ -454,9 +432,9 @@ checksum = "3c1e7e457ea78e524f48639f551fd79703ac3f2237f5ecccdf4708f8a75ad373" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "axum" @@ -469,7 +447,7 @@ dependencies = [ "bitflags 1.3.2", "bytes", "futures-util", - "http 0.2.11", + "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", "itoa", @@ -480,7 +458,7 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", - "sync_wrapper", + "sync_wrapper 0.1.2", "tower", "tower-layer", "tower-service", @@ -488,19 +466,19 @@ dependencies = [ [[package]] name = "axum" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1236b4b292f6c4d6dc34604bb5120d85c3fe1d1aa596bd5cc52ca054d13e7b9e" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" dependencies = [ "async-trait", "axum-core 0.4.3", "axum-macros", "bytes", "futures-util", - "http 1.0.0", + "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.1.0", + "hyper 1.3.1", "hyper-util", "itoa", "matchit", @@ -514,7 +492,7 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.1", "tokio", "tower", "tower-layer", @@ -531,7 +509,7 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 0.2.11", + "http 0.2.12", "http-body 0.4.6", "mime", "rustversion", @@ -548,13 +526,13 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 1.0.0", + "http 1.1.0", "http-body 1.0.0", "http-body-util", "mime", "pin-project-lite", "rustversion", - "sync_wrapper", + "sync_wrapper 0.1.2", "tower-layer", "tower-service", "tracing", @@ -562,16 +540,16 @@ dependencies = [ [[package]] name = "axum-extra" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "895ff42f72016617773af68fb90da2a9677d89c62338ec09162d4909d86fdd8f" +checksum = "0be6ea09c9b96cb5076af0de2e383bd2bc0c18f827cf1967bdd353e0b910d733" dependencies = [ - "axum 0.7.4", + "axum 0.7.5", "axum-core 0.4.3", "bytes", "cookie", "futures-util", - "http 1.0.0", + "http 1.1.0", "http-body 1.0.0", "http-body-util", "mime", @@ -580,6 +558,7 @@ dependencies = [ "tower", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -588,10 +567,10 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00c055ee2d014ae5981ce1016374e8213682aa14d9bf40e48ab48b5f3ef20eaa" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -600,11 +579,11 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b683cbc43010e9a3d72c2f31ca464155ff4f95819e88a32924b0f47a43898978" dependencies = [ - "axum 0.7.4", + "axum 0.7.5", "bytes", "futures", "futures-core", - "http 1.0.0", + "http 1.1.0", "http-body 1.0.0", "matchit", "metrics", @@ -618,19 +597,19 @@ dependencies = [ [[package]] name = "axum-test" -version = "14.3.0" +version = "14.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc431b62ab307c833af24700936485eb5f9a8ac18a19347fe37dd4f7ae3dffe9" +checksum = "4c5dd01c3ff7d926efc6db38bc9a2a5fe82ebe3bf85e44200a7ae3b6bda5f4e5" dependencies = [ "anyhow", "async-trait", "auto-future", - "axum 0.7.4", + "axum 0.7.5", "bytes", "cookie", - "http 1.0.0", + "http 1.1.0", "http-body-util", - "hyper 1.1.0", + "hyper 1.3.1", "hyper-util", "mime", "pretty_assertions", @@ -651,10 +630,10 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26965dca35be1ca4a128177b9302c4c04f0661443621171adb09d002dcdf1d5" dependencies = [ - "axum 0.7.4", + "axum 0.7.5", "futures-core", "futures-util", - "http 1.0.0", + "http 1.1.0", "opentelemetry", "pin-project-lite", "tower", @@ -678,7 +657,7 @@ dependencies = [ "cookie", "dashmap", "futures", - "http 1.0.0", + "http 1.1.0", "http-body 1.0.0", "rand", "serde", @@ -693,9 +672,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -730,6 +709,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -768,9 +753,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" dependencies = [ "serde", ] @@ -801,7 +786,7 @@ name = "blo" version = "0.1.0" dependencies = [ "async-trait", - "axum 0.7.4", + "axum 0.7.5", "axum-extra", "axum-test", "axum_session", @@ -842,25 +827,23 @@ dependencies = [ [[package]] name = "blocking" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" dependencies = [ - "async-channel 2.2.0", + "async-channel 2.3.1", "async-lock 3.3.0", "async-task", - "fastrand 2.0.1", "futures-io", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "piper", - "tracing", ] [[package]] name = "borsh" -version = "1.3.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" +checksum = "dbe5b10e214954177fb1dc9fbd20a1a2608fe99e6c832033bdc7cea287a20d77" dependencies = [ "borsh-derive", "cfg_aliases", @@ -868,23 +851,23 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.3.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" +checksum = "d7a8646f94ab393e43e8b35a2558b1624bed28b97ee09c5d15456e3c9463f46d" dependencies = [ "once_cell", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "syn_derive", ] [[package]] name = "brotli" -version = "3.4.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" +checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -893,9 +876,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.5.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" +checksum = "e6221fe77a248b9117d431ad93761222e1cf8ff282d9d1d5d9f53d6299a1cf76" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -907,11 +890,11 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d43b38e074cc0de2957f10947e376a1d88b9c4dbab340b590800cc1b2e066b2" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.11", "base64 0.13.1", "bitvec", "hex", - "indexmap 2.2.2", + "indexmap 2.2.6", "js-sys", "once_cell", "rand", @@ -924,9 +907,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", "serde", @@ -940,9 +923,9 @@ checksum = "0d75b8252ed252f881d1dc4482ae3c3854df6ee8183c1906bac50ff358f4f89f" [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-unit" @@ -984,24 +967,24 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "camino" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] @@ -1014,7 +997,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.21", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -1022,12 +1005,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -1044,9 +1028,9 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1054,14 +1038,14 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] name = "chrono-tz" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d7b79e99bfaa0d47da0687c43aa3b7381938a62ad3a6498599039321f660b7" +checksum = "d59ae0466b83e838b81a54256c39d5d7c20b9d7daa10510a242d9b75abd5936e" dependencies = [ "chrono", "chrono-tz-build", @@ -1085,7 +1069,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eebd66744a15ded14960ab4ccdbfb51ad3b81f51f3f04a80adac98c985396c9" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", "stacker", ] @@ -1101,9 +1085,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.0" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80c21025abd42669a92efc996ef13cfb2c5c627858421ea58d5c3b331a6c134f" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -1111,26 +1095,26 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.0" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458bf1f341769dfcf849846f65dffdf9146daa56bcd2a47cb4e1de9915567c99" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", + "strsim 0.11.1", ] [[package]] name = "clap_derive" -version = "4.5.0" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1141,9 +1125,9 @@ checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "colored" @@ -1157,9 +1141,9 @@ dependencies = [ [[package]] name = "combine" -version = "4.6.6" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ "bytes", "futures-core", @@ -1171,9 +1155,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -1213,12 +1197,12 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "cookie" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cd91cf61412820176e137621345ee43b3f4423e589e7ae4e50d601d93e35ef8" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" dependencies = [ "aes-gcm", - "base64 0.21.7", + "base64 0.22.1", "percent-encoding", "rand", "subtle", @@ -1243,9 +1227,9 @@ dependencies = [ [[package]] name = "crc" -version = "3.0.1" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ "crc-catalog", ] @@ -1258,9 +1242,9 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -1278,9 +1262,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -1315,9 +1299,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crossterm" @@ -1416,7 +1400,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", @@ -1430,9 +1414,9 @@ checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "pem-rfc7468", @@ -1475,9 +1459,9 @@ dependencies = [ [[package]] name = "deunicode" -version = "1.4.2" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae2a35373c5c74340b79ae6780b498b2b183915ec5dacf263aac5a099bf485a" +checksum = "339544cc9e2c4dc3fc7149fd630c5f22263a4fdf18a98afd0075784968b5cf00" [[package]] name = "diff" @@ -1526,7 +1510,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1559,22 +1543,34 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +[[package]] +name = "educe" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4bd92664bf78c4d3dba9b7cdafce6fa15b13ed3ed16175218196942e99168a8" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "either" -version = "1.9.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" dependencies = [ "serde", ] [[package]] name = "email-encoding" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbfb21b9878cf7a348dcb8559109aabc0ec40d69924bd706fa5149846c4fef75" +checksum = "60d1d33cdaede7e24091f039632eb5d3c7469fe5b066a985281a34fc70fa317f" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "memchr", ] @@ -1592,9 +1588,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -1605,12 +1601,32 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -1619,9 +1635,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1657,9 +1673,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "5.0.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b72557800024fabbaa2449dd4bf24e37b93702d457a4d4f2b0dd1f0f039f20c1" +checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" dependencies = [ "concurrent-queue", "parking", @@ -1678,11 +1694,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 5.0.0", + "event-listener 5.3.0", "pin-project-lite", ] @@ -1707,9 +1723,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "filetime" @@ -1719,7 +1735,7 @@ checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "windows-sys 0.52.0", ] @@ -1731,9 +1747,9 @@ checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -1741,9 +1757,9 @@ dependencies = [ [[package]] name = "fluent" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f69378194459db76abd2ce3952b790db103ceb003008d3d50d97c41ff847a7" +checksum = "bb74634707bebd0ce645a981148e8fb8c7bccd4c33c652aeffd28bf2f96d555a" dependencies = [ "fluent-bundle", "unic-langid", @@ -1751,9 +1767,9 @@ dependencies = [ [[package]] name = "fluent-bundle" -version = "0.15.2" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e242c601dec9711505f6d5bbff5bedd4b61b2469f2e8bb8e57ee7c9747a87ffd" +checksum = "7fe0a21ee80050c678013f82edf4b705fe2f26f1f9877593d13198612503f493" dependencies = [ "fluent-langneg", "fluent-syntax", @@ -1776,9 +1792,9 @@ dependencies = [ [[package]] name = "fluent-syntax" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0abed97648395c902868fee9026de96483933faa54ea3b40d652f7dfe61ca78" +checksum = "2a530c4694a6a8d528794ee9bbd8ba0122e779629ac908d15ad5a7ae7763a33d" dependencies = [ "thiserror", ] @@ -1811,7 +1827,7 @@ dependencies = [ "fluent-syntax", "fluent-template-macros", "flume 0.10.14", - "heck", + "heck 0.4.1", "ignore", "intl-memoizer", "lazy_static", @@ -1949,11 +1965,11 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.0.1", + "fastrand 2.1.0", "futures-core", "futures-io", "parking", @@ -1968,7 +1984,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1985,9 +2001,9 @@ checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" @@ -2029,9 +2045,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -2042,9 +2058,9 @@ dependencies = [ [[package]] name = "ghash" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" dependencies = [ "opaque-debug", "polyval", @@ -2071,8 +2087,8 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -2109,27 +2125,8 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.11", - "indexmap 2.2.2", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "h2" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31d030e59af851932b72ceebadf4a2b5986dba4c3b99dd2493f8273a0f151943" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 1.0.0", - "indexmap 2.2.2", + "http 0.2.12", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -2142,25 +2139,16 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", ] [[package]] name = "hashbrown" -version = "0.13.1" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ff8ae62cd3a9102e5637afc8452c55acf3844001bd5374e0b0bd7b6616c038" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.7", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash 0.8.7", + "ahash 0.8.11", "allocator-api2", ] @@ -2170,7 +2158,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -2183,19 +2171,16 @@ dependencies = [ ] [[package]] -name = "hermit-abi" -version = "0.1.19" +name = "heck" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.5" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -2241,11 +2226,22 @@ dependencies = [ "winapi", ] +[[package]] +name = "hostname" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9c7c7c8ac16c798734b8a24560c1362120597c40d5e1459f09498f8f6c8f2ba" +dependencies = [ + "cfg-if", + "libc", + "windows", +] + [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -2254,9 +2250,9 @@ dependencies = [ [[package]] name = "http" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -2270,7 +2266,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http 0.2.11", + "http 0.2.12", "pin-project-lite", ] @@ -2281,27 +2277,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ "bytes", - "http 1.0.0", + "http 1.1.0", ] [[package]] name = "http-body-util" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" dependencies = [ "bytes", - "futures-util", - "http 1.0.0", + "futures-core", + "http 1.1.0", "http-body 1.0.0", "pin-project-lite", ] [[package]] name = "http-range-header" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ce4ef31cda248bbdb6e6820603b82dfcd9e833db65a43e997a0ccec777d11fe" +checksum = "08a397c49fec283e3d6211adbe480be95aae5f304cfb923e9970e08956d5168a" [[package]] name = "httparse" @@ -2350,14 +2346,14 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.3.26", - "http 0.2.11", + "h2", + "http 0.2.12", "http-body 0.4.6", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.5", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -2366,20 +2362,20 @@ dependencies = [ [[package]] name = "hyper" -version = "1.1.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5aa53871fc917b1a9ed87b683a5d86db645e23acb32c2e0785a353e522fb75" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.2", - "http 1.0.0", + "http 1.1.0", "http-body 1.0.0", "httparse", "httpdate", "itoa", "pin-project-lite", + "smallvec", "tokio", "want", ] @@ -2405,11 +2401,11 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.0.0", + "http 1.1.0", "http-body 1.0.0", - "hyper 1.1.0", + "hyper 1.3.1", "pin-project-lite", - "socket2 0.5.5", + "socket2 0.5.7", "tokio", "tower", "tower-service", @@ -2492,7 +2488,7 @@ dependencies = [ "globset", "log", "memchr", - "regex-automata 0.4.5", + "regex-automata 0.4.6", "same-file", "walkdir", "winapi-util", @@ -2535,12 +2531,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.2" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -2551,7 +2547,7 @@ checksum = "0122b7114117e64a63ac49f752a5ca4624d534c7b1c7de796ac196381cd2d947" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -2581,9 +2577,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.34.0" +version = "1.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc" +checksum = "810ae6042d48e2c9e9215043563a58a80b877bc863228a74cf10c49d4620a6f5" dependencies = [ "console", "lazy_static", @@ -2593,23 +2589,22 @@ dependencies = [ "regex", "serde", "similar", - "yaml-rust", ] [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] [[package]] name = "intl-memoizer" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c310433e4a310918d6ed9243542a6b83ec1183df95dff8f23f87bb88a264a66f" +checksum = "fe22e020fce238ae18a6d5d8c502ee76a52a6e880d99477657e6acc30ec57bda" dependencies = [ "type-map", "unic-langid", @@ -2630,7 +2625,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.5", + "hermit-abi", "libc", "windows-sys 0.48.0", ] @@ -2641,7 +2636,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.5", + "socket2 0.5.7", "widestring", "windows-sys 0.48.0", "winreg", @@ -2653,6 +2648,23 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[package]] +name = "is-terminal" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.12.1" @@ -2664,33 +2676,33 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.28" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] [[package]] name = "jsonwebtoken" -version = "9.2.0" +version = "9.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7ea04a7c5c055c175f189b6dc6ba036fd62306b58c66c9f6389036c503a3f4" +checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" dependencies = [ "base64 0.21.7", "js-sys", @@ -2721,39 +2733,39 @@ dependencies = [ [[package]] name = "lettre" -version = "0.11.4" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357ff5edb6d8326473a64c82cf41ddf78ab116f89668c50c4fac1b321e5e80f4" +checksum = "1a62049a808f1c4e2356a2a380bd5f2aca3b011b0b482cf3b914ba1731426969" dependencies = [ "async-trait", - "base64 0.21.7", + "base64 0.22.1", "chumsky", "email-encoding", "email_address", - "fastrand 2.0.1", + "fastrand 2.1.0", "futures-io", "futures-util", - "hostname", + "hostname 0.4.0", "httpdate", "idna 0.5.0", "mime", "nom", "percent-encoding", "quoted_printable", - "rustls 0.22.2", - "rustls-pemfile 2.0.0", - "socket2 0.5.5", + "rustls 0.23.8", + "rustls-pemfile 2.1.2", + "socket2 0.5.7", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "url", "webpki-roots 0.26.1", ] [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libm" @@ -2763,13 +2775,12 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "libc", - "redox_syscall", ] [[package]] @@ -2797,15 +2808,15 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -2816,7 +2827,7 @@ name = "loco-extras" version = "0.4.0" dependencies = [ "async-trait", - "axum 0.7.4", + "axum 0.7.5", "axum-prometheus", "axum-tracing-opentelemetry", "init-tracing-opentelemetry", @@ -2838,7 +2849,7 @@ name = "loco-macros" version = "0.1.0" dependencies = [ "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -2847,7 +2858,7 @@ version = "0.4.0" dependencies = [ "argon2", "async-trait", - "axum 0.7.4", + "axum 0.7.5", "axum-extra", "axum-test", "backtrace_printer", @@ -2863,12 +2874,13 @@ dependencies = [ "eyre", "fs-err", "futures-util", - "hyper 1.1.0", + "hyper 1.3.1", "include_dir", "jsonwebtoken", "lazy_static", "lettre", "mime", + "moka", "object_store", "rand", "regex", @@ -2894,9 +2906,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" dependencies = [ "value-bag", ] @@ -2949,29 +2961,29 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "metrics" -version = "0.22.0" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77b9e10a211c839210fd7f99954bda26e5f8e26ec686ad68da6a32df7c80e782" +checksum = "2be3cbd384d4e955b231c895ce10685e3d8260c5ccffae898c96c723b0772835" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.11", "portable-atomic", ] [[package]] name = "metrics-exporter-prometheus" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a4c4718a371ddfb7806378f23617876eea8b82e5ff1324516bcd283249d9ea" +checksum = "9bf4e7146e30ad172c42c39b3246864bd2d3c6396780711a1baf749cfe423e21" dependencies = [ "base64 0.21.7", "hyper 0.14.28", - "indexmap 1.9.3", + "indexmap 2.2.6", "ipnet", "metrics", "metrics-util", @@ -2982,13 +2994,13 @@ dependencies = [ [[package]] name = "metrics-util" -version = "0.16.0" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2670b8badcc285d486261e2e9f1615b506baff91427b61bd336a472b65bbf5ed" +checksum = "8b07a5eb561b8cbc16be2d216faf7757f9baf3bfb94dbb0fae3df8387a5bb47f" dependencies = [ "crossbeam-epoch", "crossbeam-utils", - "hashbrown 0.13.1", + "hashbrown 0.14.5", "metrics", "num_cpus", "quanta", @@ -3028,18 +3040,18 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", @@ -3047,6 +3059,26 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "moka" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e0d88686dc561d743b40de8269b26eaf0dc58781bde087b0984646602021d08" +dependencies = [ + "crossbeam-channel", + "crossbeam-epoch", + "crossbeam-utils", + "once_cell", + "parking_lot", + "quanta", + "rustc_version 0.4.0", + "smallvec", + "tagptr", + "thiserror", + "triomphe", + "uuid", +] + [[package]] name = "mongodb" version = "2.8.2" @@ -3072,7 +3104,7 @@ dependencies = [ "percent-encoding", "rand", "rustc_version_runtime", - "rustls 0.21.10", + "rustls 0.21.12", "rustls-pemfile 1.0.4", "serde", "serde_bytes", @@ -3096,33 +3128,21 @@ dependencies = [ [[package]] name = "multer" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15d522be0a9c3e46fd2632e272d178f56387bdb5c9fbb3a36c649062e9b5219" +checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" dependencies = [ "bytes", "encoding_rs", "futures-util", - "http 1.0.0", + "http 1.1.0", "httparse", - "log", "memchr", "mime", "spin 0.9.8", "version_check", ] -[[package]] -name = "nix" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" -dependencies = [ - "bitflags 2.4.2", - "cfg-if", - "libc", -] - [[package]] name = "nom" version = "7.1.3" @@ -3151,11 +3171,10 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -3194,9 +3213,9 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", @@ -3205,9 +3224,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -3219,16 +3238,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.5", - "libc", -] - -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ + "hermit-abi", "libc", ] @@ -3243,9 +3253,9 @@ dependencies = [ [[package]] name = "object_store" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d139f545f64630e2e3688fd9f81c470888ab01edeb72d13b4e86c566f1130000" +checksum = "b8718f8b65fdf67a45108d1548347d4af7d71fb81ce727bbf9e3b2535e079db3" dependencies = [ "async-trait", "bytes", @@ -3270,9 +3280,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "opentelemetry" @@ -3297,7 +3307,7 @@ checksum = "7690dc77bf776713848c4faa6501157469017eaf332baccd4eb1cea928743d94" dependencies = [ "async-trait", "bytes", - "http 0.2.11", + "http 0.2.12", "opentelemetry", ] @@ -3309,7 +3319,7 @@ checksum = "1a016b8d9495c639af2145ac22387dcb88e44118e45320d9238fbf4e7889abcb" dependencies = [ "async-trait", "futures-core", - "http 0.2.11", + "http 0.2.12", "opentelemetry", "opentelemetry-http", "opentelemetry-proto", @@ -3406,11 +3416,11 @@ version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec4c6225c69b4ca778c0aea097321a64c421cf4577b331c61b229267edabb6f8" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -3427,9 +3437,9 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", "parking_lot_core", @@ -3437,22 +3447,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] name = "parse-zoneinfo" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c705f256449c60da65e11ff6626e0c16a0a0b96aaa348de61376b249bc340f41" +checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24" dependencies = [ "regex", ] @@ -3470,9 +3480,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pbkdf2" @@ -3485,11 +3495,11 @@ dependencies = [ [[package]] name = "pem" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310" +checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "serde", ] @@ -3510,9 +3520,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.7" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" dependencies = [ "memchr", "thiserror", @@ -3521,9 +3531,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.7" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1288dbd7786462961e69bfd4df7848c1e37e8b74303dbdab82c3a9cdd2809" +checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" dependencies = [ "pest", "pest_generator", @@ -3531,22 +3541,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.7" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1381c29a877c6d34b8c176e734f35d7f7f5b3adaefe940cb4d1bb7af94678e2e" +checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "pest_meta" -version = "2.7.7" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0934d6907f148c22a3acbda520c7eed243ad7487a30f51f6ce52b58b7077a8a" +checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" dependencies = [ "once_cell", "pest", @@ -3593,29 +3603,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -3625,12 +3635,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +checksum = "464db0c665917b13ebb5d453ccdec4add5658ee1adc7affc7677615356a8afaf" dependencies = [ "atomic-waker", - "fastrand 2.0.1", + "fastrand 2.1.0", "futures-io", ] @@ -3657,9 +3667,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "polling" @@ -3679,23 +3689,24 @@ dependencies = [ [[package]] name = "polling" -version = "3.4.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14" +checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" dependencies = [ "cfg-if", "concurrent-queue", + "hermit-abi", "pin-project-lite", - "rustix 0.38.31", + "rustix 0.38.34", "tracing", "windows-sys 0.52.0", ] [[package]] name = "polyval" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ "cfg-if", "cpufeatures", @@ -3772,18 +3783,18 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", "prost-derive", @@ -3791,15 +3802,15 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.5" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9554e3ab233f0a932403704f1a1d08c30d5ccd931adfdfa1e8b5a19b52c1d55a" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -3833,9 +3844,9 @@ dependencies = [ [[package]] name = "quanta" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c" +checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" dependencies = [ "crossbeam-utils", "libc", @@ -3854,9 +3865,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -3905,18 +3916,18 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.0.1" +version = "11.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" +checksum = "e29830cbb1290e404f24c73af91c5d8d631ce7e128691e9477556b540cd01ecd" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", ] [[package]] name = "rayon" -version = "1.8.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -3961,11 +3972,20 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", @@ -3974,14 +3994,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -3995,13 +4015,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -4012,15 +4032,15 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "relative-path" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" +checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" [[package]] name = "rend" @@ -4073,22 +4093,23 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" dependencies = [ - "hostname", + "hostname 0.3.1", "quick-error", ] [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin 0.9.8", "untrusted", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4129,7 +4150,7 @@ dependencies = [ "cruet", "fs-err", "glob", - "heck", + "heck 0.4.1", "regex", "serde", "serde_json", @@ -4184,7 +4205,7 @@ dependencies = [ "regex", "relative-path", "rustc_version 0.4.0", - "syn 2.0.48", + "syn 2.0.66", "unicode-ident", ] @@ -4197,7 +4218,7 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http 0.2.11", + "http 0.2.12", "mime", "mime_guess", "rand", @@ -4206,9 +4227,9 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.34.2" +version = "1.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "755392e1a2f77afd95580d3f0d0e94ac83eeeb7167552c9b5bca549e61a94d83" +checksum = "1790d1c4c0ca81211399e0e0af16333276f375209e71a37b67698a373db5b47a" dependencies = [ "arrayvec", "borsh", @@ -4222,9 +4243,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -4247,7 +4268,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.21", + "semver 1.0.23", ] [[package]] @@ -4276,22 +4297,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring", @@ -4301,14 +4322,15 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.2" +version = "0.23.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +checksum = "79adb16721f56eb2d843e67676896a61ce7a0fa622dc18d3e372477a029d2740" dependencies = [ "log", + "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.2", + "rustls-webpki 0.102.4", "subtle", "zeroize", ] @@ -4324,19 +4346,19 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.0.0" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.2.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a716eb65e3158e90e17cd93d855216e27bde02745ab842f2cab4a39dba1bacf" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" @@ -4350,9 +4372,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "ring", "rustls-pki-types", @@ -4361,9 +4383,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "rusty-sidekiq" @@ -4376,7 +4398,7 @@ dependencies = [ "chrono", "cron_clock", "gethostname", - "heck", + "heck 0.4.1", "hex", "num_cpus", "rand", @@ -4393,9 +4415,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -4428,18 +4450,18 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bd3534a9978d0aa7edd2808dc1f8f31c4d0ecd31ddf71d997b3c98e9f3c9114" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "sea-orm" -version = "1.0.0-rc.1" +version = "1.0.0-rc.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b1218f3b8f95076954bde2e2a33852f873a91e5bbd49402f8fc2bb755c0ed3" +checksum = "b467731e7b3e5c7581291c030a0574edbb346b5f3fba9297130416a7178b2385" dependencies = [ "async-stream", "async-trait", @@ -4465,9 +4487,9 @@ dependencies = [ [[package]] name = "sea-orm-cli" -version = "1.0.0-rc.1" +version = "1.0.0-rc.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "096c0ffb155732ab98827d6a119c28166073933cb60e7662cc87f8b8af71ee31" +checksum = "e4d9173b3768a8cd39e4c6ddb50f3d0bca7907aad0f7c9c8b9db4dad70740535" dependencies = [ "chrono", "clap", @@ -4482,23 +4504,23 @@ dependencies = [ [[package]] name = "sea-orm-macros" -version = "1.0.0-rc.1" +version = "1.0.0-rc.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be16d30795cc707c355d1c0ba704db085d5bd507a858509a0d784189b8fe31b" +checksum = "a55f66b1b0caf9bb64f01ceca74126a34842396c7678b0d178ad0acfa8c12412" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "sea-bae", - "syn 2.0.48", + "syn 2.0.66", "unicode-ident", ] [[package]] name = "sea-orm-migration" -version = "1.0.0-rc.1" +version = "1.0.0-rc.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4daac7104c6e919c4ae2da226b1ccb5d9b8c67046d85a597e20dee815d20319" +checksum = "9ce5df1fc1cb6e6d0aeaef6d306ffa4642f9b8dbb25cfed45f844d501d697460" dependencies = [ "async-trait", "clap", @@ -4513,13 +4535,13 @@ dependencies = [ [[package]] name = "sea-query" -version = "0.31.0-rc.4" +version = "0.31.0-rc.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a3d4c4e985f331e06266751243c5ebe6f61e961dda605d71ea2e2b016ef478b" +checksum = "db1b7f28b3842e36980a27391faf9e394aa3c4146cc2f57e615717f0654180d2" dependencies = [ "bigdecimal", "chrono", - "derivative", + "educe", "inherent", "ordered-float 3.9.2", "rust_decimal", @@ -4531,9 +4553,9 @@ dependencies = [ [[package]] name = "sea-query-binder" -version = "0.6.0-rc.1" +version = "0.6.0-rc.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee39a8b40e6b4ee0510ee64c1079284559ee41f97919855b9cd7e43e1fb6ab04" +checksum = "c368d1a4050b6b45b47498c544d31a9c35b96aea926599f2a9db82088cc674aa" dependencies = [ "bigdecimal", "chrono", @@ -4551,18 +4573,18 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25a82fcb49253abcb45cdcb2adf92956060ec0928635eb21b4f7a6d8f25ab0bc" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "thiserror", ] [[package]] name = "sea-schema" -version = "0.15.0-rc.2" +version = "0.15.0-rc.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a03b47e6cf73c34d83fff934c169732530f6f3b0dd072725804961959b7d1df" +checksum = "87445dedfebeb9eac9ffe825ac8f867eaeb092633431bc262f8e7cf77eb4ba72" dependencies = [ "futures", "sea-query", @@ -4575,7 +4597,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6f686050f76bffc4f635cda8aea6df5548666b830b52387e8bc7de11056d11e" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "syn 1.0.109", @@ -4593,14 +4615,14 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e14e4d63b804dc0c7ec4a1e52bcb63f02c7ac94476755aa579edac21e01f915d" dependencies = [ - "self_cell 1.0.3", + "self_cell 1.0.4", ] [[package]] name = "self_cell" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bf37232d3bb9a2c4e641ca2a11d83b5062066f88df7fed36c28772046d65ba" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" [[package]] name = "semver" @@ -4613,9 +4635,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -4628,9 +4650,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" dependencies = [ "serde_derive", ] @@ -4646,22 +4668,22 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ - "indexmap 2.2.2", + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -4669,9 +4691,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa", "serde", @@ -4689,9 +4711,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -4710,9 +4732,9 @@ dependencies = [ [[package]] name = "serde_variant" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47a8ec0b2fd0506290348d9699c0e3eb2e3e8c0498b5a9a6158b3bd4d6970076" +checksum = "0a0068df419f9d9b6488fdded3f1c818522cdea328e02ce9d9f147380265a432" dependencies = [ "serde", ] @@ -4741,11 +4763,11 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.31" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.2", + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -4774,7 +4796,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -4870,9 +4892,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -4895,9 +4917,9 @@ checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" [[package]] name = "similar" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21" +checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640" [[package]] name = "simple_asn1" @@ -4940,11 +4962,11 @@ checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" [[package]] name = "slog-term" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87d29185c55b7b258b4f120eab00f48557d4d9bc814f41713f449d35b0f8977c" +checksum = "b6e022d0b998abfe5c3782c1f03551a596269450ccd677ea51c56f8b214610e8" dependencies = [ - "atty", + "is-terminal", "slog", "term", "thread_local", @@ -4963,9 +4985,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smawk" @@ -4989,7 +5011,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "990079665f075b699031e9c08fd3ab99be5029b96f3b78dc0709e8f77e4efebf" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "syn 1.0.109", @@ -5019,9 +5041,9 @@ dependencies = [ [[package]] name = "snapbox-macros" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c4b838b05d15ab22754068cb73500b2f3b07bf09d310e15b27f88160f1de40" +checksum = "b1f4c14672714436c09254801c934b203196a51182a5107fb76591c7cc56424d" dependencies = [ "anstream", ] @@ -5038,12 +5060,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -5084,9 +5106,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba03c279da73694ef99763320dea58b51095dfe87d001b1d4b5fe78ba8763cf" +checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa" dependencies = [ "sqlx-core", "sqlx-macros", @@ -5097,11 +5119,11 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d84b0a3c3739e220d94b3239fd69fb1f74bc36e16643423bd99de3b43c21bfbd" +checksum = "24ba59a9342a3d9bab6c56c118be528b27c9b60e490080e9711a04dccac83ef6" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.11", "atoi", "bigdecimal", "byteorder", @@ -5109,7 +5131,6 @@ dependencies = [ "chrono", "crc", "crossbeam-queue", - "dotenvy", "either", "event-listener 2.5.3", "futures-channel", @@ -5119,14 +5140,14 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.2.2", + "indexmap 2.2.6", "log", "memchr", "once_cell", "paste", "percent-encoding", "rust_decimal", - "rustls 0.21.10", + "rustls 0.21.12", "rustls-pemfile 1.0.4", "serde", "serde_json", @@ -5145,9 +5166,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89961c00dc4d7dffb7aee214964b065072bff69e36ddb9e2c107541f75e4f2a5" +checksum = "4ea40e2345eb2faa9e1e5e326db8c34711317d2b5e08d0d5741619048a803127" dependencies = [ "proc-macro2", "quote", @@ -5158,14 +5179,13 @@ dependencies = [ [[package]] name = "sqlx-macros-core" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0bd4519486723648186a08785143599760f7cc81c52334a55d6a83ea1e20841" +checksum = "5833ef53aaa16d860e92123292f1f6a3d53c34ba8b1969f152ef1a7bb803f3c8" dependencies = [ - "atomic-write-file", "dotenvy", "either", - "heck", + "heck 0.4.1", "hex", "once_cell", "proc-macro2", @@ -5185,14 +5205,14 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37195395df71fd068f6e2082247891bc11e3289624bbc776a0cdfa1ca7f1ea4" +checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" dependencies = [ "atoi", "base64 0.21.7", "bigdecimal", - "bitflags 2.4.2", + "bitflags 2.5.0", "byteorder", "bytes", "chrono", @@ -5232,14 +5252,14 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ac0ac3b7ccd10cc96c7ab29791a7dd236bd94021f31eec7ba3d46a74aa1c24" +checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" dependencies = [ "atoi", "base64 0.21.7", "bigdecimal", - "bitflags 2.4.2", + "bitflags 2.5.0", "byteorder", "chrono", "crc", @@ -5263,7 +5283,6 @@ dependencies = [ "rust_decimal", "serde", "serde_json", - "sha1", "sha2", "smallvec", "sqlx-core", @@ -5277,9 +5296,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "210976b7d948c7ba9fced8ca835b11cbb2d677c59c79de41ac0d397e14547490" +checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa" dependencies = [ "atoi", "chrono", @@ -5339,15 +5358,15 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.25.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" [[package]] name = "subtle" @@ -5368,9 +5387,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -5386,7 +5405,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -5395,6 +5414,18 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + [[package]] name = "take_mut" version = "0.2.2" @@ -5409,13 +5440,13 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.10.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.1", - "rustix 0.38.31", + "fastrand 2.1.0", + "rustix 0.38.34", "windows-sys 0.52.0", ] @@ -5465,29 +5496,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -5501,9 +5532,7 @@ checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", - "libc", "num-conv", - "num_threads", "powerfmt", "serde", "time-core", @@ -5552,9 +5581,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -5564,7 +5593,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2 0.5.7", "tokio-macros", "windows-sys 0.48.0", ] @@ -5587,7 +5616,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -5596,26 +5625,26 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.10", + "rustls 0.21.12", "tokio", ] [[package]] name = "tokio-rustls" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.22.2", + "rustls 0.23.8", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", @@ -5624,9 +5653,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", @@ -5634,14 +5663,13 @@ dependencies = [ "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] @@ -5652,22 +5680,22 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.2.2", + "indexmap 2.2.6", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.22.4" +version = "0.22.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" +checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" dependencies = [ - "indexmap 2.2.2", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.8", ] [[package]] @@ -5681,8 +5709,8 @@ dependencies = [ "axum 0.6.20", "base64 0.21.7", "bytes", - "h2 0.3.26", - "http 0.2.11", + "h2", + "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", "hyper-timeout", @@ -5719,16 +5747,16 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da193277a4e2c33e59e09b5861580c33dd0a637c3883d0fa74ba40c0374af2e" +checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ "async-compression", - "bitflags 2.4.2", + "bitflags 2.5.0", "bytes", "futures-core", "futures-util", - "http 1.0.0", + "http 1.1.0", "http-body 1.0.0", "http-body-util", "http-range-header", @@ -5776,7 +5804,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -5824,7 +5852,7 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a276058193f1b03d8279356215ec4c8c1bb21e40e5554bb239aa94fb2d8e189" dependencies = [ - "http 1.0.0", + "http 1.1.0", "opentelemetry", "tracing", "tracing-opentelemetry", @@ -5861,6 +5889,12 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "triomphe" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" + [[package]] name = "trust-dns-proto" version = "0.21.2" @@ -5925,14 +5959,14 @@ dependencies = [ "serde", "shlex", "snapbox", - "toml_edit 0.22.4", + "toml_edit 0.22.13", ] [[package]] name = "type-map" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d3364c5e96cb2ad1603037ab253ddd34d7fb72a58bdddf4b7350760fc69a46" +checksum = "deb68604048ff8fa93347f02441e4487594adc20bb8a084f9e564d2b827a0a9f" dependencies = [ "rustc-hash", ] @@ -5983,9 +6017,9 @@ checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" [[package]] name = "unic-langid" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238722e6d794ed130f91f4ea33e01fcff4f188d92337a21297892521c72df516" +checksum = "23dd9d1e72a73b25e07123a80776aae3e7b0ec461ef94f9151eed6ec88005a44" dependencies = [ "unic-langid-impl", "unic-langid-macros", @@ -5993,18 +6027,18 @@ dependencies = [ [[package]] name = "unic-langid-impl" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bd55a2063fdea4ef1f8633243a7b0524cbeef1905ae04c31a1c9b9775c55bc6" +checksum = "0a5422c1f65949306c99240b81de9f3f15929f5a8bfe05bb44b034cc8bf593e5" dependencies = [ "tinystr", ] [[package]] name = "unic-langid-macros" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c854cefb82ff2816410ce606acbad1b3af065140907b29be9229040752b83ec" +checksum = "0da1cd2c042d3c7569a1008806b02039e7a4a2bdf8f8e96bd3c792434a0e275e" dependencies = [ "proc-macro-hack", "tinystr", @@ -6014,13 +6048,13 @@ dependencies = [ [[package]] name = "unic-langid-macros-impl" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea2a4c80deb4fb3ca51f66b5e2dd91e3642bbce52234bcf22e41668281208e4" +checksum = "1ed7f4237ba393424195053097c1516bd4590dc82b84f2f97c5c69e12704555b" dependencies = [ "proc-macro-hack", "quote", - "syn 2.0.48", + "syn 2.0.66", "unic-langid-impl", ] @@ -6082,9 +6116,9 @@ checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -6097,9 +6131,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "unicode_categories" @@ -6119,9 +6153,9 @@ dependencies = [ [[package]] name = "unsafe-libyaml" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "untrusted" @@ -6160,9 +6194,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom", "serde", @@ -6218,9 +6252,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.7.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126e423afe2dd9ac52142e7e9d5ce4135d7e13776c529d27fd6bc49f19e3280b" +checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" [[package]] name = "vcpkg" @@ -6245,15 +6279,15 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -6274,11 +6308,17 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -6286,24 +6326,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -6313,9 +6353,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6323,28 +6363,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -6377,9 +6417,13 @@ dependencies = [ [[package]] name = "whoami" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" +dependencies = [ + "redox_syscall 0.4.1", + "wasite", +] [[package]] name = "widestring" @@ -6405,11 +6449,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -6418,13 +6462,23 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core", + "windows-targets 0.52.5", +] + [[package]] name = "windows-core" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -6442,7 +6496,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -6462,17 +6516,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -6483,9 +6538,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -6495,9 +6550,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -6507,9 +6562,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -6519,9 +6580,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -6531,9 +6592,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -6543,9 +6604,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -6555,15 +6616,24 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + +[[package]] +name = "winnow" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] [[package]] name = "winnow" -version = "0.5.39" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" +checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" dependencies = [ "memchr", ] @@ -6593,15 +6663,6 @@ dependencies = [ "tap", ] -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "yansi" version = "0.5.1" @@ -6610,22 +6671,22 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -6636,27 +6697,27 @@ checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" [[package]] name = "zstd" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" +checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.0.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" +checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.10+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", "pkg-config", diff --git a/examples/demo/Cargo.toml b/examples/demo/Cargo.toml index 9e8bd6951..9a4ecbb36 100644 --- a/examples/demo/Cargo.toml +++ b/examples/demo/Cargo.toml @@ -22,7 +22,7 @@ async-trait = "0.1.74" tracing = "0.1.40" chrono = "0.4" validator = { version = "0.16" } -sea-orm = { version = "1.0.0-rc.1", features = [ +sea-orm = { version = "1.0.0-rc.4", features = [ "sqlx-sqlite", "sqlx-postgres", "runtime-tokio-rustls", diff --git a/examples/demo/config/development.yaml b/examples/demo/config/development.yaml index f932a6338..ceb527184 100644 --- a/examples/demo/config/development.yaml +++ b/examples/demo/config/development.yaml @@ -1,10 +1,13 @@ # Loco configuration file documentation +# settings: allow_list: - google.com - apple.com +# +# # Application logging configuration logger: # Enable or disable logging. @@ -18,14 +21,17 @@ logger: # By default the logger has filtering only logs that came from your code or logs that came from `loco` framework. to see all third party libraries # Uncomment the line below to override to see all third party libraries you can enable this config and override the logger filters. # override_filter: trace +# # Web server configuration +# server: # Port on which the server will listen. the server binding is 0.0.0.0:{PORT} port: {{get_env(name="NODE_PORT", default=3000)}} # The UI hostname or IP address that mailers will point to. host: http://localhost # Out of the box middleware configuration. to disable middleware you can changed the `enable` field to `false` of comment the middleware block +# middlewares: # Allows to limit the payload size request. payload that bigger than this file will blocked the request. limit_payload: @@ -80,6 +86,7 @@ workers: mode: BackgroundQueue # Mailer Configuration. +# mailer: # SMTP mailer configuration. smtp: @@ -94,6 +101,7 @@ mailer: # auth: # user: # password: +# # Initializers Configuration # initializers: @@ -104,6 +112,7 @@ mailer: # Database Configuration +# database: # Database connection URI uri: {{get_env(name="DATABASE_URL", default="postgres://loco:loco@localhost:5432/loco_app")}} @@ -123,15 +132,19 @@ database: dangerously_truncate: false # Recreating schema when application loaded. This is a dangerous operation, make sure that you using this flag only on dev environments or test mode dangerously_recreate: false +# -# Redis Configuration -redis: +# Queue Configuration +# +queue: # Redis connection URI uri: {{get_env(name="REDIS_URL", default="redis://127.0.0.1")}} # Dangerously flush all data in Redis on startup. dangerous operation, make sure that you using this flag only on dev environments or test mode dangerously_flush: false +# # Authentication Configuration +# auth: # JWT authentication jwt: @@ -139,3 +152,5 @@ auth: secret: PqRwLF2rhHe8J22oBeHy # Token expiration time in seconds expiration: 604800 # 7 days +# + diff --git a/examples/demo/config/test.yaml b/examples/demo/config/test.yaml index da7dc833f..3734579b6 100644 --- a/examples/demo/config/test.yaml +++ b/examples/demo/config/test.yaml @@ -116,8 +116,8 @@ database: # Recreating schema when application loaded. This is a dangerous operation, make sure that you using this flag only on dev environments or test mode dangerously_recreate: true -# Redis Configuration -redis: +# Queue Configuration +queue: # Redis connection URI uri: {{get_env(name="REDIS_URL", default="redis://127.0.0.1")}} # Dangerously flush all data in Redis on startup. dangerous operation, make sure that you using this flag only on dev environments or test mode diff --git a/examples/demo/config/teste2e.yaml b/examples/demo/config/teste2e.yaml index 3679cb8fb..e0e9cae38 100644 --- a/examples/demo/config/teste2e.yaml +++ b/examples/demo/config/teste2e.yaml @@ -95,8 +95,8 @@ database: # Recreating schema when application loaded. This is a dangerous operation, make sure that you using this flag only on dev environments or test mode dangerously_recreate: true -# Redis Configuration -redis: +# Queue Configuration +queue: # Redis connection URI uri: {{get_env(name="APP_REDIS_URI", default="redis://127.0.0.1")}} # Dangerously flush all data in Redis on startup. dangerous operation, make sure that you using this flag only on dev environments or test mode diff --git a/examples/demo/migration/Cargo.toml b/examples/demo/migration/Cargo.toml index 3ce78dcf2..7bbb35daf 100644 --- a/examples/demo/migration/Cargo.toml +++ b/examples/demo/migration/Cargo.toml @@ -13,7 +13,7 @@ async-std = { version = "1", features = ["attributes", "tokio1"] } loco-rs = { version = "*", path = "../../../" } [dependencies.sea-orm-migration] -version = "1.0.0-rc.1" +version = "1.0.0-rc.4" features = [ # Enable at least one `ASYNC_RUNTIME` and `DATABASE_DRIVER` feature if you want to run migration via CLI. # View the list of supported features at https://www.sea-ql.org/SeaORM/docs/install-and-config/database-and-async-runtime. diff --git a/examples/demo/src/app.rs b/examples/demo/src/app.rs index 890e1129d..97eae6292 100644 --- a/examples/demo/src/app.rs +++ b/examples/demo/src/app.rs @@ -5,7 +5,7 @@ use loco_extras; use loco_rs::{ app::{AppContext, Hooks, Initializer}, boot::{create_app, BootResult, StartMode}, - config::Config, + cache, controller::AppRoutes, db::{self, truncate_table}, environment::Environment, @@ -73,24 +73,27 @@ impl Hooks for App { .add_route(controllers::user::routes()) .add_route(controllers::upload::routes()) .add_route(controllers::responses::routes()) + .add_route(controllers::cache::routes()) } async fn boot(mode: StartMode, environment: &Environment) -> Result { create_app::(mode, environment).await } - async fn storage( - _config: &Config, - environment: &Environment, - ) -> Result> { - let store = if environment == &Environment::Test { + async fn after_context(ctx: AppContext) -> Result { + let store = if ctx.environment == Environment::Test { storage::drivers::mem::new() } else { storage::drivers::local::new_with_prefix("storage-uploads").map_err(Box::from)? }; - let storage = Storage::single(store); - return Ok(Some(storage)); + Ok(AppContext { + storage: Storage::single(store).into(), + cache: cache::Cache::new(cache::drivers::inmem::new()).into(), + ..ctx + }) + + // Ok(ctx) } fn connect_workers<'a>(p: &'a mut Processor, ctx: &'a AppContext) { diff --git a/examples/demo/src/controllers/cache.rs b/examples/demo/src/controllers/cache.rs new file mode 100644 index 000000000..976032a5f --- /dev/null +++ b/examples/demo/src/controllers/cache.rs @@ -0,0 +1,24 @@ +use loco_rs::prelude::*; +use serde::{Deserialize, Serialize}; + +#[derive(Serialize, Deserialize)] +pub struct CacheResponse { + value: Option, +} + +async fn get_cache(State(ctx): State) -> Result { + format::json(CacheResponse { + value: ctx.cache.get("value").await.unwrap(), + }) +} +async fn insert(State(ctx): State) -> Result { + ctx.cache.insert("value", "loco cache value").await.unwrap(); + format::empty() +} + +pub fn routes() -> Routes { + Routes::new() + .prefix("cache") + .add("/", get(get_cache)) + .add("/insert", post(insert)) +} diff --git a/examples/demo/src/controllers/mod.rs b/examples/demo/src/controllers/mod.rs index 34c487983..1af8cb160 100644 --- a/examples/demo/src/controllers/mod.rs +++ b/examples/demo/src/controllers/mod.rs @@ -1,4 +1,5 @@ pub mod auth; +pub mod cache; pub mod dashboard; pub mod middlewares; pub mod mylayer; diff --git a/examples/demo/src/controllers/upload.rs b/examples/demo/src/controllers/upload.rs index dee168553..103cd7566 100644 --- a/examples/demo/src/controllers/upload.rs +++ b/examples/demo/src/controllers/upload.rs @@ -30,7 +30,6 @@ async fn upload_file(State(ctx): State, mut multipart: Multipart) -> let path = PathBuf::from("folder").join(file_name); ctx.storage .as_ref() - .unwrap() .upload(path.as_path(), &content) .await?; diff --git a/examples/demo/src/models/users_roles.rs b/examples/demo/src/models/users_roles.rs index 2c4dff12f..0a4b38ca9 100644 --- a/examples/demo/src/models/users_roles.rs +++ b/examples/demo/src/models/users_roles.rs @@ -1,5 +1,5 @@ use loco_rs::prelude::*; -use sea_orm::{entity::prelude::*, ActiveValue}; +use sea_orm::ActiveValue; pub use super::_entities::users_roles::{self, ActiveModel, Column, Entity, Model}; @@ -15,11 +15,11 @@ impl super::_entities::users_roles::Model { ) -> ModelResult { // Find the user role if it exists let user_role = users_roles::Entity::find() - .filter(Column::UsersId.eq(user.id.clone())) + .filter(Column::UsersId.eq(user.id)) .one(db) .await?; // Update the user role if it exists, otherwise create it - if let Some(mut user_role) = user_role { + if let Some(user_role) = user_role { // Delete the user role if the role is different if user_role.roles_id == role.id { return Ok(user_role); @@ -29,8 +29,8 @@ impl super::_entities::users_roles::Model { } // Create the user role let user_role = users_roles::ActiveModel { - users_id: ActiveValue::set(user.id.clone()), - roles_id: ActiveValue::set(role.id.clone()), + users_id: ActiveValue::set(user.id), + roles_id: ActiveValue::set(role.id), ..Default::default() } .insert(db) diff --git a/examples/demo/tests/cmd/cli.trycmd b/examples/demo/tests/cmd/cli.trycmd index c9407292b..fccf4cbdb 100644 --- a/examples/demo/tests/cmd/cli.trycmd +++ b/examples/demo/tests/cmd/cli.trycmd @@ -87,6 +87,8 @@ $ blo-cli routes --environment test [POST] /auth/register [POST] /auth/reset [POST] /auth/verify +[GET] /cache +[POST] /cache/insert [GET] /dashboard/hello [GET] /dashboard/home [GET] /mylayer/admin diff --git a/examples/demo/tests/requests/cache.rs b/examples/demo/tests/requests/cache.rs new file mode 100644 index 000000000..028422aa2 --- /dev/null +++ b/examples/demo/tests/requests/cache.rs @@ -0,0 +1,29 @@ +use blo::app::App; +use insta::assert_debug_snapshot; +use loco_rs::testing; + +// TODO: see how to dedup / extract this to app-local test utils +// not to framework, because that would require a runtime dep on insta +macro_rules! configure_insta { + ($($expr:expr),*) => { + let mut settings = insta::Settings::clone_current(); + settings.set_prepend_module_to_snapshot(false); + settings.set_snapshot_suffix("cache"); + let _guard = settings.bind_to_scope(); + }; +} + +#[tokio::test] +async fn ping() { + configure_insta!(); + + testing::request::(|request, _ctx| async move { + let response = request.get("cache").await; + assert_debug_snapshot!("key_not_exists", (response.text(), response.status_code())); + let response = request.post("cache/insert").await; + assert_debug_snapshot!("insert", (response.text(), response.status_code())); + let response = request.get("cache").await; + assert_debug_snapshot!("read_cache_key", (response.text(), response.status_code())); + }) + .await; +} diff --git a/examples/demo/tests/requests/mod.rs b/examples/demo/tests/requests/mod.rs index 3e7966342..38168a96e 100644 --- a/examples/demo/tests/requests/mod.rs +++ b/examples/demo/tests/requests/mod.rs @@ -1,4 +1,5 @@ mod auth; +mod cache; pub mod mylayer; mod notes; mod ping; diff --git a/examples/demo/tests/requests/snapshots/insert@cache.snap b/examples/demo/tests/requests/snapshots/insert@cache.snap new file mode 100644 index 000000000..e4108c4da --- /dev/null +++ b/examples/demo/tests/requests/snapshots/insert@cache.snap @@ -0,0 +1,8 @@ +--- +source: tests/requests/cache.rs +expression: "(response.text(), response.status_code())" +--- +( + "", + 200, +) diff --git a/examples/demo/tests/requests/snapshots/key_not_exists@cache.snap b/examples/demo/tests/requests/snapshots/key_not_exists@cache.snap new file mode 100644 index 000000000..8fd34bc61 --- /dev/null +++ b/examples/demo/tests/requests/snapshots/key_not_exists@cache.snap @@ -0,0 +1,8 @@ +--- +source: tests/requests/cache.rs +expression: "(response.text(), response.status_code())" +--- +( + "{\"value\":null}", + 200, +) diff --git a/examples/demo/tests/requests/snapshots/read_cache_key@cache.snap b/examples/demo/tests/requests/snapshots/read_cache_key@cache.snap new file mode 100644 index 000000000..a06ae0dc3 --- /dev/null +++ b/examples/demo/tests/requests/snapshots/read_cache_key@cache.snap @@ -0,0 +1,8 @@ +--- +source: tests/requests/cache.rs +expression: "(response.text(), response.status_code())" +--- +( + "{\"value\":\"loco cache value\"}", + 200, +) diff --git a/examples/demo/tests/requests/upload.rs b/examples/demo/tests/requests/upload.rs index d7c34865c..bc98eee5b 100644 --- a/examples/demo/tests/requests/upload.rs +++ b/examples/demo/tests/requests/upload.rs @@ -18,7 +18,7 @@ async fn can_upload_file() { let res: views::upload::Response = serde_json::from_str(&response.text()).unwrap(); - let stored_file: String = ctx.storage.unwrap().download(&res.path).await.unwrap(); + let stored_file: String = ctx.storage.download(&res.path).await.unwrap(); assert_eq!(stored_file, file_content); }) diff --git a/loco-extras/src/initializers/opentelemetry/mod.rs b/loco-extras/src/initializers/opentelemetry/mod.rs index b044cec8c..dc7330fa7 100644 --- a/loco-extras/src/initializers/opentelemetry/mod.rs +++ b/loco-extras/src/initializers/opentelemetry/mod.rs @@ -1,4 +1,4 @@ -use axum::{async_trait, Extension, Router as AxumRouter}; +use axum::{async_trait, Router as AxumRouter}; use axum_tracing_opentelemetry::middleware::{OtelAxumLayer, OtelInResponseLayer}; use loco_rs::{ app::{AppContext, Initializer}, diff --git a/snipdoc.yml b/snipdoc.yml new file mode 100644 index 000000000..0883e2855 --- /dev/null +++ b/snipdoc.yml @@ -0,0 +1,112 @@ +snippets: + description: + content: ๐Ÿš‚ Loco is Rust on Rails. + path: ./snipdoc.yml + help-command: + content: |- + ```sh + cargo loco --help + ``` + path: ./snipdoc.yml + build-command: + content: |- + ```sh + cargo build --release + ``` + path: ./snipdoc.yml + quick-installation-command: + content: |- + ```sh + cargo install loco-cli + cargo install sea-orm-cli # Only when DB is needed + ``` + path: ./snipdoc.yml + loco-cli-new-from-template: + content: |- + ```sh + โฏ loco new + โœ” โฏ App name? ยท myapp + โœ” โฏ What would you like to build? ยท SaaS app (with DB and user auth) + + ๐Ÿš‚ Loco app generated successfully in: + myapp + ``` + path: ./snipdoc.yml + postgres-run-docker-command: + content: |- + ```sh + docker run -d -p 5432:5432 \ + -e POSTGRES_USER=loco \ + -e POSTGRES_DB=myapp_development \ + -e POSTGRES_PASSWORD="loco" \ + postgres:15.3-alpine + ``` + path: ./snipdoc.yml + redis-run-docker-command: + content: |- + ```sh + docker run -p 6379:6379 -d redis redis-server + ``` + path: ./snipdoc.yml + starting-the-server-command: + content: |- + ```sh + cargo loco start + ``` + path: ./snipdoc.yml + starting-the-server-command-with-environment-env-var: + content: |- + ```sh + LOCO_ENV=qa cargo loco start + ``` + path: ./snipdoc.yml + starting-the-server-command-with-output: + content: |- + ```sh + $ cargo loco start + + โ–„ โ–€ + โ–€ โ–„ + โ–„ โ–€ โ–„ โ–„ โ–„โ–€ + โ–„ โ–€โ–„โ–„ + โ–„ โ–€ โ–€ โ–€โ–„โ–€โ–ˆโ–„ + โ–€โ–ˆโ–„ + โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ โ–€โ–€โ–ˆ + โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–€โ–ˆ + โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–€โ–€โ–€ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–„โ–ˆโ–„ + โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–„ + โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–„โ–„โ–„ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ + โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–€ + โ–€โ–€โ–€โ–ˆโ–ˆโ–„ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ โ–ˆโ–ˆโ–€ + โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€ + https://loco.rs + + listening on port 3000 + ``` + path: ./snipdoc.yml + doctor-command: + content: |- + ```sh + $ cargo loco doctor + Finished dev [unoptimized + debuginfo] target(s) in 0.32s + Running `target/debug/myapp-cli doctor` + โœ… SeaORM CLI is installed + โœ… DB connection: success + โœ… Redis connection: success + ``` + path: ./snipdoc.yml + generate-deployment-command: + content: |- + ```sh + cargo loco generate deployment + ? โฏ Choose your deployment โ€บ + โฏ Docker + โฏ Shuttle + โฏ Nginx + + .. + โœ” โฏ Choose your deployment ยท Docker + skipped (exists): "dockerfile" + added: ".dockerignore" + ``` + path: ./snipdoc.yml diff --git a/src/app.rs b/src/app.rs index 878aa6dc2..0dab04631 100644 --- a/src/app.rs +++ b/src/app.rs @@ -16,6 +16,7 @@ use axum::Router as AxumRouter; use crate::controller::channels::AppChannels; use crate::{ boot::{BootResult, ServeParams, StartMode}, + cache::{self}, config::{self, Config}, controller::AppRoutes, environment::Environment, @@ -40,14 +41,16 @@ pub struct AppContext { #[cfg(feature = "with-db")] /// A database connection used by the application. pub db: DatabaseConnection, - /// An optional connection pool for Redis, for worker tasks - pub redis: Option>, + /// An optional connection pool for Queue, for worker tasks + pub queue: Option>, /// Configuration settings for the application pub config: Config, /// An optional email sender component that can be used to send email. pub mailer: Option, - // Ab optional storage instance for the application - pub storage: Option>, + // An optional storage instance for the application + pub storage: Arc, + // Cache instance for the application + pub cache: Arc, } /// A trait that defines hooks for customizing and extending the behavior of a @@ -155,12 +158,9 @@ pub trait Hooks { /// Defines the application's routing configuration. fn routes(_ctx: &AppContext) -> AppRoutes; - /// Defines the storage configuration for the application - async fn storage( - _config: &config::Config, - _environment: &Environment, - ) -> Result> { - Ok(None) + // Provides the options to change Loco [`AppContext`] after initialization. + async fn after_context(ctx: AppContext) -> Result { + Ok(ctx) } #[cfg(feature = "channels")] diff --git a/src/boot.rs b/src/boot.rs index e97e72e12..e1289c692 100644 --- a/src/boot.rs +++ b/src/boot.rs @@ -1,7 +1,7 @@ //! # Application Bootstrapping and Logic //! This module contains functions and structures for bootstrapping and running //! your application. -use std::{collections::BTreeMap, sync::Arc}; +use std::collections::BTreeMap; use axum::Router; #[cfg(feature = "with-db")] @@ -13,12 +13,14 @@ use crate::db; use crate::{ app::{AppContext, Hooks}, banner::print_banner, + cache, config::{self, Config}, controller::ListRoutes, environment::Environment, errors::Error, mailer::{EmailSender, MailerWorker}, redis, + storage::{self, Storage}, task::Tasks, worker::{self, AppWorker, Pool, Processor, RedisConnectionManager, DEFAULT_QUEUES}, Result, @@ -198,16 +200,18 @@ pub async fn create_context(environment: &Environment) -> Result( let app_context = create_context::(environment).await?; db::converge::(&app_context.db, &app_context.config.database).await?; - if let Some(pool) = &app_context.redis { - redis::converge(pool, &app_context.config.redis).await?; + if let Some(pool) = &app_context.queue { + redis::converge(pool, &app_context.config.queue).await?; } run_app::(&mode, app_context).await @@ -299,9 +303,9 @@ fn create_processor(app_context: &AppContext) -> Result { queues = ?queues, "registering queues (merged config and default)" ); - let mut p = if let Some(redis) = &app_context.redis { + let mut p = if let Some(queue) = &app_context.queue { Processor::new( - redis.clone(), + queue.clone(), DEFAULT_QUEUES .iter() .map(ToString::to_string) @@ -309,7 +313,7 @@ fn create_processor(app_context: &AppContext) -> Result { ) } else { return Err(Error::Message( - "redis is missing, cannot initialize workers".to_string(), + "queue is missing, cannot initialize workers".to_string(), )); }; @@ -345,7 +349,7 @@ fn create_mailer(config: &config::Mailer) -> Result> { // TODO: Refactor to eliminate unwrapping and instead return an appropriate // error type. pub async fn connect_redis(config: &Config) -> Option> { - if let Some(redis) = &config.redis { + if let Some(redis) = &config.queue { let manager = RedisConnectionManager::new(redis.uri.clone()).unwrap(); let redis = Pool::builder().build(manager).await.unwrap(); Some(redis) diff --git a/src/cache/drivers/inmem.rs b/src/cache/drivers/inmem.rs new file mode 100644 index 000000000..741b9644a --- /dev/null +++ b/src/cache/drivers/inmem.rs @@ -0,0 +1,141 @@ +//! # In-Memory Cache Driver +//! +//! This module implements a cache driver using an in-memory cache. +use std::sync::Arc; + +use async_trait::async_trait; +use moka::sync::Cache; + +use super::CacheDriver; +use crate::cache::CacheResult; + +/// Creates a new instance of the in-memory cache driver, with a default Loco +/// configuration. +/// +/// # Returns +/// +/// A boxed [`CacheDriver`] instance. +#[must_use] +pub fn new() -> Box { + let cache = Cache::builder().max_capacity(32 * 1024 * 1024).build(); + Inmem::from(cache) +} + +/// Represents the in-memory cache driver. +pub struct Inmem { + cache: Cache, +} + +impl Inmem { + /// Constructs a new [`Inmem`] instance from a given cache. + /// + /// # Returns + /// + /// A boxed [`CacheDriver`] instance. + #[must_use] + pub fn from(cache: Cache) -> Box { + Box::new(Self { cache }) + } +} + +#[async_trait] +impl CacheDriver for Inmem { + /// Checks if a key exists in the cache. + /// + /// # Errors + /// + /// Returns a `CacheError` if there is an error during the operation. + async fn contains_key(&self, key: &str) -> CacheResult { + Ok(self.cache.contains_key(key)) + } + + /// Retrieves a value from the cache based on the provided key. + /// + /// # Errors + /// + /// Returns a `CacheError` if there is an error during the operation. + async fn get(&self, key: &str) -> CacheResult> { + Ok(self.cache.get(key)) + } + + /// Inserts a key-value pair into the cache. + /// + /// # Errors + /// + /// Returns a `CacheError` if there is an error during the operation. + async fn insert(&self, key: &str, value: &str) -> CacheResult<()> { + self.cache + .insert(key.to_string(), Arc::new(value).to_string()); + Ok(()) + } + + /// Removes a key-value pair from the cache. + /// + /// # Errors + /// + /// Returns a `CacheError` if there is an error during the operation. + async fn remove(&self, key: &str) -> CacheResult<()> { + self.cache.remove(key); + Ok(()) + } + + /// Clears all key-value pairs from the cache. + /// + /// # Errors + /// + /// Returns a `CacheError` if there is an error during the operation. + async fn clear(&self) -> CacheResult<()> { + self.cache.invalidate_all(); + Ok(()) + } +} + +#[cfg(test)] +mod tests { + + use super::*; + + #[tokio::test] + async fn is_contains_key() { + let mem = new(); + assert!(!mem.contains_key("key").await.unwrap()); + assert!(mem.insert("key", "loco").await.is_ok()); + assert!(mem.contains_key("key").await.unwrap()); + } + + #[tokio::test] + async fn can_get_key_value() { + let mem = new(); + assert!(mem.insert("key", "loco").await.is_ok()); + assert_eq!(mem.get("key").await.unwrap(), Some("loco".to_string())); + + //try getting key that not exists + assert_eq!(mem.get("not-found").await.unwrap(), None); + } + + #[tokio::test] + async fn can_remove_key() { + let mem = new(); + assert!(mem.insert("key", "loco").await.is_ok()); + assert!(mem.contains_key("key").await.unwrap()); + mem.remove("key").await.unwrap(); + assert!(!mem.contains_key("key").await.unwrap()); + } + + #[tokio::test] + async fn can_clear() { + let mem = new(); + + let keys = vec!["key", "key2", "key3"]; + for key in &keys { + assert!(mem.insert(key, "loco").await.is_ok()); + } + for key in &keys { + assert!(mem.contains_key(key).await.is_ok()); + } + assert!(mem.clear().await.is_ok()); + for key in &keys { + assert!(!mem.contains_key(key).await.unwrap()); + } + } +} diff --git a/src/cache/drivers/mod.rs b/src/cache/drivers/mod.rs new file mode 100644 index 000000000..76239dc8a --- /dev/null +++ b/src/cache/drivers/mod.rs @@ -0,0 +1,54 @@ +//! # Cache Drivers Module +//! +//! This module defines traits and implementations for cache drivers. +use async_trait::async_trait; + +use super::CacheResult; + +#[cfg(feature = "cache_inmem")] +pub mod inmem; +pub mod null; + +/// Trait representing a cache driver. +#[async_trait] +pub trait CacheDriver: Sync + Send { + /// Checks if a key exists in the cache. + /// + /// # Errors + /// + /// Returns a [`super::CacheError`] if there is an error during the + /// operation. + async fn contains_key(&self, key: &str) -> CacheResult; + + /// Retrieves a value from the cache based on the provided key. + /// + /// # Errors + /// + /// Returns a [`super::CacheError`] if there is an error during the + /// operation. + async fn get(&self, key: &str) -> CacheResult>; + + /// Inserts a key-value pair into the cache. + /// + /// # Errors + /// + /// Returns a [`super::CacheError`] if there is an error during the + /// operation. + async fn insert(&self, key: &str, value: &str) -> CacheResult<()>; + + /// Removes a key-value pair from the cache. + /// + /// # Errors + /// + /// Returns a [`super::CacheError`] if there is an error during the + /// operation. + async fn remove(&self, key: &str) -> CacheResult<()>; + + /// Clears all key-value pairs from the cache. + /// + /// # Errors + /// + /// Returns a [`super::CacheError`] if there is an error during the + /// operation. + async fn clear(&self) -> CacheResult<()>; +} diff --git a/src/cache/drivers/null.rs b/src/cache/drivers/null.rs new file mode 100644 index 000000000..9eef456c2 --- /dev/null +++ b/src/cache/drivers/null.rs @@ -0,0 +1,79 @@ +//! # Null Cache Driver +//! +//! The Null Cache Driver is the default cache driver implemented when the Loco +//! framework is initialized. The primary purpose of this driver is to simplify +//! the user workflow by avoiding the need for feature flags or optional cache +//! driver configurations. +use async_trait::async_trait; + +use super::CacheDriver; +use crate::cache::{CacheError, CacheResult}; + +/// Represents the in-memory cache driver. +pub struct Null {} + +/// Creates a new null cache instance +/// +/// # Returns +/// +/// A boxed [`CacheDriver`] instance. +#[must_use] +pub fn new() -> Box { + Box::new(Null {}) +} + +#[async_trait] +impl CacheDriver for Null { + /// Checks if a key exists in the cache. + /// + /// # Errors + /// + /// Returns always error + async fn contains_key(&self, _key: &str) -> CacheResult { + Err(CacheError::Any( + "Operation not supported by null cache".into(), + )) + } + + /// Retrieves a value from the cache based on the provided key. + /// + /// # Errors + /// + /// Returns always error + async fn get(&self, _key: &str) -> CacheResult> { + Ok(None) + } + + /// Inserts a key-value pair into the cache. + /// + /// # Errors + /// + /// Returns always error + async fn insert(&self, _key: &str, _value: &str) -> CacheResult<()> { + Err(CacheError::Any( + "Operation not supported by null cache".into(), + )) + } + + /// Removes a key-value pair from the cache. + /// + /// # Errors + /// + /// Returns always error + async fn remove(&self, _key: &str) -> CacheResult<()> { + Err(CacheError::Any( + "Operation not supported by null cache".into(), + )) + } + + /// Clears all key-value pairs from the cache. + /// + /// # Errors + /// + /// Returns always error + async fn clear(&self) -> CacheResult<()> { + Err(CacheError::Any( + "Operation not supported by null cache".into(), + )) + } +} diff --git a/src/cache/mod.rs b/src/cache/mod.rs new file mode 100644 index 000000000..bf0e90316 --- /dev/null +++ b/src/cache/mod.rs @@ -0,0 +1,124 @@ +//! # Cache Module +//! +//! This module provides a generic cache interface for various cache drivers. +pub mod drivers; + +use self::drivers::CacheDriver; + +/// Errors related to cache operations +#[derive(thiserror::Error, Debug)] +#[allow(clippy::module_name_repetitions)] +pub enum CacheError { + #[error(transparent)] + Any(#[from] Box), +} + +pub type CacheResult = std::result::Result; + +/// Represents a cache instance +pub struct Cache { + /// The cache driver used for underlying operations + pub driver: Box, +} + +impl Cache { + /// Creates a new cache instance with the specified cache driver. + #[must_use] + pub fn new(driver: Box) -> Self { + Self { driver } + } + + /// Checks if a key exists in the cache. + /// + /// # Example + /// ``` + /// use loco_rs::cache::{self, CacheResult}; + /// + /// pub async fn contains_key() -> CacheResult { + /// let cache = cache::Cache::new(cache::drivers::inmem::new()); + /// cache.contains_key("key").await + /// } + /// ``` + /// + /// # Errors + /// A [`CacheResult`] indicating whether the key exists in the cache. + pub async fn contains_key(&self, key: &str) -> CacheResult { + self.driver.contains_key(key).await + } + + /// Retrieves a value from the cache based on the provided key. + /// + /// # Example + /// ``` + /// use loco_rs::cache::{self, CacheResult}; + /// + /// pub async fn get_key() -> CacheResult> { + /// let cache = cache::Cache::new(cache::drivers::inmem::new()); + /// cache.get("key").await + /// } + /// ``` + /// + /// # Errors + /// A [`CacheResult`] containing an `Option` representing the retrieved + /// value. + pub async fn get(&self, key: &str) -> CacheResult> { + self.driver.get(key).await + } + + /// Inserts a key-value pair into the cache. + /// + /// # Example + /// ``` + /// use loco_rs::cache::{self, CacheResult}; + /// + /// pub async fn insert() -> CacheResult<()> { + /// let cache = cache::Cache::new(cache::drivers::inmem::new()); + /// cache.insert("key", "value").await + /// } + /// ``` + /// + /// # Errors + /// + /// A [`CacheResult`] indicating the success of the operation. + pub async fn insert(&self, key: &str, value: &str) -> CacheResult<()> { + self.driver.insert(key, value).await + } + + /// Removes a key-value pair from the cache. + /// + /// # Example + /// ``` + /// use loco_rs::cache::{self, CacheResult}; + /// + /// pub async fn remove() -> CacheResult<()> { + /// let cache = cache::Cache::new(cache::drivers::inmem::new()); + /// cache.remove("key").await + /// } + /// ``` + /// + /// # Errors + /// + /// A [`CacheResult`] indicating the success of the operation. + pub async fn remove(&self, key: &str) -> CacheResult<()> { + self.driver.remove(key).await + } + + /// Clears all key-value pairs from the cache. + /// + /// # Example + /// ``` + /// use loco_rs::cache::{self, CacheResult}; + /// + /// pub async fn clear() -> CacheResult<()> { + /// let cache = cache::Cache::new(cache::drivers::inmem::new()); + /// cache.clear().await + /// } + /// ``` + /// + /// # Errors + /// + /// A [`CacheResult`] indicating the success of the operation. + pub async fn clear(&self) -> CacheResult<()> { + self.driver.clear().await + } +} diff --git a/src/config.rs b/src/config.rs index d1b00bd0c..1fbe49ddf 100644 --- a/src/config.rs +++ b/src/config.rs @@ -51,7 +51,7 @@ pub struct Config { pub server: Server, #[cfg(feature = "with-db")] pub database: Database, - pub redis: Option, + pub queue: Option, pub auth: Option, #[serde(default)] pub workers: Workers, diff --git a/src/controller/health.rs b/src/controller/health.rs index 9509cf66a..3829a3d4c 100644 --- a/src/controller/health.rs +++ b/src/controller/health.rs @@ -24,7 +24,7 @@ async fn health(State(ctx): State) -> Result { false } }; - if let Some(pool) = ctx.redis { + if let Some(pool) = ctx.queue { if let Err(error) = redis::ping(&pool).await { tracing::error!(err.msg = %error, err.detail = ?error, "health_redis_ping_error"); is_ok = false; diff --git a/src/lib.rs b/src/lib.rs index 97b5c1d5d..29f47c3b8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,30 +1,7 @@ #![allow(clippy::missing_const_for_fn)] #![allow(clippy::module_name_repetitions)] -//! ## Starting A New Project -//! -//! To start a new project, you can use cargo-generate: -//! -//! ```sh -//! cargo install loco-cli -//! โฏ loco new -//! โœ” โฏ App name? ยท myapp -//! ? โฏ What would you like to build? โ€บ -//! โฏ lightweight-service (minimal, only controllers and views) -//! Rest API (with DB and user auth) -//! SaaS app (with DB and user auth) -//! ``` -//! -//! ## Available Features -//! -//! To avoid compiling unused dependencies, loco gates certain features. -//! -//! | Feature | Default | Description | -//! |------------|---------|-----------------------------| -//! | `auth_jwt` | true | Enable user authentication. | -//! | `cli` | true | Expose Cli commands. | -//! | `testing | false | Test Utilities Module. | -//! | `with-db` | true | with-db. | -//! | `channels` | false | Enable socket channels. | +#![doc = include_str!("../README.md")] + pub use self::errors::Error; mod banner; @@ -47,6 +24,7 @@ pub mod cli; pub mod auth; pub mod boot; +pub mod cache; pub mod config; pub mod controller; pub mod environment; diff --git a/src/storage/drivers/mod.rs b/src/storage/drivers/mod.rs index 7ea0a024f..3cdb6b367 100644 --- a/src/storage/drivers/mod.rs +++ b/src/storage/drivers/mod.rs @@ -10,6 +10,7 @@ pub mod azure; pub mod gcp; pub mod local; pub mod mem; +pub mod null; pub mod object_store_adapter; use super::StorageResult; diff --git a/src/storage/drivers/null.rs b/src/storage/drivers/null.rs new file mode 100644 index 000000000..73a762ed1 --- /dev/null +++ b/src/storage/drivers/null.rs @@ -0,0 +1,95 @@ +//! # Null Storage Driver +//! +//! The Null storage Driver is the default storage driver implemented when the +//! Loco framework is initialized. The primary purpose of this driver is to +//! simplify the user workflow by avoiding the need for feature flags or +//! optional storage driver configurations. +use std::path::Path; + +use async_trait::async_trait; +use bytes::Bytes; + +use super::{GetResponse, StorageResult, StoreDriver, UploadResponse}; +use crate::storage::StorageError; + +pub struct NullStorage {} + +/// Constructor for creating a new `Store` instance. +#[must_use] +pub fn new() -> Box { + Box::new(NullStorage {}) +} + +#[async_trait] +impl StoreDriver for NullStorage { + /// Uploads the content represented by `Bytes` to the specified path in the + /// object store. + /// + /// # Errors + /// + /// Returns a `StorageResult` with the result of the upload operation. + async fn upload(&self, _path: &Path, _content: &Bytes) -> StorageResult { + Err(StorageError::Any( + "Operation not supported by null storage".into(), + )) + } + + /// Retrieves the content from the specified path in the object store. + /// + /// # Errors + /// + /// Returns a `StorageResult` with the result of the retrieval operation. + async fn get(&self, _path: &Path) -> StorageResult { + Err(StorageError::Any( + "Operation not supported by null storage".into(), + )) + } + + /// Deletes the content at the specified path in the object store. + /// + /// # Errors + /// + /// Returns a `StorageResult` indicating the success of the deletion + /// operation. + async fn delete(&self, _path: &Path) -> StorageResult<()> { + Err(StorageError::Any( + "Operation not supported by null storage".into(), + )) + } + + /// Renames or moves the content from one path to another in the object + /// store. + /// + /// # Errors + /// + /// Returns a `StorageResult` indicating the success of the rename/move + /// operation. + async fn rename(&self, _from: &Path, _to: &Path) -> StorageResult<()> { + Err(StorageError::Any( + "Operation not supported by null storage".into(), + )) + } + + /// Copies the content from one path to another in the object store. + /// + /// # Errors + /// + /// Returns a `StorageResult` indicating the success of the copy operation. + async fn copy(&self, _from: &Path, _to: &Path) -> StorageResult<()> { + Err(StorageError::Any( + "Operation not supported by null storage".into(), + )) + } + + /// Checks if the content exists at the specified path in the object store. + /// + /// # Errors + /// + /// Returns a `StorageResult` with a boolean indicating the existence of the + /// content. + async fn exists(&self, _path: &Path) -> StorageResult { + Err(StorageError::Any( + "Operation not supported by null storage".into(), + )) + } +} diff --git a/src/storage/mod.rs b/src/storage/mod.rs index 8fcec1741..dc8db80d8 100644 --- a/src/storage/mod.rs +++ b/src/storage/mod.rs @@ -36,6 +36,9 @@ pub enum StorageError { #[error("secondaries errors")] Multi(BTreeMap), + + #[error(transparent)] + Any(#[from] Box), } pub type StorageResult = std::result::Result; diff --git a/src/validation.rs b/src/validation.rs index 537eeb648..af20ab9c7 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -84,10 +84,10 @@ impl From for DbErr { #[cfg(feature = "with-db")] #[must_use] pub fn into_db_error(errors: &ModelValidationErrors) -> sea_orm::DbErr { - use std::collections::HashMap; + use std::collections::BTreeMap; let errors = &errors.0; - let error_data: HashMap> = errors + let error_data: BTreeMap> = errors .field_errors() .iter() .map(|(field, field_errors)| { diff --git a/src/worker.rs b/src/worker.rs index f42eaace0..4ca2e6ccb 100644 --- a/src/worker.rs +++ b/src/worker.rs @@ -35,12 +35,12 @@ where async fn perform_later(ctx: &AppContext, args: T) -> Result<()> { match &ctx.config.workers.mode { WorkerMode::BackgroundQueue => { - if let Some(redis) = &ctx.redis { - Self::perform_async(redis, args).await.unwrap(); + if let Some(queue) = &ctx.queue { + Self::perform_async(queue, args).await.unwrap(); } else { error!( error.msg = - "worker mode requested but no redis connection supplied, skipping job", + "worker mode requested but no queue connection supplied, skipping job", "worker_error" ); } diff --git a/starters/rest-api/Cargo.toml b/starters/rest-api/Cargo.toml index affe485df..31dd0e7f1 100644 --- a/starters/rest-api/Cargo.toml +++ b/starters/rest-api/Cargo.toml @@ -20,7 +20,7 @@ async-trait = "0.1.74" tracing = "0.1.40" chrono = "0.4" validator = { version = "0.16" } -sea-orm = { version = "1.0.0-rc.1", features = [ +sea-orm = { version = "1.0.0-rc.4", features = [ "sqlx-sqlite", "sqlx-postgres", "runtime-tokio-rustls", diff --git a/starters/rest-api/migration/Cargo.toml b/starters/rest-api/migration/Cargo.toml index 5262af542..23e6c9b54 100644 --- a/starters/rest-api/migration/Cargo.toml +++ b/starters/rest-api/migration/Cargo.toml @@ -13,7 +13,7 @@ async-std = { version = "1", features = ["attributes", "tokio1"] } loco-rs = { version = "0.4.0" } [dependencies.sea-orm-migration] -version = "1.0.0-rc.1" +version = "1.0.0-rc.4" features = [ # Enable at least one `ASYNC_RUNTIME` and `DATABASE_DRIVER` feature if you want to run migration via CLI. # View the list of supported features at https://www.sea-ql.org/SeaORM/docs/install-and-config/database-and-async-runtime. diff --git a/starters/saas/Cargo.toml b/starters/saas/Cargo.toml index 2265769bb..864a9bfd6 100644 --- a/starters/saas/Cargo.toml +++ b/starters/saas/Cargo.toml @@ -20,7 +20,7 @@ async-trait = "0.1.74" tracing = "0.1.40" chrono = "0.4" validator = { version = "0.16" } -sea-orm = { version = "1.0.0-rc.1", features = [ +sea-orm = { version = "1.0.0-rc.4", features = [ "sqlx-sqlite", "sqlx-postgres", "runtime-tokio-rustls", diff --git a/starters/saas/migration/Cargo.toml b/starters/saas/migration/Cargo.toml index 5262af542..23e6c9b54 100644 --- a/starters/saas/migration/Cargo.toml +++ b/starters/saas/migration/Cargo.toml @@ -13,7 +13,7 @@ async-std = { version = "1", features = ["attributes", "tokio1"] } loco-rs = { version = "0.4.0" } [dependencies.sea-orm-migration] -version = "1.0.0-rc.1" +version = "1.0.0-rc.4" features = [ # Enable at least one `ASYNC_RUNTIME` and `DATABASE_DRIVER` feature if you want to run migration via CLI. # View the list of supported features at https://www.sea-ql.org/SeaORM/docs/install-and-config/database-and-async-runtime.