Coding agents and access
Cloudflare Zero Trust integration
TesterArmy tests staging sites behind Cloudflare Zero Trust by sending saved bypass headers on every request to the host.
What the agents send
The Site Protection card holds the Cloudflare Access client ID and secret, and TesterArmy sends both headers on every request to the deployment host so runs load the app.
- CF-Access-Client-Id
- ••••••••••••
- CF-Access-Client-Secret
- ••••••••••••
- Sent on
- Every request to the deployment host
- Saved in
- Project Settings, Integrations, Site Protection
- Result
- Runs load the app instead of the Access login screen
- Service token
The recommended route is a service token from Zero Trust with a Service Auth policy that includes it.
- Bypass policy
The alternative is a Bypass policy on an HTTP header such as X-Tester-Army-Bypass, saved as a custom header.
- Not for logins
HTTP Basic Auth has its own Site Protection card, and app login forms use Test Credentials instead.
How it works
Setup is the Cloudflare Zero Trust card under Project Settings, Integrations, Site Protection. Cloudflare admits the headers once the Access application has a Service Auth or Bypass policy matching them.
Create a service token
Create a service token under Access, Service Auth in Cloudflare Zero Trust and copy both values, since the Client Secret is shown only once.
Add the Access policy
On the Access application that protects the site, add a policy with action Service Auth and an Include rule of type Service Token matching that token.
Save the headers in TesterArmy
Save the Client ID and Client Secret on the Cloudflare Zero Trust card under Site Protection, and every run sends both headers to the deployment host.
Works with
Vercel previews use their own Protection Bypass for Automation token, GitLab CI review apps and other CI deploys must be reachable, and GitHub pull request runs test each preview deployment.
Questions
Test staging behind Cloudflare Zero Trust
Create a service token and its Access policy, save both headers under Site Protection, and the next run loads the app.
