@capagents/forgeqe 3.1.1 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HOW_TO_USE.md +435 -78
- package/README.md +21 -6
- package/THIRD_PARTY_NOTICES.md +210 -1
- package/dist/docs-site/CREDITS.md +6 -0
- package/dist/docs-site/architecture-map/index.html +1 -1
- package/dist/docs-site/docs/app-theme.css +100 -8
- package/dist/docs-site/docs/architecture/index.html +210 -214
- package/dist/docs-site/docs/area-api/index.html +350 -0
- package/dist/docs-site/docs/area-automated-tests/index.html +967 -0
- package/dist/docs-site/docs/area-browser/index.html +430 -0
- package/dist/docs-site/docs/area-data/index.html +605 -0
- package/dist/docs-site/docs/area-desktop/index.html +755 -0
- package/dist/docs-site/docs/area-mobile/index.html +631 -0
- package/dist/docs-site/docs/area-operations/index.html +1069 -0
- package/dist/docs-site/docs/area-pull-requests/index.html +208 -0
- package/dist/docs-site/docs/area-quality/index.html +365 -0
- package/dist/docs-site/docs/area-release/index.html +320 -0
- package/dist/docs-site/docs/area-setup/index.html +1192 -0
- package/dist/docs-site/docs/area-systems/index.html +207 -0
- package/dist/docs-site/docs/area-test-cases/index.html +694 -0
- package/dist/docs-site/docs/containers/index.html +97 -104
- package/dist/docs-site/docs/cost-architecture/index.html +108 -112
- package/dist/docs-site/docs/custom-agents-first-run/index.html +19 -23
- package/dist/docs-site/docs/desktop/index.html +172 -162
- package/dist/docs-site/docs/desktop-ci/index.html +26 -33
- package/dist/docs-site/docs/evidence/index.html +253 -257
- package/dist/docs-site/docs/feature-test-prompts/index.html +66 -70
- package/dist/docs-site/docs/get-started/index.html +495 -0
- package/dist/docs-site/docs/graphify/index.html +42 -46
- package/dist/docs-site/docs/guardrails/index.html +17 -21
- package/dist/docs-site/docs/index.html +17 -6729
- package/dist/docs-site/docs/mobile/index.html +155 -162
- package/dist/docs-site/docs/model-routing/index.html +44 -51
- package/dist/docs-site/docs/overview/index.html +176 -0
- package/dist/docs-site/docs/product-graph/index.html +52 -55
- package/dist/docs-site/docs/product-knowledge/index.html +11 -15
- package/dist/docs-site/docs/product-views/index.html +53 -57
- package/dist/docs-site/docs/reference/index.html +379 -0
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/docs-site/docs/using/index.html +480 -0
- package/dist/docs-site/docs/web-app/index.html +147 -93
- package/dist/docs-site/security/index.html +930 -0
- package/dist/docs-site/security/security-theme.css +161 -0
- package/dist/docs-site/security/security.js +1465 -0
- package/dist/docs-site/vendor/react-18.3.1.production.min.js +31 -0
- package/dist/docs-site/vendor/react-dom-18.3.1.production.min.js +267 -0
- package/dist/docs-site/vendor/reactflow-11.11.4.umd.js +10 -0
- package/dist/forgeqe.js +1902 -1895
- package/dist/web/THIRD_PARTY_NOTICES.md +0 -136
- package/dist/web/assets/Agent-CPhmZdFX.js +8 -0
- package/dist/web/assets/AgentWork-BXdN9xgi.js +2 -0
- package/dist/web/assets/ApiTests-Do3xLjfB.js +10 -0
- package/dist/web/assets/Browse-WVkJT6Bs.js +2 -0
- package/dist/web/assets/Chat-CDc9UcQX.js +3 -0
- package/dist/web/assets/CommandPalette-BAZm62lV.js +1 -0
- package/dist/web/assets/Compare-Br6n9T9L.js +1 -0
- package/dist/web/assets/Cost-BBUyBu3Y.js +1 -0
- package/dist/web/assets/Data-Ch2DPEWp.js +6 -0
- package/dist/web/assets/Desktop-Qzoq-cQv.js +1 -0
- package/dist/web/assets/DesktopReview-CF_jQYAM.js +1 -0
- package/dist/web/assets/Evidence-C72Lj5_Q.js +1 -0
- package/dist/web/assets/Explore-ObkEpUyS.js +2 -0
- package/dist/web/assets/Features-CQzNo_WP.js +1 -0
- package/dist/web/assets/Flags-0-RniPJm.js +2 -0
- package/dist/web/assets/Flaky-BPJvNLCA.js +1 -0
- package/dist/web/assets/Impact-CfccsL_k.js +3 -0
- package/dist/web/assets/Jobs-T6m4zhDy.js +5 -0
- package/dist/web/assets/KindPage-BDUvWe2p.js +6 -0
- package/dist/web/assets/Migration-Dqeh4x5u.js +2 -0
- package/dist/web/assets/PageAgent-DNjzIgeY.js +1 -0
- package/dist/web/assets/Product-nYV_scOV.js +7 -0
- package/dist/web/assets/Production-CGSbEWVa.js +1 -0
- package/dist/web/assets/Quality-BIypojZm.js +1 -0
- package/dist/web/assets/Readiness-BlRjwJRg.js +1 -0
- package/dist/web/assets/Record-v2KLI-_Z.js +1 -0
- package/dist/web/assets/Regression-B-jSt4Jz.js +5 -0
- package/dist/web/assets/RelationGraph-8J98lOVG.js +1 -0
- package/dist/web/assets/Reports-GI4u6SyW.js +2 -0
- package/dist/web/assets/Response-mhBThq2b.js +9 -0
- package/dist/web/assets/Responsive-DXu7Ra7K.js +3 -0
- package/dist/web/assets/RunDiff-D0SHDNp0.js +1 -0
- package/dist/web/assets/Runs-C1Gjdi9M.js +2 -0
- package/dist/web/assets/Settings-BGGeuvyF.js +21 -0
- package/dist/web/assets/Steps-D-YG0eJy.js +2 -0
- package/dist/web/assets/TestCases-DC4w77eQ.js +1 -0
- package/dist/web/assets/TestData-CvKWRVVV.js +2 -0
- package/dist/web/assets/TestDebt-D8YzN29_.js +1 -0
- package/dist/web/assets/TestManagement-C5cDCqrD.js +1 -0
- package/dist/web/assets/Tosca-BGUv3RiJ.js +3 -0
- package/dist/web/assets/WhatsNew-B_Gyuv8O.js +1 -0
- package/dist/web/assets/agents-C0Jg2pN8.js +1 -0
- package/dist/web/assets/coverage-BMP6ELFJ.js +5 -0
- package/dist/web/assets/dataParts-DbeCj9ga.js +3 -0
- package/dist/web/assets/diff-BStuTmsN.js +2 -0
- package/dist/web/assets/families-BBFFrUlo.js +1 -0
- package/dist/web/assets/filters-CnAMr286.js +1 -0
- package/dist/web/assets/fold-D_O_VZui.js +1 -0
- package/dist/web/assets/head-CRo48rPt.js +1 -0
- package/dist/web/assets/highlight-BcFZIf59.js +4 -0
- package/dist/web/assets/index-B3JsM7tv.js +64 -0
- package/dist/web/assets/index-CafApcbZ.css +2 -0
- package/dist/web/assets/input-CtzK50ZF.js +1 -0
- package/dist/web/assets/jsx-runtime-LKYXHABd.js +1 -0
- package/dist/web/assets/line-icons-rdF8DYDJ.js +1 -0
- package/dist/web/assets/logos-D4oVWzqa.js +1 -0
- package/dist/web/assets/palette-DAaGSao7.js +1 -0
- package/dist/web/assets/paletteCommands-Co-RlQ8q.js +1 -0
- package/dist/web/assets/parts-D357Wolo.js +1 -0
- package/dist/web/assets/productParts-B8oHRCJF.js +1 -0
- package/dist/web/assets/qualityParts-BLkmIfDY.js +1 -0
- package/dist/web/assets/recordTest-Cez2sDJO.js +1 -0
- package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/web/assets/route-BloYJWgw.js +1 -0
- package/dist/web/index.html +12 -6
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/BASAL.md +1 -1
- package/docs/DESKTOP.md +20 -1
- package/docs/EVIDENCE.md +1 -1
- package/docs/MOBILE.md +4 -4
- package/docs/PRODUCT_KNOWLEDGE.md +2 -0
- package/docs/WEB_APP.md +114 -51
- package/docs/user-guide.html +404 -81
- package/forgeqe.example.yaml +3 -3
- package/package.json +1 -1
- package/prompts/page-differs.md +1 -1
- package/prompts/requests-rule.md +1 -1
- package/prompts/test-reviewer.md +1 -1
- package/prompts/test-rules.md +3 -4
- package/skills/web-guidance/LICENSE +202 -0
- package/skills/web-guidance/SKILL.md +76 -0
- package/skills/web-guidance/UPSTREAM +67 -0
- package/skills/web-guidance/references/accessibility/accessibility.md +585 -0
- package/skills/web-guidance/references/accessibility/accessible-error-announcement.md +302 -0
- package/skills/web-guidance/references/accessibility/accessible-generated-content.md +41 -0
- package/skills/web-guidance/references/accessibility/respect-os-text-scale.md +127 -0
- package/skills/web-guidance/references/css/responsive-design.md +16 -0
- package/skills/web-guidance/references/forms/autofill-address-form.md +86 -0
- package/skills/web-guidance/references/forms/autofill-payment-form.md +142 -0
- package/skills/web-guidance/references/forms/autofill-sign-in-form.md +145 -0
- package/skills/web-guidance/references/forms/autofill-sign-up-form.md +155 -0
- package/skills/web-guidance/references/forms/forms.md +415 -0
- package/skills/web-guidance/references/forms/ime-safe-enter-submit.md +115 -0
- package/skills/web-guidance/references/forms/required-field-feedback.md +317 -0
- package/skills/web-guidance/references/forms/select-menu-interaction.md +310 -0
- package/skills/web-guidance/references/forms/slider.md +184 -0
- package/skills/web-guidance/references/forms/sms-otp-form.md +208 -0
- package/skills/web-guidance/references/forms/switch.md +60 -0
- package/skills/web-guidance/references/forms/validate-input-after-interaction.md +406 -0
- package/skills/web-guidance/references/performance/break-up-long-tasks.md +64 -0
- package/skills/web-guidance/references/performance/identify-heavy-scripts.md +69 -0
- package/skills/web-guidance/references/performance/identify-inp-causes.md +105 -0
- package/skills/web-guidance/references/performance/interaction-paint-timing.md +200 -0
- package/skills/web-guidance/references/performance/optimize-image-priority.md +73 -0
- package/skills/web-guidance/references/performance/performance.md +384 -0
- package/skills/web-guidance/references/privacy/privacy.md +247 -0
- package/skills/web-guidance/references/security/passkey-authentication.md +218 -0
- package/skills/web-guidance/references/security/passkey-management.md +310 -0
- package/skills/web-guidance/references/security/passkey-reauthentication.md +142 -0
- package/skills/web-guidance/references/security/passkey-registration.md +186 -0
- package/skills/web-guidance/references/security/passkeys.md +39 -0
- package/skills/web-guidance/references/security/sanitize-untrusted-html.md +105 -0
- package/skills/web-guidance/references/security/secure-external-subresources.md +202 -0
- package/skills/web-guidance/references/security/security.md +390 -0
- package/skills/web-guidance/references/security/trusted-types.md +141 -0
- package/skills/web-guidance/references/security/validate-origins.md +197 -0
- package/skills/web-guidance/references/security/verify-email-ownership.md +235 -0
- package/skills/web-guidance/references/ui-atoms/position-aware-tooltips.md +173 -0
- package/skills/web-guidance/references/ui-atoms/responsive-table.md +122 -0
- package/skills/web-guidance/references/ui-atoms/viewport-aware-dropdowns.md +178 -0
- package/skills/web-guidance/references/ui-behaviors/drag-and-drop.md +108 -0
- package/skills/web-guidance/references/ui-behaviors/light-dismiss-a-dialog.md +89 -0
- package/skills/web-guidance/references/ui-behaviors/motion.md +97 -0
- package/skills/web-guidance/references/ui-behaviors/platform-controls-dismiss-dialog.md +40 -0
- package/skills/web-guidance/references/ui-behaviors/prevent-page-scroll-under-modal-dialog.md +59 -0
- package/skills/web-guidance/references/ui-behaviors/search-hidden-content.md +141 -0
- package/skills/web-guidance/references/ui-behaviors/sortable-table.md +140 -0
- package/skills/web-guidance/references/ui-components/accordion.md +343 -0
- package/skills/web-guidance/references/ui-components/breadcrumbs.md +168 -0
- package/skills/web-guidance/references/ui-components/carousel.md +206 -0
- package/skills/web-guidance/references/ui-components/checkbox.md +144 -0
- package/skills/web-guidance/references/ui-components/dialog.md +218 -0
- package/skills/web-guidance/references/ui-components/hovercard.md +391 -0
- package/skills/web-guidance/references/ui-components/menu.md +415 -0
- package/skills/web-guidance/references/ui-components/navbar.md +281 -0
- package/skills/web-guidance/references/ui-components/navigation-drawer.md +429 -0
- package/skills/web-guidance/references/ui-components/persistent-toast-notifications.md +185 -0
- package/skills/web-guidance/references/ui-components/progress.md +181 -0
- package/skills/web-guidance/references/ui-components/spinner.md +179 -0
- package/skills/web-guidance/references/ui-components/tabs.md +371 -0
- package/skills/web-guidance/references/ui-components/toolbar.md +277 -0
- package/skills/web-guidance/references/user-experience/form-factor-adaptation.md +120 -0
- package/skills/web-guidance/references/user-experience/natural-interactions.md +155 -0
- package/skills/web-guidance/references/visual-design/color.md +43 -0
- package/skills/web-guidance/references/visual-design/dark-mode.md +350 -0
- package/dist/web/assets/AgentWork-DwAI0_Of.js +0 -2
- package/dist/web/assets/ApiTests-C0vFSHmM.js +0 -10
- package/dist/web/assets/Browse-5jfdtRc5.js +0 -2
- package/dist/web/assets/Chat-B3uhI94O.js +0 -3
- package/dist/web/assets/CommandPalette-D2J4nf5y.js +0 -1
- package/dist/web/assets/Compare-CN75w1p9.js +0 -1
- package/dist/web/assets/Cost-QoxyjR95.js +0 -1
- package/dist/web/assets/Data-BAvkcBVt.js +0 -6
- package/dist/web/assets/Desktop-BXdOIalN.js +0 -1
- package/dist/web/assets/DesktopReview-Bl2SrPP0.js +0 -1
- package/dist/web/assets/Evidence-BJ_I52CD.js +0 -1
- package/dist/web/assets/Explore-D9AuyTip.js +0 -2
- package/dist/web/assets/Features-CusGMDR9.js +0 -1
- package/dist/web/assets/Flags-CycGFuUP.js +0 -2
- package/dist/web/assets/Flaky-BcSzJogN.js +0 -1
- package/dist/web/assets/Impact-CJHnyZ21.js +0 -3
- package/dist/web/assets/Jobs-4xcFzEFo.js +0 -5
- package/dist/web/assets/KindPage-BielEIej.js +0 -6
- package/dist/web/assets/Migration-NwanKpJg.js +0 -2
- package/dist/web/assets/PageAgent-CNw4NXva.js +0 -1
- package/dist/web/assets/Product-DS3LJZ4P.js +0 -7
- package/dist/web/assets/Production-D3zsyNIS.js +0 -1
- package/dist/web/assets/Quality-Ctj2YpC4.js +0 -1
- package/dist/web/assets/Readiness-DGcRr_co.js +0 -1
- package/dist/web/assets/Record-Cc-wGe_Y.js +0 -1
- package/dist/web/assets/Regression-DcsbrRa1.js +0 -5
- package/dist/web/assets/Reports-BkCn0-Sf.js +0 -2
- package/dist/web/assets/Response-BP0UwQcW.js +0 -9
- package/dist/web/assets/Responsive-C8U7dumd.js +0 -3
- package/dist/web/assets/RunDiff-BhABuhF_.js +0 -1
- package/dist/web/assets/Runs-OwdWEYBv.js +0 -2
- package/dist/web/assets/Steps-BvzbQyoD.js +0 -2
- package/dist/web/assets/TestCases-CLq_6JA5.js +0 -1
- package/dist/web/assets/TestData-B0oKAhp6.js +0 -2
- package/dist/web/assets/TestDebt-8NLQ5YV_.js +0 -1
- package/dist/web/assets/TestManagement-2LYQ7vsN.js +0 -1
- package/dist/web/assets/Tosca-DfvMpPTG.js +0 -3
- package/dist/web/assets/WhatsNew-BGFNGwqN.js +0 -1
- package/dist/web/assets/families-DYlN5v0i.js +0 -1
- package/dist/web/assets/filters-faaSnoIq.js +0 -1
- package/dist/web/assets/fold-CUjwWAK3.js +0 -1
- package/dist/web/assets/frame-BLPdAXUq.js +0 -13
- package/dist/web/assets/head-CsTxBsO0.js +0 -1
- package/dist/web/assets/index-CxiCvGZq.js +0 -78
- package/dist/web/assets/index-dOIsrzhD.css +0 -2
- package/dist/web/assets/line-icons-CwZWt93L.js +0 -1
- package/dist/web/assets/logos-dGuc1jIM.js +0 -1
- package/dist/web/assets/markdown-BI3F-SJ1.js +0 -10
- package/dist/web/assets/paletteCommands-QJiCuUEr.js +0 -1
- package/dist/web/assets/parts-CdF1f7yS.js +0 -1
- package/dist/web/assets/productParts-hNLD9fN0.js +0 -1
- package/dist/web/assets/qualityParts-CT25lBWU.js +0 -1
- package/dist/web/assets/recordTest-P792aBUt.js +0 -1
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# Web Privacy Guidelines for Developers
|
|
2
|
+
|
|
3
|
+
Web application developers must treat privacy as a foundational architectural requirement, not just a legal compliance checkbox. As the web ecosystem shifts away from passive tracking toward explicit, user-consented interactions, building privacy-preserving applications is critical for user trust and security.
|
|
4
|
+
|
|
5
|
+
This document provides high-level principles and detailed, actionable guidelines with code examples for web developers.
|
|
6
|
+
|
|
7
|
+
## High-Level Overview
|
|
8
|
+
|
|
9
|
+
These core themes should guide your approach to privacy in web development:
|
|
10
|
+
|
|
11
|
+
1. **Automation Asymmetry & Privacy Labor**: Do not offload the burden of protecting privacy to the user (privacy labor). Avoid overwhelming users with complex consent dialogs (automation asymmetry). Users have limited time and attention; offloading privacy choices to them is often ineffective and causes fatigue. Systems should be privacy-protective by default.
|
|
12
|
+
2. **Data Minimization**: "If you don't have the data, you can't lose it." Collect only the bare minimum required for the immediate task. Reducing data storage reduces the risk of breach and builds user trust.
|
|
13
|
+
3. **Purpose Limitation**: Data collected for one purpose must not be used for another without fresh consent. Repurposing data without explicit agreement violates the trust relationship with the user.
|
|
14
|
+
4. **Transparency by Default**: Be honest and clear about why data is collected, where it goes, and how long it is kept. Transparency builds trust and can be a unique selling point for your application.
|
|
15
|
+
5. **Trustworthy Agency**: Treat your application as an agent acting in the user's best interest. This means protecting them from intrusive behaviors, unnecessary data exposure, and acting as a loyal fiduciary to the user rather than serving third-party interests.
|
|
16
|
+
|
|
17
|
+
## Detailed Guidelines
|
|
18
|
+
|
|
19
|
+
### 1. Data Minimization and Purpose Limitation
|
|
20
|
+
|
|
21
|
+
Reducing the amount of data collected and strictly limiting its use is the most effective way to protect user privacy.
|
|
22
|
+
|
|
23
|
+
#### DOs:
|
|
24
|
+
* **DO** collect data at the lowest granularity necessary. If you only need to know if a user is in a certain age bracket (e.g., 18-34), ask for the bracket, not the exact date of birth.
|
|
25
|
+
* **DO** provide guest checkout options for e-commerce to avoid forced account creation, which reduces data collection and cart abandonment.
|
|
26
|
+
* **DO** delete data as soon as the purpose for its collection has been fulfilled.
|
|
27
|
+
* **DO** use techniques like "fuzzing" or adding noise to data (Differential Privacy) when gathering aggregate statistics.
|
|
28
|
+
|
|
29
|
+
#### DON'Ts:
|
|
30
|
+
* **DON'T** collect data speculatively "just in case" it might be useful in the future.
|
|
31
|
+
* **DON'T** reuse data collected for one purpose (e.g., security verification) for another (e.g., marketing) without explicit user consent.
|
|
32
|
+
|
|
33
|
+
#### Code Examples:
|
|
34
|
+
|
|
35
|
+
**Fuzzing Data Collection (HTML/JS)**
|
|
36
|
+
Instead of asking for exact age:
|
|
37
|
+
```html
|
|
38
|
+
<label for="age-bracket">Age Bracket:</label>
|
|
39
|
+
<select id="age-bracket" name="age-bracket">
|
|
40
|
+
<option value="18-34">18-34</option>
|
|
41
|
+
<option value="35-49">35-49</option>
|
|
42
|
+
<option value="50+">50+</option>
|
|
43
|
+
</select>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 2. Transparency and Trust
|
|
47
|
+
|
|
48
|
+
Build trust by being open about your data practices and providing easy ways for users to control their data.
|
|
49
|
+
|
|
50
|
+
#### DOs:
|
|
51
|
+
* **DO** provide inline explanations for why data is requested. Place the explanation directly next to the input field.
|
|
52
|
+
* **DO** provide a clear reason and context *before* requesting powerful browser permissions (e.g., camera, location).
|
|
53
|
+
* **DO** consider using the **Page Embedded Permission Control (PEPC)** `<permission>` element, if supported, to make permission requests declarative, user-initiated, and act as data mediators.
|
|
54
|
+
* **DO** use the `Clear-Site-Data` header when a user logs out to ensure no lingering data remains in the browser.
|
|
55
|
+
* **DO** make it as easy to opt-out or delete an account as it was to sign up.
|
|
56
|
+
|
|
57
|
+
#### DON'Ts:
|
|
58
|
+
* **DON'T** bury data collection explanations in long, complex privacy policies.
|
|
59
|
+
* **DON'T** use deceptive patterns (dark patterns) to trick users into giving consent.
|
|
60
|
+
|
|
61
|
+
#### Code Examples:
|
|
62
|
+
|
|
63
|
+
**Inline Transparency (HTML)**
|
|
64
|
+
```html
|
|
65
|
+
<div>
|
|
66
|
+
<label for="phone">Phone Number (Optional)</label>
|
|
67
|
+
<input id="phone" type="tel" name="phone">
|
|
68
|
+
<a href="#phone-help">Why do we ask for this?</a>
|
|
69
|
+
<aside id="phone-help">
|
|
70
|
+
We only use your phone number to send two-factor authentication codes for account security.
|
|
71
|
+
</aside>
|
|
72
|
+
</div>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Clear-Site-Data on Logout (HTTP Response)**
|
|
76
|
+
```http
|
|
77
|
+
HTTP/1.1 200 OK
|
|
78
|
+
Clear-Site-Data: "*"
|
|
79
|
+
```
|
|
80
|
+
*Note: If clearing the cache, avoid sending this on the main navigation page to prevent blocking UI rendering on slow devices; trigger it via a subresource.*
|
|
81
|
+
|
|
82
|
+
**Page Embedded Permission Control (HTML)**
|
|
83
|
+
```html
|
|
84
|
+
<!-- Declarative permission element with fallback -->
|
|
85
|
+
<permission type="geolocation" onpromptdismiss="updateMap()">
|
|
86
|
+
<!-- Fallback for unsupported browsers -->
|
|
87
|
+
<button onclick="navigator.geolocation.getCurrentPosition(updateMap)">
|
|
88
|
+
Use my location
|
|
89
|
+
</button>
|
|
90
|
+
</permission>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 3. Security and Data Handling for Privacy
|
|
94
|
+
|
|
95
|
+
Privacy relies on a foundation of secure coding. Vulnerabilities in the application or insecure storage directly lead to privacy violations.
|
|
96
|
+
|
|
97
|
+
#### DOs:
|
|
98
|
+
* **DO** scrub Personally Identifiable Information (PII) from application logs. Use automated masking for emails, tokens, and IDs.
|
|
99
|
+
* **DO** use `HttpOnly` flags for cookies storing session identifiers to prevent other scripts from accessing them.
|
|
100
|
+
* **DO** implement rate limiting on sensitive endpoints (e.g., user search or profile views) to prevent bulk data scraping.
|
|
101
|
+
* **DO** use **CHIPS (Cookies Having Independent Partitioned State)** by appending the `Partitioned` attribute for 1:1 embeds that do not share state across top-level sites.
|
|
102
|
+
|
|
103
|
+
#### DON'Ts:
|
|
104
|
+
* **DON'T** store sensitive tokens or PII in `localStorage`, as it is accessible by any embedded script.
|
|
105
|
+
* **DON'T** rely on unpartitioned `SameSite=None` cookies.
|
|
106
|
+
|
|
107
|
+
#### Code Examples:
|
|
108
|
+
|
|
109
|
+
**Secure Session Cookie (HTTP)**
|
|
110
|
+
```http
|
|
111
|
+
Set-Cookie: session_id=xyz123; Secure; HttpOnly; SameSite=Lax
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**CHIPS Cookie (HTTP)**
|
|
115
|
+
```http
|
|
116
|
+
Set-Cookie: theme_pref=dark; SameSite=None; Secure; Path=/; Partitioned; HttpOnly
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### 4. Third-Party Audits and Mitigations
|
|
120
|
+
|
|
121
|
+
Third-party scripts and resources are a common source of privacy leaks. You are responsible for the third parties you bring into your application.
|
|
122
|
+
|
|
123
|
+
#### DOs:
|
|
124
|
+
* **DO** conduct regular technical audits of network requests using DevTools or HAR files to identify what data third parties are collecting.
|
|
125
|
+
* **DO** use the **Façade Pattern** for heavy embeds (like YouTube or TikTok). Display a static thumbnail and load the interactive iframe only after the user clicks.
|
|
126
|
+
* **DO** use privacy-preserving options for embeds when available (e.g., `youtube-nocookie.com`).
|
|
127
|
+
* **DO** replace heavy social sharing SDKs with simple, static HTML links that do not track users.
|
|
128
|
+
* **DO** use the **Federated Credential Management API (FedCM)** to mediate "Sign-In" flows natively, preventing IdP tracking of Relying Parties prior to user consent.
|
|
129
|
+
|
|
130
|
+
#### DON'Ts:
|
|
131
|
+
* **DON'T** assume a third party is privacy-safe just because it is popular.
|
|
132
|
+
* **DON'T** load third-party scripts on pages where sensitive data (like checkout or health info) is handled unless strictly necessary.
|
|
133
|
+
|
|
134
|
+
#### Code Examples:
|
|
135
|
+
|
|
136
|
+
**Privacy-Preserving Social Sharing (HTML)**
|
|
137
|
+
```html
|
|
138
|
+
<!-- No JS SDK required -->
|
|
139
|
+
<a href="https://x.com/intent/tweet?text=Check%20this%20out&url=https%3A%2F%2Fexample.com"
|
|
140
|
+
rel="noopener" target="_blank">
|
|
141
|
+
Share on X
|
|
142
|
+
</a>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Video Façade Pattern (HTML/JS)**
|
|
146
|
+
```html
|
|
147
|
+
<div id="video-container" data-video-id="abc123">
|
|
148
|
+
<img src="https://img.youtube.com/vi/abc123/maxresdefault.jpg" alt="Play Video" id="play-btn">
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
<script>
|
|
152
|
+
document.getElementById('play-btn').addEventListener('click', function() {
|
|
153
|
+
const container = document.getElementById('video-container');
|
|
154
|
+
const videoId = container.dataset.videoId;
|
|
155
|
+
container.innerHTML = `<iframe src="https://www.youtube-nocookie.com/embed/${videoId}?autoplay=1" allowfullscreen></iframe>`;
|
|
156
|
+
});
|
|
157
|
+
</script>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**FedCM Sign-In (JavaScript)**
|
|
161
|
+
```javascript
|
|
162
|
+
try {
|
|
163
|
+
const credential = await navigator.credentials.get({
|
|
164
|
+
identity: {
|
|
165
|
+
providers: [{
|
|
166
|
+
configURL: "https://idp.example/fedcm.json",
|
|
167
|
+
clientId: "rp-client-id-123",
|
|
168
|
+
nonce: "a_secure_random_nonce_value"
|
|
169
|
+
}]
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
authenticateWithBackend(credential.token);
|
|
173
|
+
} catch (error) {
|
|
174
|
+
// Handle FedCM login failure
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### 5. Privacy-Preserving Headers
|
|
179
|
+
|
|
180
|
+
Use standard HTTP headers to instruct the browser to enforce privacy boundaries.
|
|
181
|
+
|
|
182
|
+
#### DOs:
|
|
183
|
+
* **DO** use `Permissions-Policy` to disable powerful features (like camera, microphone, geolocation) by default, enabling them only where required.
|
|
184
|
+
* **DO** set a strict `Referrer-Policy` to prevent leaking sensitive URL parameters to third parties.
|
|
185
|
+
|
|
186
|
+
#### Code Examples:
|
|
187
|
+
|
|
188
|
+
**Strict Referrer Policy (HTTP)**
|
|
189
|
+
```http
|
|
190
|
+
Referrer-Policy: strict-origin-when-cross-origin
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**Defensive Permissions Policy (HTTP)**
|
|
194
|
+
Disables powerful features for all origins by default.
|
|
195
|
+
```http
|
|
196
|
+
Permissions-Policy: geolocation=(), camera=(), microphone=(), accelerometer=()
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### 6. Fingerprinting and User-Agent Reduction
|
|
200
|
+
|
|
201
|
+
Avoid techniques that attempt to uniquely identify users covertly based on their device configuration. Fingerprinting takes away user control because it relies on unchanging characteristics and happens invisibly, preventing users from opting out or clearing their identifier.
|
|
202
|
+
|
|
203
|
+
#### DOs:
|
|
204
|
+
* **DO** use **Feature Detection** instead of User-Agent sniffing to determine if a browser supports a capability.
|
|
205
|
+
* **DO** use **User-Agent Client Hints** (UA-CH) if supported by the browser, when specific device targeting is required.
|
|
206
|
+
|
|
207
|
+
#### DON'Ts:
|
|
208
|
+
* **DON'T** use canvas rendering, font lists, or audio/video device enumerations to build a device fingerprint.
|
|
209
|
+
* **DON'T** rely on the full granularity of the traditional `navigator.userAgent` string.
|
|
210
|
+
|
|
211
|
+
#### Code Examples:
|
|
212
|
+
|
|
213
|
+
**Feature Detection (JavaScript)**
|
|
214
|
+
```javascript
|
|
215
|
+
// GOOD: Check if the API exists
|
|
216
|
+
if ('IntersectionObserver' in window) {
|
|
217
|
+
const observer = new IntersectionObserver(...);
|
|
218
|
+
} else {
|
|
219
|
+
// Fallback
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// BAD: Sniffing UA
|
|
223
|
+
// if (navigator.userAgent.includes("Chrome/100")) ...
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**User-Agent Client Hints (JavaScript)**
|
|
227
|
+
```javascript
|
|
228
|
+
if (navigator.userAgentData) {
|
|
229
|
+
navigator.userAgentData.getHighEntropyValues(["platformVersion", "architecture"])
|
|
230
|
+
.then(ua => {
|
|
231
|
+
console.log(ua.platformVersion);
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### 7. Data Rights and User Control
|
|
237
|
+
|
|
238
|
+
Empower users to exercise their rights over their personal data.
|
|
239
|
+
|
|
240
|
+
#### DOs:
|
|
241
|
+
* **DO** provide clear mechanisms for users to **access** all data you have collected about them.
|
|
242
|
+
* **DO** implement automated or easy manual flows for **data deletion** (erasure).
|
|
243
|
+
* **DO** allow users to correct inaccurate information associated with their identity.
|
|
244
|
+
|
|
245
|
+
#### DON'Ts:
|
|
246
|
+
* **DON'T** make the deletion process difficult or require users to contact support if sign-up was automated.
|
|
247
|
+
* **DON'T** retaliate against users who exercise their data rights by denying access to non-dependent services.
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Passkey Authentication
|
|
2
|
+
|
|
3
|
+
This guide details how to implement returning user authentication using discoverable credentials, both through explicit button triggers and seamless browser autofill suggestions (Conditional UI).
|
|
4
|
+
|
|
5
|
+
## Server-Side
|
|
6
|
+
|
|
7
|
+
### Options Generation
|
|
8
|
+
|
|
9
|
+
Create an endpoint that generates WebAuthn request parameters using a vetted library per standards.
|
|
10
|
+
|
|
11
|
+
1. **Use the predefined RP ID**: Use the predefined proper RP ID as a constant string and include it as `rpId` in the returned request options so the client can pass `publicKey.rpId` directly to Signal API calls.
|
|
12
|
+
2. **Generate challenge**: Generate a high-entropy, cryptographically secure random buffer, store it securely in the user's session, and encode it as Base64URL.
|
|
13
|
+
3. **Discoverable Credentials mapping**: Specify an empty array `[]` for `allowCredentials`. This requests discoverable credentials, meaning the user does not need to enter their username first; the passkey provider will present available accounts.
|
|
14
|
+
4. **User Verification level**: Set `userVerification: "preferred"` (or `"required"` if explicitly mandated by corporate compliance policies).
|
|
15
|
+
- The requested `userVerification` constraint level MUST be persisted inside the server session record at the options endpoint, rather than passed back from the client via query strings. This allows the verification endpoint to enforce strict matching constraints safely without risk of client manipulation.
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
// Options generation example (discoverable flow)
|
|
19
|
+
const options = {
|
|
20
|
+
challenge: serverGeneratedBase64UrlChallenge, // High-entropy random challenge stored in session
|
|
21
|
+
rpId: "example.com",
|
|
22
|
+
allowCredentials: [], // Request discoverable passkeys
|
|
23
|
+
userVerification: "preferred",
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// Persist expected UV level to user session
|
|
27
|
+
req.session.expectedUserVerification = "preferred";
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Verification Endpoint
|
|
31
|
+
|
|
32
|
+
Securely verify the assertion returned by the client to authenticate the user:
|
|
33
|
+
|
|
34
|
+
1. **Validate session challenge**: Enforce strict challenge matching between the client response and the expected challenge stored in the session.
|
|
35
|
+
2. **Enforce UV Preferences**:
|
|
36
|
+
- Allow UV-less authenticators (e.g., authenticator screen locks disabled) if the session's `expectedUserVerification` requested `"preferred"`, by passing `requireUserVerification: false` to your server-side verification library. If requested `"required"`, enforce biometrics/PIN entry strictly.
|
|
37
|
+
3. **Clean Server Error 404**: If the credential ID returned by the client is not found in the database, return an explicit HTTP `404` error so the client can trigger the Signal API.
|
|
38
|
+
|
|
39
|
+
## Client-Side Logic
|
|
40
|
+
|
|
41
|
+
### HTML Form Annotation
|
|
42
|
+
|
|
43
|
+
Annotate your username and password inputs to natively leverage Conditional UI. Autocomplete tokens combine the webauthn spec parameters.
|
|
44
|
+
|
|
45
|
+
Use the `autofocus` attribute on dedicated sign-in pages and sign-in dialogs so that the autofill options are immediately displayed. Do not use the `autofocus` attribute on pages or dialogs that are not dedicated sign-in forms. Do not use the `autofocus` attribute on sign-in forms that are embedded in a larger page. Ensure that pages have a concise but descriptive page title, and that dialogs have a concise but descriptive accessible name when the `autofocus` attribute is used on dedicated sign-in pages and dialogs.
|
|
46
|
+
|
|
47
|
+
Use the `aria-describedby` attribute on elements with `autofocus` so instructions and context are provided for screen reader users.
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<h1 id="signin-passkey">Sign In with Passkey</h1>
|
|
51
|
+
<!-- Autocomplete tokens must contain webauthn space-separated -->
|
|
52
|
+
<form id="signin-form">
|
|
53
|
+
<input
|
|
54
|
+
type="text"
|
|
55
|
+
name="username"
|
|
56
|
+
aria-describedby="signin-passkey"
|
|
57
|
+
autocomplete="username webauthn"
|
|
58
|
+
autofocus
|
|
59
|
+
data-testid="username-field"
|
|
60
|
+
/>
|
|
61
|
+
<input type="password" name="password" autocomplete="current-password" />
|
|
62
|
+
<button type="submit">Sign in</button>
|
|
63
|
+
</form>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Explicit Button Flow
|
|
67
|
+
|
|
68
|
+
Trigger passkey authentication when a user clicks a "Sign in with passkey" button. Abort any ongoing form autofill (Conditional Get) calls before invoking the passkey prompt.
|
|
69
|
+
|
|
70
|
+
### Conditional Mediation Flow (Form Autofill)
|
|
71
|
+
|
|
72
|
+
Activate form autofill suggestions on page load to offer passkey authentication natively when users focus on sign-in fields:
|
|
73
|
+
|
|
74
|
+
1. **Feature detect**: Call `PublicKeyCredential.getClientCapabilities()` on page load and **skip signing in with passkey** if `conditionalGet` is not available.
|
|
75
|
+
2. **Decode options**: Decode fetched credential JSON object with `PublicKeyCredential.parseRequestOptionsFromJSON()`.
|
|
76
|
+
3. **Invoke Conditional Get**: Call `navigator.credentials.get()` with `mediation: "conditional"` and pass an `AbortController` signal. This registers autofill silently without rendering a passkey dialog.
|
|
77
|
+
4. **Try/Catch Exception Segregation**: Wrap `navigator.credentials.get` call in try/catch block:
|
|
78
|
+
- `NotAllowedError`: The user cancelled or timed out the passkey login prompt.
|
|
79
|
+
- `AbortError`: The authentication request was cancelled programmatically.
|
|
80
|
+
5. **Call Signal API**: Wrap server verification `fetch()` call in a try/catch block:
|
|
81
|
+
- Show an error message for the user to understand what went wrong.
|
|
82
|
+
- Call `signalUnknownCredential()` ONLY when the server explicitly responds with HTTP status `404` (Credential not found) and the user is unauthenticated.
|
|
83
|
+
- Always pass `rpId: publicKey.rpId` from the server's request options. **DO NOT** derive `rpId` from `window.location.hostname` on the client, as the server's configured RP ID may be a registrable parent domain (such as `example.com` on `login.example.com`) or use Related Origin Requests.
|
|
84
|
+
- The `credentialId` parameter passed to `signalUnknownCredential()` MUST strictly be the Base64URL-encoded credential ID string (e.g., `encoded.id`), NOT the raw ArrayBuffer object `credential.rawId`.
|
|
85
|
+
6. **Encode the response**: Encode the credential `AuthenticatorAssertionResponse` with `.toJSON()` before sending it to the server for verification.
|
|
86
|
+
|
|
87
|
+
```javascript
|
|
88
|
+
// optionsFetch and loginVerifyFetch are app-defined HTTP methods
|
|
89
|
+
import { optionsFetch, loginVerifyFetch } from "./api.js";
|
|
90
|
+
|
|
91
|
+
let autofillAbortController = new AbortController();
|
|
92
|
+
|
|
93
|
+
async function initializeConditionalAutofill() {
|
|
94
|
+
// Feature detect Conditional Get autofill support
|
|
95
|
+
const capabilities = await PublicKeyCredential.getClientCapabilities();
|
|
96
|
+
if (capabilities.conditionalGet === true) {
|
|
97
|
+
const loginOptionsJSON = await optionsFetch();
|
|
98
|
+
const publicKey =
|
|
99
|
+
PublicKeyCredential.parseRequestOptionsFromJSON(loginOptionsJSON);
|
|
100
|
+
|
|
101
|
+
try {
|
|
102
|
+
// Initiate Conditional UI form autofill suggestions
|
|
103
|
+
const credential = await navigator.credentials.get({
|
|
104
|
+
publicKey,
|
|
105
|
+
signal: autofillAbortController.signal,
|
|
106
|
+
mediation: "conditional",
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// Segregated verification fetch
|
|
110
|
+
const encoded = credential.toJSON();
|
|
111
|
+
const response = await loginVerifyFetch(encoded);
|
|
112
|
+
if (!response.ok && response.status === 404) {
|
|
113
|
+
// Note: this code path runs pre-authentication, satisfying the unauth precondition
|
|
114
|
+
if (PublicKeyCredential.signalUnknownCredential) {
|
|
115
|
+
await PublicKeyCredential.signalUnknownCredential({
|
|
116
|
+
rpId: publicKey.rpId, // Always use the server-provided rpId; DO NOT use window.location.hostname
|
|
117
|
+
credentialId: encoded.id,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
} catch (err) {
|
|
122
|
+
// Silently swallow expected client WebAuthn exceptions
|
|
123
|
+
if (["NotAllowedError", "AbortError"].includes(err.name)) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
console.error("Unexpected conditional get error:", err);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
async function triggerButtonAuthentication() {
|
|
132
|
+
// Abort any pending Conditional Get call to prevent passkey prompt collisions
|
|
133
|
+
autofillAbortController.abort();
|
|
134
|
+
autofillAbortController = new AbortController(); // Reset controller for next triggers
|
|
135
|
+
|
|
136
|
+
const loginOptionsJSON = await optionsFetch();
|
|
137
|
+
const publicKey =
|
|
138
|
+
PublicKeyCredential.parseRequestOptionsFromJSON(loginOptionsJSON);
|
|
139
|
+
|
|
140
|
+
let credential;
|
|
141
|
+
try {
|
|
142
|
+
// Passkey explicit prompt trigger
|
|
143
|
+
credential = await navigator.credentials.get({
|
|
144
|
+
publicKey,
|
|
145
|
+
signal: autofillAbortController.signal,
|
|
146
|
+
});
|
|
147
|
+
} catch (err) {
|
|
148
|
+
if (err.name === "NotAllowedError") {
|
|
149
|
+
console.log("User cancelled passkey login.");
|
|
150
|
+
} else if (err.name === "AbortError") {
|
|
151
|
+
console.log("The authentication operation was aborted.");
|
|
152
|
+
}
|
|
153
|
+
// Re-arm Conditional autofill Suggestions after cancelled explicit button prompts
|
|
154
|
+
initializeConditionalAutofill();
|
|
155
|
+
return; // Safe exit
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Segregated verification try/catch (HTTP 404 trigger)
|
|
159
|
+
const encoded = credential.toJSON();
|
|
160
|
+
try {
|
|
161
|
+
const response = await loginVerifyFetch(encoded);
|
|
162
|
+
if (!response.ok && response.status === 404) {
|
|
163
|
+
// Note: this code path runs pre-authentication, satisfying the unauth precondition
|
|
164
|
+
if (PublicKeyCredential.signalUnknownCredential) {
|
|
165
|
+
await PublicKeyCredential.signalUnknownCredential({
|
|
166
|
+
rpId: publicKey.rpId, // Always use the server-provided rpId; DO NOT use window.location.hostname
|
|
167
|
+
credentialId: encoded.id, // Base64URL-encoded credential ID
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
} catch (serverErr) {
|
|
172
|
+
console.error("Verification request error:", serverErr);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Trigger Conditional Get on load
|
|
177
|
+
window.addEventListener("DOMContentLoaded", initializeConditionalAutofill);
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Fallback Strategies
|
|
181
|
+
|
|
182
|
+
### Passkey feature detection fallback
|
|
183
|
+
|
|
184
|
+
Baseline status for the api.PublicKeyCredential.getClientCapabilities_static capability: Newly available. It's been Baseline since 2025-02-06.
|
|
185
|
+
Supported by: Chrome 133 (Feb 2025), Edge 133 (Feb 2025), Firefox 135 (Feb 2025), and Safari 17.4 (Mar 2024).
|
|
186
|
+
|
|
187
|
+
Load `webauthn-polyfills` so `PublicKeyCredential.getClientCapabilities()` is available whenever `PublicKeyCredential` is supported:
|
|
188
|
+
|
|
189
|
+
```js
|
|
190
|
+
// With a bundler (`npm install webauthn-polyfills`):
|
|
191
|
+
import 'webauthn-polyfills';
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Without a bundler, serve the package from your own origin, or import it from a CDN such as `https://esm.sh/webauthn-polyfills@0.1.7` (pin the exact version). For third-party URLs, add Subresource Integrity: the `integrity` attribute on the `<script>` tag, or an import map's `integrity` field for `import` statements.
|
|
195
|
+
|
|
196
|
+
### Signal API Synchronization Fallback
|
|
197
|
+
|
|
198
|
+
Browser support for Web authentication signal methods: Limited availability.
|
|
199
|
+
Supported by: Chrome 132 (Jan 2025), Edge 132 (Jan 2025), and Safari 26 (Sep 2025).
|
|
200
|
+
Unsupported in: Firefox.
|
|
201
|
+
|
|
202
|
+
The WebAuthn Signal API (`webauthn-signals`) is a progressive optimization used to keep password managers in sync with the server credential state.
|
|
203
|
+
|
|
204
|
+
- **Fallback Experience**: Gated via `if (PublicKeyCredential.signalUnknownCredential)`. If unsupported, the background verification sync is bypassed gracefully without throwing browser exceptions.
|
|
205
|
+
|
|
206
|
+
### Easy JSON Serialization Fallback
|
|
207
|
+
|
|
208
|
+
Baseline status for the api.PublicKeyCredential.parseRequestOptionsFromJSON_static capability: Newly available. It's been Baseline since 2025-03-31.
|
|
209
|
+
Supported by: Chrome 129 (Sep 2024), Edge 129 (Sep 2024), Firefox 119 (Oct 2023), and Safari 18.4 (Mar 2025).
|
|
210
|
+
|
|
211
|
+
Load `webauthn-polyfills` so `PublicKeyCredential.parseRequestOptionsFromJSON()` and `PublicKeyCredential.prototype.toJSON()` are available whenever `PublicKeyCredential` is supported:
|
|
212
|
+
|
|
213
|
+
```js
|
|
214
|
+
// With a bundler (`npm install webauthn-polyfills`):
|
|
215
|
+
import 'webauthn-polyfills';
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Without a bundler, serve the package from your own origin, or import it from a CDN such as `https://esm.sh/webauthn-polyfills@0.1.7` (pin the exact version). For third-party URLs, add Subresource Integrity: the `integrity` attribute on the `<script>` tag, or an import map's `integrity` field for `import` statements.
|