Skip to content

Cargo suggests _TOKEN environment variable even when it would not be applicable #12642

@arlosi

Description

@arlosi

When a registry token cannot be found, or a token is invalid, cargo displays an error recommending cargo login.

Starting in rust 1.67 with #10592, the message was amended to include the environment variable that could also be used to include the token.

error: no token found for `alternative`, please run `cargo login --registry alternative`
or use environment variable CARGO_REGISTRIES_ALTERNATIVE_TOKEN

With -Z credential-process, if cargo:token is not in registry.global-credential-providers or registries.<NAME>.credential-provider the suggested environment variable will not work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-credential-providerArea: credential provider for storing and retreiving credentialsA-registry-authenticationArea: registry authentication and authorization (authn authz)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions