mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-11-16 22:57:53 +08:00
- 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
17 lines
449 B
Go
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)
|
|
}
|
|
}
|