From e2f0ac27e151db7769e2cf62ebe2b43cbdbbbd0a Mon Sep 17 00:00:00 2001 From: nandithebull Date: Tue, 1 Dec 2026 04:47:41 -0800 Subject: [PATCH] Don't warn when an anonymous read succeeds A rejected login is now an error when it matters and silent otherwise. Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- src/main/oci.mbt | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9f3caec..6dd3d72 100644 --- a/README.md +++ b/README.md @@ -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 ` 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 diff --git a/src/main/oci.mbt b/src/main/oci.mbt index ee2b8ff..6244d5a 100644 --- a/src/main/oci.mbt +++ b/src/main/oci.mbt @@ -547,13 +547,8 @@ async fn bearer_token_or_anonymous( } match fetch_bearer_token(token_url, None) { Ok(tok) => { - if !rejected_logins.contains(host) { - 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"), - ) - } + // Stay quiet: the login is only reported if the anonymous read isn't enough. + rejected_logins[host] = rejected tok } Err(_) => raise OrbitError(rejected)