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 <noreply@anthropic.com>
This commit is contained in:
1 parent
c8d7f59633
commit
e2f0ac27e1
2 files changed
+3
-8
No files matched your search
@@ -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
|
||||||
|
|
||||||
|
|||||||
+2
-7
@@ -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)
|
||||||
|
|||||||
Reference in new issue
Block a user