feat(providers): account calls (auth/refresh/credits) egress on the local IP

Now only the generate/video submit uses proxy.url; cookie-exchange/login, token refresh, credit-balance and project/session bootstrap all go direct. Also splits adobe GenerateVideo (submit=proxy, poll/download=local). Verified live: adobe gpt 1K cookie-exchange via local IP, submit 23.244.30.102 (proxy) vs local 76.209.9.65, 2.0MB PNG. Build+vet pass.
This commit is contained in:
2026-07-09 16:36:04 +08:00
parent 6c2a942a88
commit 622bc9ba9a
7 changed files with 23 additions and 17 deletions
+3 -3
View File
@@ -139,7 +139,7 @@ func (c *Client) RefreshIfNeeded(ctx context.Context, cookie string) (string, bo
}
func (c *Client) refreshPost(ctx context.Context, refreshToken string) ([]byte, int, error) {
client, err := c.newTLSClient()
client, err := c.newDirectTLSClient()
if err != nil {
return nil, 0, err
}
@@ -307,7 +307,7 @@ func (c *Client) FetchCreditsBalance(ctx context.Context, cookie string) (map[st
defer cancel()
// NOTE: no /app here — the heavy SSR activation is done separately (on recovery
// and at generation via Activate). This probe just reads the current balance.
body, status, err := c.apiGet(probeCtx, cookie, "/api/billing-data")
body, status, err := c.apiGetP(probeCtx, cookie, "/api/billing-data", false)
if err != nil {
return unknownBalance("network: " + err.Error()), nil
}
@@ -366,7 +366,7 @@ func (c *Client) Activate(ctx context.Context, cookie string) {
}
actCtx, cancel := context.WithTimeout(context.WithoutCancel(ctx), 60*time.Second)
defer cancel()
_, _, _ = c.apiGet(actCtx, cookie, "/app")
_, _, _ = c.apiGetP(actCtx, cookie, "/app", false)
c.mu.Lock()
c.actAt[key] = time.Now().Unix()
c.mu.Unlock()