Document Cloudflare per_page floor and Vercel teamId
Note that Cloudflare requires per_page in 5..50 so nobody optimizes it back to per_page=1, which returned 400 and, before terminal classification, produced a 400 storm. Also correct a stale team_id reference in the Vercel user-fetch comment: the OAuth callback surfaces the team as teamId. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
@@ -206,6 +206,9 @@ func (r *cloudflareNameResolver) ResolveInstanceName(ctx context.Context) (strin
|
||||
|
||||
q := cfURL.Query()
|
||||
q.Set("page", "1")
|
||||
// Cloudflare requires per_page in the range 5..50; per_page=1 is rejected
|
||||
// with a 400 (which, before terminal classification, caused a 400 storm).
|
||||
// Do not "optimize" this back down to 1.
|
||||
q.Set("per_page", "50")
|
||||
cfURL.RawQuery = q.Encode()
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ func FetchVercelUser(ctx context.Context, client *http.Client) (VercelUser, erro
|
||||
// one-shot SSRF-protected client and applies the freshly-minted access
|
||||
// token as a Bearer header on the request. The OAuth callback handler
|
||||
// uses the returned UID as a synthetic TeamID when the install targets
|
||||
// a personal account (no team_id surfaced by the callback).
|
||||
// a personal account (no teamId surfaced by the callback).
|
||||
func FetchVercelUserID(ctx context.Context, accessToken string) (string, error) {
|
||||
reqCtx, cancel := context.WithTimeout(ctx, 10*time.Second)
|
||||
defer cancel()
|
||||
|
||||
Reference in New Issue
Block a user