Skip to content

Crates can easily be published to crates.io accidentally when using alternative registries #6123

@cswindle

Description

@cswindle

Currently when cargo new is run it requires that users remember to set the registry that the crate can be published to, if that is not done it can lead to closed-source software being uploaded to crates.io accidentally.

For enterprises to be able to safely use alternative registries I think there should be a mechanism which allows blocking publishing by default.

A couple of options I have thought of are:

  • set “publish = []” when using cargo new for everyone
  • if an alternative registry is configured set “publish = []”
  • set a default registry in config and set publish = []” on cargo new.

The third of these has the advantage that it could also be used in place of having —registry on every command run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions