24 Pull Requests
rust-lang

rust-lang/crates.io

The Rust package registry
Rust
View on GitHub https://crates.io
bug
design
feature
documentation
tests
help-wanted
enhancement
Contribulator score: 33 Last scored 2023-11-07 18:31:11 UTC
Contributors (5)
  • BlakeWilliams
  • carols10cents
  • DoumanAsh
  • pimterry
  • Turbo87

Pull requests (208)

Turbo87

Extract `crates_io_session` crate to rust-lang/crates.io 2024-12-23 14:32:38 UTC

This PR extracts our session cookie handling code into a dedicated crate. This helps avoid tight coupling of the code and might improve compile times a little bit too.

Turbo87

Raise crate deletion download limit to rust-lang/crates.io 2024-12-23 13:41:00 UTC

As discussed in the last crates.io team meeting the current limit of just 100 downloads per month was too conservative. This commit raises the limit to 500 downloads per month to make self-service deletions a bit more viable in practice.

Turbo87

controllers/krate/delete: Send deletion notification email after successful deletion to rust-lang/crates.io 2024-12-23 13:34:41 UTC

This PR addresses part two of https://github.com/rust-lang/crates.io/issues/9352#issuecomment-2549402681 by sending a notification email to the owner when a crate is getting deleted.

Turbo87

openapi: Add security schemes to rust-lang/crates.io 2024-12-23 07:36:45 UTC

This PR improves our OpenAPI description by declaring what "security schemes" (aka. authentication schemes) are available, and what endpoints require which kind of authentication.

![Bildschirmfoto 2024-12-23 um 08 34 57](https://githu…

Turbo87

Simplify nested imports to rust-lang/crates.io 2024-12-19 15:54:15 UTC

I wish rustfmt / cargo clippy would lint for such things but unfortunately the corresponding rules are not stable yet… anyway, this saves a couple of lines and makes it easier for IDEs to auto-import things without duplicating imports.

Turbo87

real_ip: Remove Heroku router workaround to rust-lang/crates.io 2024-12-19 15:25:30 UTC

We have upgraded our servers to use the "Heroku Router 2.0" which fixed the X-Forwarded-For bug and no longer appends the IP to the first header it sees. This means we can finally remove our workaround and parse the header appropriately.

Turbo87

utoipa: Add pagination query params to `list_crates()` documentation to rust-lang/crates.io 2024-12-17 17:43:57 UTC

I guess the title speaks for itself…? 😅

Related:

  • https://github.com/rust-lang/crates.io/issues/741
  • https://github.com/rust-lang/crates.io/pull/10186
  • https://github.com/rust-lang/crates.io/pull/10201
  • https://github.c…
Turbo87

Extract more controller modules to rust-lang/crates.io 2024-12-17 16:55:11 UTC

This PR moves a couple of endpoints to new modules to make the individual files easier to digest. Additionally, some endpoints were previously in modules that didn't really fit that well.

Turbo87

Replace `BytesRequest` with `Json` and `Parts` extractors to rust-lang/crates.io 2024-12-17 16:18:10 UTC

These are easier to use and recommended by axum, so let's use them :)

Turbo87

tests/util: Adjust helper methods to work for JSON arrays too to rust-lang/crates.io 2024-12-17 13:04:46 UTC

The axum Json extractor expects a Content-Type: application/json header, but in our test utilities we currently only add that when we detect that the request body contains a JSON object. This PR adjusts the code to also work for JSON…

Turbo87

controllers/krate/search: Convert `Record` to named field struct to rust-lang/crates.io 2024-12-17 12:50:24 UTC

This makes the Record type a bit easier to work with compared to before with a unnamed, seven item tuple :D

Turbo87

controllers/krate/search: Move `letter` validation out of `make_query()` fn to rust-lang/crates.io 2024-12-17 10:10:41 UTC

This simplifies the make_query() fn, since it no longer needs to return a Result

Turbo87

controllers/krate/search: Derive `Deref` for `FilterParams` to rust-lang/crates.io 2024-12-17 10:08:52 UTC

No need to manually implement it, now that we use derive_more 🎉

Turbo87

controllers/krate/search: Simplify `auth_user_id` code to rust-lang/crates.io 2024-12-17 09:36:39 UTC

We can figure out the auth_user_id value at the point where we turn the ListQueryParams instance into FilterParams. This then allows us to get rid of the OnceLock, and remove the extra arguments from the make_query() fn.

Turbo87

Replace `unwrap()` with `?` to rust-lang/crates.io 2024-12-17 08:45:16 UTC

These are all in Result returning fns, so there is no need to use unwrap() if we can use ? instead :)

Turbo87

chrono: Use strftime shortcut specifiers to rust-lang/crates.io 2024-12-17 08:18:52 UTC

see https://docs.rs/chrono/0.4.39/chrono/format/strftime/index.html

Turbo87

controllers/krate/search: Read query parameters via axum extractor to rust-lang/crates.io 2024-12-16 16:12:51 UTC

This allows us to automatically derive OpenAPI descriptions and avoids unnecessary memory allocations from query parameters we do not care about in this endpoint.

Small caveat: the serde_html_form crate currently deserializes foo=…

Turbo87

utoipa: Add remaining `Path` params to rust-lang/crates.io 2024-12-16 11:11:45 UTC

The overhead of adding dedicated Path structs for these did not seem worth it compared to https://github.com/rust-lang/crates.io/pull/10208, so I added these Path params only to the utoipa annotations.

Related:

  • https://gith…
Turbo87

Extract `CratePath` and `CrateVersionPath` structs to rust-lang/crates.io 2024-12-15 13:06:52 UTC

These structs can be used as axum extractors for the corresponding Path patterns. At the same time, they implement utoipa::IntoParams, which allows them to be used in #[utoipa::path(params(CratePath), ...) form, which adds them t…

Turbo87

utoipa: Rename route handler fns to remove `operation_id` attributes to rust-lang/crates.io 2024-12-15 10:44:17 UTC

… and unify some of the differing naming patterns.

Turbo87

utoipa: Add annotations to (almost) all endpoints to rust-lang/crates.io 2024-12-13 17:52:51 UTC

This PR continues what #10186 started. It migrates (almost) all of our API endpoints to utoipa with a set of very basic annotations. The next step will be to add path and query parameters and request/response body schemas. Also missing…

Turbo87

router: Remove obsolete `DefaultBodyLimit` override to rust-lang/crates.io 2024-12-13 09:11:02 UTC

Now that we are not using the BytesRequest in the publish endpoint, this limit isn't actually used anymore. The StreamReader does not care about the limit and the JSON metadata blob and the tarball have their dedicated limits already.

Turbo87

controllers/helpers/pagination: Read query parameters via `axum::Query` extractor to rust-lang/crates.io 2024-12-13 08:46:29 UTC

This avoids allocating a bunch of String instances for all the keys and values in the query string when all we need is three optional fields, of which two are just integers. This PR also uses NonZeroU32 for the page and per_page …

Turbo87

Derive `Deref` for more structs to rust-lang/crates.io 2024-12-13 08:26:20 UTC

There is no need for us to implement this trait manually if we can just derive it :)

Turbo87

Replace `derive_deref` with `derive_more` to rust-lang/crates.io 2024-12-12 19:00:40 UTC

The former hasn't had a commit in 4 years, while the latter is properly maintained and might potentially unlock other useful derives.

1 2 3 4 5 … Next › Last »
  • Sponsored by  DNSimple,  Octobox &  Bugsnag
  • About
  • How to contribute?
  • API
  • Unsubscribe
    •  English
    •  Español
    •  Ελληνικά
    •  Português do Brasil
    •  Suomi
    •  Français
    •  Deutsch
    •  Русский
    •  Українська
    •  ไทย
    •  Italiano
    •  Norsk bokmål
    •  தமிழ்
    •  Tr
    •  简体中文
    •  正體中文
    •  日本語
    •  Čeština
    •  हिंदी
    •  Polski
    • Translate into your language!