fix(api): isolate environment PATs from stored OAuth
Summary
- Treat
GITLAB_TOKENandGITLAB_ACCESS_TOKENas PAT authentication unlessGLAB_IS_OAUTH2=trueexplicitly marks the environment credential as OAuth. - Prevent environment PAT requests from inheriting stored OAuth refresh state or writing refreshed credentials.
- Preserve stored OAuth and explicit environment OAuth behavior, with regression coverage for request headers, refresh calls, and config mutation.
Testing
go test -race -count=1 ./internal/apigo vet ./internal/apigit diff --check origin/main...HEAD- pre-push hooks: build, generated checks, lint (0 issues), and 3,092 tests (8 skipped, 0 failed)
AI assistance
Implemented and verified with OpenAI Codex assistance.
Closes #8214 (closed)