<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Guides on Gate One</title><link>https://clad-one.github.io/gate-one-doc/latest/docs/guides/</link><description>Recent content in Guides on Gate One</description><generator>Hugo</generator><language>en</language><atom:link href="https://clad-one.github.io/gate-one-doc/latest/docs/guides/index.xml" rel="self" type="application/rss+xml"/><item><title>Strict Content Security Policy</title><link>https://clad-one.github.io/gate-one-doc/latest/docs/guides/strict-csp/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://clad-one.github.io/gate-one-doc/latest/docs/guides/strict-csp/</guid><description>&lt;div class="sect1"&gt;&#10;&lt;h2 id="do-i-need-this-guide"&gt;Do I need this guide?&lt;/h2&gt;&#10;&lt;div class="sectionbody"&gt;&#10;&lt;div class="paragraph"&gt;&#10;&lt;p&gt;Gate One does &lt;strong&gt;not&lt;/strong&gt; add a Content Security Policy unless a route&#10;declares a &lt;code&gt;csp&lt;/code&gt; block. If you only proxy a page through Gate One,&#10;with no &lt;code&gt;csp&lt;/code&gt; block and no custom injection, there is nothing to do:&#10;the page’s own policy (if any) passes through unchanged.&lt;/p&gt;&#10;&lt;/div&gt;&#10;&lt;table class="tableblock frame-all grid-all stretch"&gt;&#10;&lt;colgroup&gt;&#10;&lt;col style="width: 40%;"/&gt;&#10;&lt;col style="width: 60%;"/&gt;&#10;&lt;/colgroup&gt;&#10;&lt;thead&gt;&#10;&lt;tr&gt;&#10;&lt;th class="tableblock halign-left valign-top"&gt;your situation&lt;/th&gt;&#10;&lt;th class="tableblock halign-left valign-top"&gt;what to do&lt;/th&gt;&#10;&lt;/tr&gt;&#10;&lt;/thead&gt;&#10;&lt;tbody&gt;&#10;&lt;tr&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;page proxied by Gate One, no &lt;code&gt;csp&lt;/code&gt; block, no custom injection, and&#10;the page sends no CSP&lt;/p&gt;&lt;/td&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;nothing: Gate One adds no CSP.&lt;/p&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;page proxied, but &lt;strong&gt;the page already sends a CSP&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;the browser&#10;enforces it. The guard’s inline script/style must be allowed by that&#10;policy, or the guard is blocked. Configure Gate One &lt;code&gt;csp.mode: &amp;#34;merge&amp;#34;&lt;/code&gt;&#10;(script hashes) or &lt;code&gt;&amp;#34;nonce&amp;#34;&lt;/code&gt;, and make the app’s &lt;code&gt;style-src&lt;/code&gt; compatible&#10;with the guard style. See “An application that already has a CSP”.&lt;/p&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;you enable &lt;code&gt;csp&lt;/code&gt; on a route&lt;/p&gt;&lt;/td&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;this guide applies.&lt;/p&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;you inject custom HTML/CSS/JS (&lt;code&gt;inject&lt;/code&gt;, userscripts, plugins)&lt;/p&gt;&lt;/td&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;this guide applies: your injected content must satisfy the policy.&lt;/p&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;you proxy an external site that sends a CSP&lt;/p&gt;&lt;/td&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;both policies are&#10;enforced; the origin’s policy can block the guard. See “External sites&#10;and &lt;code&gt;upstream&lt;/code&gt;”.&lt;/p&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;div class="paragraph"&gt;&#10;&lt;p&gt;You need this guide in the last four cases.&lt;/p&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;</description></item><item><title>Declarative UI gating</title><link>https://clad-one.github.io/gate-one-doc/latest/docs/guides/ui-gating/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://clad-one.github.io/gate-one-doc/latest/docs/guides/ui-gating/</guid><description>&lt;div id="preamble"&gt;&#10;&lt;div class="sectionbody"&gt;&#10;&lt;div class="paragraph"&gt;&#10;&lt;p&gt;This guide is the contract for the declarative gating attributes read&#10;by the injected guard script. The behavioural matrix at the end is the&#10;one executed by &lt;code&gt;test/ui/controls.mjs&lt;/code&gt; against the page fixture&#10;&lt;code&gt;test/ui/controls.html&lt;/code&gt;.&lt;/p&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;div class="sect1"&gt;&#10;&lt;h2 id="attributes"&gt;Attributes&lt;/h2&gt;&#10;&lt;div class="sectionbody"&gt;&#10;&lt;table class="tableblock frame-all grid-all stretch"&gt;&#10;&lt;colgroup&gt;&#10;&lt;col style="width: 25%;"/&gt;&#10;&lt;col style="width: 75%;"/&gt;&#10;&lt;/colgroup&gt;&#10;&lt;thead&gt;&#10;&lt;tr&gt;&#10;&lt;th class="tableblock halign-left valign-top"&gt;Attribute&lt;/th&gt;&#10;&lt;th class="tableblock halign-left valign-top"&gt;Meaning&lt;/th&gt;&#10;&lt;/tr&gt;&#10;&lt;/thead&gt;&#10;&lt;tbody&gt;&#10;&lt;tr&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;&lt;code&gt;data-gtw-auth=&amp;#34;before&amp;#34;&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;The action is neutralised while anonymous: &lt;code&gt;preventDefault()&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;stopPropagation()&lt;/code&gt;, then the login tab opens. Authenticate first, act&#10;after. &lt;strong&gt;Activation only&lt;/strong&gt;: turning a feature OFF is a deactivation and&#10;is always let through without login.&lt;/p&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;&lt;code&gt;data-gtw-auth=&amp;#34;after&amp;#34;&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;The native action proceeds while anonymous; the login tab opens as an&#10;invitation. The 401 request produced by the action is queued and&#10;replayed after login. &lt;strong&gt;Activation only&lt;/strong&gt;: a deactivation does not open&#10;the login tab.&lt;/p&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;&lt;code&gt;data-gtw-auth-off=&amp;#34;value&amp;#34;&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;For value controls (&lt;code&gt;select&lt;/code&gt;, &lt;code&gt;range&lt;/code&gt;, &lt;code&gt;date&lt;/code&gt;, &lt;code&gt;time&lt;/code&gt;,&#10;&lt;code&gt;datetime-local&lt;/code&gt;, &lt;code&gt;month&lt;/code&gt;, &lt;code&gt;week&lt;/code&gt;, &lt;code&gt;color&lt;/code&gt;): the value considered OFF.&#10;Moving &lt;strong&gt;to&lt;/strong&gt; it is a deactivation (free); moving &lt;strong&gt;away&lt;/strong&gt; from it is an&#10;activation. Default: the control’s default value (for a &lt;code&gt;select&lt;/code&gt;: the&#10;option carrying &lt;code&gt;selected&lt;/code&gt;, otherwise the first option). Ignored by the&#10;other control families.&lt;/p&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;&lt;code&gt;data-gtw-auth-hidden=&amp;#34;before&amp;#34;&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;Hidden while anonymous, shown once authenticated. Activating clicks&#10;are neutralised and show the sign-in banner; a checked checkbox may&#10;still be unchecked (deactivation).&lt;/p&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;&lt;code&gt;data-gtw-auth-hidden=&amp;#34;after&amp;#34;&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;Visible while anonymous, hidden once authenticated (pure affordance,&#10;composable with &lt;code&gt;data-gtw-auth=&amp;#34;before&amp;#34;&lt;/code&gt; for padlocks).&lt;/p&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;&lt;code&gt;data-gtw-roles&lt;/code&gt;, &lt;code&gt;data-gtw-scopes&lt;/code&gt;, &lt;code&gt;data-gtw-claims&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;Identity-conditioned visibility, evaluated after the session probe.&lt;/p&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;&lt;code&gt;data-gtw-logout&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&#10;&lt;td class="tableblock halign-left valign-top"&gt;&lt;p class="tableblock"&gt;Wires the click to the OIDC logout navigation. Authenticated only.&lt;/p&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;div class="paragraph"&gt;&#10;&lt;p&gt;Markup wins over the equivalent &lt;code&gt;uiGate&lt;/code&gt; rule: an element carrying a&#10;&lt;code&gt;data-gtw-auth&lt;/code&gt; (or &lt;code&gt;data-gtw-auth-hidden&lt;/code&gt;) attribute is not affected&#10;by a config rule for the same dimension.&lt;/p&gt;&#10;&lt;/div&gt;&#10;&lt;div class="paragraph"&gt;&#10;&lt;p&gt;&lt;code&gt;data-gtw-claims&lt;/code&gt; (and &lt;code&gt;uiGate[].claims&lt;/code&gt;) takes a JSON object: each key&#10;must match, each value is one accepted string or a list of accepted&#10;strings (OR / anyOf on the same claim), and &lt;code&gt;&amp;#34;*&amp;#34;&lt;/code&gt; means &amp;#34;claim present&amp;#34;.&#10;A token claim that is itself a list (&lt;code&gt;groups&lt;/code&gt;, token roles…) matches&#10;when one element matches. Example:&#10;&lt;code&gt;data-gtw-claims=&amp;#39;{&amp;#34;email&amp;#34;: [&amp;#34;&lt;a href="mailto:alice@example.com"&gt;alice@example.com&lt;/a&gt;&amp;#34;, &amp;#34;&lt;a href="mailto:a.rolland@example.com"&gt;a.rolland@example.com&lt;/a&gt;&amp;#34;]}&amp;#39;&lt;/code&gt;.&lt;/p&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;</description></item></channel></rss>