Function crates_io::check_token

source ·
pub fn check_token(token: &str) -> Result<()>
Expand description

Checks if a token is valid or malformed.

This check is necessary to prevent sending tokens which create an invalid HTTP request. It would be easier to check just for alphanumeric tokens, but we can’t be sure that all registries only create tokens in that format so that is as less restricted as possible.