Files
CLIProxyAPI/sdk/cliproxy/auth/errors_compat_test.go
Luis Pater 5a351d9570 feat(antigravity): deactivate credentials on TOS_VIOLATION and add optional pool-wide protective pause
- Detect the 403 PERMISSION_DENIED ErrorInfo reason=TOS_VIOLATION signature and mark the credential StatusDisabled + Disabled so it is excluded from rotation and persisted across restarts, while OAuth refresh stays intact; carry appeal_url/appeal_url_link_text through Error.Metadata to auth.Metadata and the management API.
- Add an optional pool-wide protective pause (antigravity.tos-pause-window, default 6h) armed only by TOS results, never by transient 429s, covering all Antigravity request paths including SSE mid-stream error frames and CountTokens.
- Distinguish terminal TOS results from stale/superseded results using a new Result.RefreshToken account hint so a same-account OAuth refresh applies the suspension while a genuine credential replacement discards it safely.

Closes: #7515
2026-11-14 04:49:56 +08:00

17 lines
449 B
Go

package auth_test
import (
"net/http"
"testing"
cliproxyauth "github.com/router-for-me/CLIProxyAPI/v8/sdk/cliproxy/auth"
)
func TestErrorLegacyUnkeyedLiteralCompatibility(t *testing.T) {
err := cliproxyauth.Error{"code", "message", false, http.StatusRequestTimeout, nil}
if err.Code != "code" || err.Message != "message" || err.Retryable || err.HTTPStatus != http.StatusRequestTimeout {
t.Fatalf("unexpected error fields: %#v", err)
}
}