As discussed in the team meeting, this should instead be solved by having both variants as dedicated scopes, if necessary.
This PR adjusts our AuthCheck calls for the three relevant endpoints (publish, change owner, yank) to check the token scope restrictions if the token has any.
Note that for the publish operation we unfortunately need an extra databa…
This allows us to use something like:
let auth = AuthCheck::default()
.with_endpoint_scope(EndpointScope::ChangeOwners)
.for_crate(crate_name)
.check(req)?;
This PR adds four additional tests for the owner change endpoint, related to the implementation of token scopes. Note that these tests are currently all returning 200 Ok because token scope checks have not been enabled for this endpoin…
Similar to #5568, this PR implements a CrateScope struct, which we use for the crate_scopes column of the API tokens database table. It also includes a matches() method to verify whether it matches a crate name or not.
This turns the endpoint_scopes column from Option<Vec<String>> to Option<Vec<EndpointScope>>, which is a bit more restrictive in the values it supports, and ensure that we're only serializing endpoint scopes to the database that ac…
The relevant links are now in the footer and everything else is already linked in "The Cargo Book", so there is no need for this dropdown in the header anymore.
This PR adds the https://github.com/postcss/postcss-custom-media PostCSS plugin to the style pipeline and imports the default breakpoints from https://tailwindcss.com/docs/responsive-design to eventually consolidate all of our existing b…
With over 70k crates it has become quite useless to filter the crates by their starting letter, so we might as well remove this feature to declutter the user interface a little bit.
<img width="994" alt="Bildschirmfoto 2021-12-23 um 22 33 02" src="https://user-images.githubusercontent.com/141300/147293184-03d219c1-78d0-422c-a757-e2cd0f4a07b4.png">
<img width="994" alt="Bildschirmfoto 2021…
There is no real downside of having these PRs open automatically and whether or not we merge them is still our decision in the end.
As suggested on Discord (see https://discord.com/channels/442252698964721669/835156566746595386/923210089085665381), this PR:
<img width="1008" alt="Bildschirmfoto 2021-12-22 um 20 02 10" src="https://user-images.githubusercontent.com/141300/147142321-1f56d28c-6a3c-4751-aefa-2d1e84bdb934.png">
Resolves https://github.com/rust-lang/crates.io/issues/3687
No…
> Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'sha256-n1+BB7Ckjcal1Pr7QNBh/dKRTtBQsIytFodRiIosXdE='". Either the 'unsafe-inline' keyword, a hash …
As discussed on Discord, the cargo login command is showing links to https://crates.io/me to access the API tokens. Since that is probably more important than any other bookmarks and has backwards compatibility concerns this PR is chan…
This is basically similar to the /me route, but split into multiple subroutes to make the settings more scaleable.
<img width="1001" alt="Bildschirmfoto 2021-12-21 um 13 54 58" src="https://user-images.githubusercontent.com/141300/1…
This works similar to the RUST_VERSION updates that we have already configured, but this time using the crate datasource, which corresponds to crates.io.
… and run that workflow only for pushes on the primary branch, instead of slowing down every single PR. Unless we make that coverage data more visible (e.g. using something like Codecov), it is probably not worth it to send 60% of the …