mirror of
https://gitee.com/wanwujie/sub2api
synced 2026-04-21 07:04:45 +08:00
feat(antigravity): add 403 forbidden status detection, classification and display
Backend: - Detect and classify 403 responses into three types: validation (account needs Google verification), violation (terms of service / banned), forbidden (generic 403) - Extract verification/appeal URLs from 403 response body (structured JSON parsing with regex fallback) - Add needs_verify, is_banned, needs_reauth, error_code fields to UsageInfo (omitempty for zero impact on other platforms) - Handle 403 in request path: classify and permanently set account error - Save validation_url in error_message for degraded path recovery - Enrich usage with account error on both success and degraded paths - Add singleflight dedup for usage requests with independent context - Differentiate cache TTL: success/403 → 3min, errors → 1min - Return degraded UsageInfo instead of HTTP 500 on quota fetch errors Frontend: - Display forbidden status badges with color coding (red for banned, amber for needs verification, gray for generic) - Show clickable verification/appeal URL links - Display needs_reauth and degraded error states in usage cell - Add Antigravity tier label badge next to platform type Tests: - Comprehensive unit tests for classifyForbiddenType (7 cases) - Unit tests for extractValidationURL (8 cases including unicode escapes) - Integration test for FetchQuota forbidden path
This commit is contained in:
@@ -2524,7 +2524,16 @@ export default {
|
||||
unlimited: 'Unlimited'
|
||||
},
|
||||
ineligibleWarning:
|
||||
'This account is not eligible for Antigravity, but API forwarding still works. Use at your own risk.'
|
||||
'This account is not eligible for Antigravity, but API forwarding still works. Use at your own risk.',
|
||||
forbidden: 'Forbidden',
|
||||
forbiddenValidation: 'Verification Required',
|
||||
forbiddenViolation: 'Violation Ban',
|
||||
openVerification: 'Open Verification Link',
|
||||
copyLink: 'Copy Link',
|
||||
linkCopied: 'Link Copied',
|
||||
needsReauth: 'Re-auth Required',
|
||||
rateLimited: 'Rate Limited',
|
||||
usageError: 'Fetch Error'
|
||||
},
|
||||
|
||||
// Scheduled Tests
|
||||
|
||||
Reference in New Issue
Block a user