Skip to content

Conversation

@Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Nov 25, 2025

Bildschirmfoto 2025-11-25 um 15 15 19

This PR implements the user interface seen above, to enable/disable the trustpub_only flag for crates.

The checkbox is only shown if a crate a) has trusted publishers configured or b) the flag is currently enabled. If the checkbox is unchecked when the crate has no more trusted publishers configured, it will stay visible until leaving the page.

The warning is shown whenever the crate has no trusted publishers configured and the flag is currently enabled.

Related

This adds a `setTrustpubOnlyTask` to enable/disable the trusted publishing restriction via the PATCH `/api/v1/crates/{name}` endpoint.
The checkbox is now only visible when:
- There are GitHub or GitLab trustpub configs, OR
- The `trustpub_only` flag is currently enabled

When the user disables the checkbox with no configs present, the checkbox
stays visible for the duration of that page visit. On the next visit, it
will be hidden.
…hing

Shows a warning alert above the trusted publishing section when
`trustpub_only` is enabled but no trusted publisher configs exist.
The warning text: "Trusted publishing is required but no publishers
are configured. Publishing to this crate is currently blocked."
@Turbo87 Turbo87 added C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works A-frontend 🐹 labels Nov 25, 2025
@Turbo87 Turbo87 requested a review from a team November 25, 2025 14:41
Copy link
Contributor

@eth3lbert eth3lbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've looked through the test cases, and they look correct to me 👍


It looks like you might be missing the e2e tests. 😉

@Turbo87
Copy link
Member Author

Turbo87 commented Nov 25, 2025

It looks like you might be missing the e2e tests. 😉

aaaaargh... again and again... how do I always forget this? 🙈 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-frontend 🐹 C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants