Don't warn when an anonymous read succeeds
Rolling Release / build (push) Successful in 1m49s
Rolling Release / publish (push) Successful in 9s

A rejected login is now an error when it matters and silent otherwise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Opus 5.5 committed 2026-12-01 04:47:41 -08:00
1 parent c8d7f59633
commit e2f0ac27e1
2 files changed
+2 -7

No files matched your search

+1 -1
View File
@@ -122,7 +122,7 @@ See [examples/project](examples/project/README.md) for a working example project
Credentials are stored in `~/.orbit/auth.json` (`$ORBIT_ROOT/auth.json`, mode `0600`). Orbit also falls back to `~/.docker/config.json` (`$DOCKER_CONFIG/config.json`) including `credHelpers` and `credsStore`. Use `orbit logout <host>` to remove stored credentials from Orbit. Credentials are stored in `~/.orbit/auth.json` (`$ORBIT_ROOT/auth.json`, mode `0600`). Orbit also falls back to `~/.docker/config.json` (`$DOCKER_CONFIG/config.json`) including `credHelpers` and `credsStore`. Use `orbit logout <host>` to remove stored credentials from Orbit.
If a registry rejects the saved login, Orbit warns and reads anonymously, so public packages still work. Publishing always needs a valid login. When an anonymous read is refused or finds nothing, Orbit reports the rejected login instead of moving to the next channel, because the package may be private. If a registry rejects the saved login, Orbit reads anonymously without a message, so public packages still work. Publishing always needs a valid login. When an anonymous read is refused or finds nothing, Orbit reports the rejected login instead of moving to the next channel, because the package may be private.
## Channels ## Channels
+1 -6
View File
@@ -547,13 +547,8 @@ async fn bearer_token_or_anonymous(
} }
match fetch_bearer_token(token_url, None) { match fetch_bearer_token(token_url, None) {
Ok(tok) => { Ok(tok) => {
if !rejected_logins.contains(host) { // Stay quiet: the login is only reported if the anonymous read isn't enough.
rejected_logins[host] = rejected rejected_logins[host] = rejected
let start = if c_isatty(2) != 0 { "\r\u001B[2K" } else { "" }
c_print_err(
utf8_encode("\{start}warning: \{rejected}; reading anonymously\n"),
)
}
tok tok
} }
Err(_) => raise OrbitError(rejected) Err(_) => raise OrbitError(rejected)