Skip to content

Commit 0b03cd4

Browse files
committed
docs: explain private Netlify previews and the key storage
1 parent 74493e6 commit 0b03cd4

4 files changed

Lines changed: 40 additions & 22 deletions

File tree

‎src/content/docs/guides/netlify-integration/frequently-asked-questions.mdx‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ If the log says `Could not report the GitHub check (403)` instead, the key belon
2323
## Why does Netlify's secrets scan fail my build?
2424

2525
Build tools like Next.js cache the build environment, so the scan can find secrets in the build output.
26-
The extension adds its own key, `ENDFORM_NETLIFY_API_KEY`, to the project's `SECRETS_SCAN_OMIT_KEYS` and keeps any keys you already listed.
26+
The extension's own key isn't an environment variable, so the scan never sees it.
2727

28-
If you set `SECRETS_SCAN_OMIT_KEYS` in `netlify.toml`, which takes precedence, add `ENDFORM_NETLIFY_API_KEY` there.
29-
Do the same for other secrets your tests use, such as `E2E_NETLIFY_PREVIEW_PASSWORD`.
28+
Secrets your tests use, such as `E2E_NETLIFY_PREVIEW_PASSWORD`, can still trip the scan.
29+
Add them to the project's `SECRETS_SCAN_OMIT_KEYS` variable, or to `netlify.toml` if you set it there.
3030

31-
## Why do all my tests fail on Netlify's password page?
31+
## Why do all my tests fail with 401 Unauthorized?
3232

33-
Your Deploy Previews are protected. See [Password-protected Deploy Previews](/docs/guides/netlify-integration/password-protected-deploy-previews).
33+
Your Deploy Previews are protected, so your tests get Netlify's login or password page instead of your app.
34+
New Netlify projects are private by default.
35+
See [Private and password-protected Deploy Previews](/docs/guides/netlify-integration/password-protected-deploy-previews).
3436

3537
## Can I block a merge when the tests fail?
3638

‎src/content/docs/guides/netlify-integration/index.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Try it with our [demo repository](https://github.com/endformdev/playwright-tutor
2727
/>
2828

2929
<LinkCard
30-
title="Password-protected Deploy Previews"
31-
description="Let your tests get past Netlify's password page."
30+
title="Private and password-protected Deploy Previews"
31+
description="Let your tests reach Deploy Previews that Netlify protects."
3232
href="/docs/guides/netlify-integration/password-protected-deploy-previews"
3333
/>
3434

‎src/content/docs/guides/netlify-integration/installing-the-netlify-extension.mdx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ You need to be an owner or admin of the Endform organization you connect, and yo
4343
});
4444
```
4545

46-
5. ### Show results on pull requests (optional)
46+
5. ### Make your Deploy Previews reachable
47+
48+
Endform's runners open your Deploy Previews like any visitor, so they can't sign in to Netlify.
49+
New Netlify projects are private by default, so check **Project configuration > General > Visitor access > Project visibility** and set previews to public, or to password protected on Pro plans.
50+
See [Private and password-protected Deploy Previews](/docs/guides/netlify-integration/password-protected-deploy-previews).
51+
52+
6. ### Show results on pull requests (optional)
4753

4854
[Install the Endform GitHub app](https://endform.dev/app/docs-link?link=settings-integrations) on the repository to get an **Endform** check on each pull request.
4955

@@ -52,7 +58,7 @@ You need to be an owner or admin of the Endform organization you connect, and yo
5258
## How it works
5359

5460
Configuring a project creates an Endform API key for it.
55-
Netlify stores the key as a secret environment variable, `ENDFORM_NETLIFY_API_KEY`, that's only available to Deploy Preview builds.
61+
The extension keeps the key in its own settings for the project, not in your project's environment variables, and only uses it in Deploy Preview builds.
5662

5763
On every Deploy Preview:
5864

‎src/content/docs/guides/netlify-integration/password-protected-deploy-previews.mdx‎

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,33 @@
11
---
2-
title: Password-protected Deploy Previews
3-
description: Let your tests get past Netlify's password page
2+
title: Private and password-protected Deploy Previews
3+
description: Let your tests reach Deploy Previews that Netlify protects
44
sidebar:
55
order: 2
66
---
77

88
import { Aside, Steps } from "@astrojs/starlight/components";
99

10-
If your Netlify project protects its Deploy Previews, every request from your tests gets Netlify's protection page instead of your app.
11-
Endform doesn't bypass the protection for you, but your tests can get past it themselves.
10+
If your Netlify project protects its Deploy Previews, every request from your tests gets Netlify's login or password page instead of your app.
11+
In the deploy log, this usually shows as failing tests and `401 Unauthorized` responses.
1212

13-
## Basic password protection
13+
Check your project's protection under **Project configuration > General > Visitor access > Project visibility**.
14+
Previews can be public, private, or password protected, separately from production.
15+
16+
## Private Deploy Previews
17+
18+
Netlify makes new projects private by default.
19+
A private project asks every visitor to sign in with Netlify, and Netlify has no way for automated tests to get past it.
20+
21+
To test private Deploy Previews, change the preview visibility:
22+
23+
- **On any plan:** make previews public.
24+
- **On Pro plans:** protect previews with a password instead, and let your tests enter it as described below.
25+
26+
Production can stay private either way.
27+
28+
## Password-protected Deploy Previews
29+
30+
Password protection is only available on Netlify Pro plans.
1431

1532
Netlify's password page is a form that posts a `password` field.
1633
When the password is right, Netlify sets a cookie that gives access to the whole deploy.
@@ -24,7 +41,7 @@ Your tests can post the password once and add that cookie to every browser conte
2441

2542
Variables that start with `E2E_` are [sent to Endform's remote runners](/docs/explanation/transfer-state-to-remote-runners#environment-variables) automatically.
2643

27-
Also add `E2E_NETLIFY_PREVIEW_PASSWORD` to the project's `SECRETS_SCAN_OMIT_KEYS` variable, next to `ENDFORM_NETLIFY_API_KEY`.
44+
Also add `E2E_NETLIFY_PREVIEW_PASSWORD` to the project's `SECRETS_SCAN_OMIT_KEYS` variable.
2845
Build tools like Next.js cache the build environment, so Netlify's secrets scan would otherwise find the password in the build output and fail the build.
2946

3047
2. ### Get the cookie
@@ -118,10 +135,3 @@ The [demo repository](https://github.com/endformdev/playwright-tutorial) uses th
118135
<Aside title="Using a coding agent?">
119136
Ask it to: "Make our Playwright tests work against password-protected Netlify Deploy Previews. Post `E2E_NETLIFY_PREVIEW_PASSWORD` to the base URL once, take the cookie from the `Set-Cookie` header, add it to every browser context through a `context` fixture override, and send it as a `Cookie` header on direct `fetch` calls. Do nothing when the variable isn't set."
120137
</Aside>
121-
122-
## Netlify team login and SSO
123-
124-
Team login protection asks visitors to sign in with a Netlify account, so automated tests can't get past it.
125-
Netlify doesn't document a way for automated requests to get past it.
126-
127-
To test protected Deploy Previews, switch the protection to a basic password, or turn off protection for Deploy Previews in your project's visitor access settings.

0 commit comments

Comments
 (0)