add templating doc in webhook form
Browse files- templates/webhook_form.html +5 -5
- templates/webhooks.html +14 -14
templates/webhook_form.html
CHANGED
|
@@ -81,18 +81,18 @@
|
|
| 81 |
<label for="content" class="form-label">Content Template (JSON)</label>
|
| 82 |
<textarea class="form-control" id="content" name="content" rows="5" placeholder='{"key":"value", "attestation":{attestation_details}}'>{% if webhook and webhook.content %}{{ webhook.content }}{% else %}{"attestation":{attestation_details}}{% endif %}</textarea>
|
| 83 |
<small class="form-text text-muted">
|
| 84 |
-
<b>Templating:</b>
|
| 85 |
<b>Supported variables:</b>
|
| 86 |
<ul>
|
| 87 |
-
<li><code>
|
| 88 |
-
<li><code>
|
| 89 |
<li>Any context field: <code>--contextkey--</code> (empty string if missing)</li>
|
| 90 |
<li>Labels: <code>--labels.labelname--</code> (gets value for label <code>labelname</code>, empty if not found)</li>
|
| 91 |
</ul>
|
| 92 |
<b>Examples:</b>
|
| 93 |
<ul>
|
| 94 |
-
<li><code>{"Authorization": "Bearer
|
| 95 |
-
<li><code>{"
|
| 96 |
</ul>
|
| 97 |
If a variable is not found, it is replaced with an empty string.
|
| 98 |
</small>
|
|
|
|
| 81 |
<label for="content" class="form-label">Content Template (JSON)</label>
|
| 82 |
<textarea class="form-control" id="content" name="content" rows="5" placeholder='{"key":"value", "attestation":{attestation_details}}'>{% if webhook and webhook.content %}{{ webhook.content }}{% else %}{"attestation":{attestation_details}}{% endif %}</textarea>
|
| 83 |
<small class="form-text text-muted">
|
| 84 |
+
<b>Templating:</b> Use variables in the form <code>--varname--</code> (two dashes, name, two dashes) anywhere in the URL, headers, or content.<br>
|
| 85 |
<b>Supported variables:</b>
|
| 86 |
<ul>
|
| 87 |
+
<li><code>product-key</code> (product key string), <code>product-version</code> (product version string)</li>
|
| 88 |
+
<li><code>attestation_raw</code> (raw file content, as bytes), <code>attestation_predicate</code> (decoded predicate), <code>attestation_predicate_base64</code> (base64-encoded predicate)</li>
|
| 89 |
<li>Any context field: <code>--contextkey--</code> (empty string if missing)</li>
|
| 90 |
<li>Labels: <code>--labels.labelname--</code> (gets value for label <code>labelname</code>, empty if not found)</li>
|
| 91 |
</ul>
|
| 92 |
<b>Examples:</b>
|
| 93 |
<ul>
|
| 94 |
+
<li><code>{"Authorization": "Bearer --secret--"}</code> → <code>{"Authorization": "Bearer ghpat-1232455"}</code></li>
|
| 95 |
+
<li><code>{"predicate": --attestation_predicate--}</code> → <code>{"predicate": { ... }}</code></li>
|
| 96 |
</ul>
|
| 97 |
If a variable is not found, it is replaced with an empty string.
|
| 98 |
</small>
|
templates/webhooks.html
CHANGED
|
@@ -180,20 +180,20 @@
|
|
| 180 |
<label for="webhookContent" class="form-label">Content Template (JSON)</label>
|
| 181 |
<textarea class="form-control" id="webhookContent" name="content" rows="5" placeholder='{"attestation":{attestation_details}}'></textarea>
|
| 182 |
<small class="form-text text-muted">
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
</small>
|
| 198 |
</div>
|
| 199 |
<div class="mb-3">
|
|
|
|
| 180 |
<label for="webhookContent" class="form-label">Content Template (JSON)</label>
|
| 181 |
<textarea class="form-control" id="webhookContent" name="content" rows="5" placeholder='{"attestation":{attestation_details}}'></textarea>
|
| 182 |
<small class="form-text text-muted">
|
| 183 |
+
<b>Templating:</b> Use variables in the form <code>--varname--</code> (two dashes, name, two dashes) anywhere in the URL, headers, or content.<br>
|
| 184 |
+
<b>Supported variables:</b>
|
| 185 |
+
<ul>
|
| 186 |
+
<li><code>product-key</code> (product key string), <code>product-version</code> (product version string)</li>
|
| 187 |
+
<li><code>attestation_raw</code> (raw file content, as bytes), <code>attestation_predicate</code> (decoded predicate), <code>attestation_predicate_base64</code> (base64-encoded predicate)</li>
|
| 188 |
+
<li>Any context field: <code>--contextkey--</code> (empty string if missing)</li>
|
| 189 |
+
<li>Labels: <code>--labels.labelname--</code> (gets value for label <code>labelname</code>, empty if not found)</li>
|
| 190 |
+
</ul>
|
| 191 |
+
<b>Examples:</b>
|
| 192 |
+
<ul>
|
| 193 |
+
<li><code>{"Authorization": "Bearer --secret--"}</code> → <code>{"Authorization": "Bearer ghpat-1232455"}</code></li>
|
| 194 |
+
<li><code>{"predicate": --attestation_predicate--}</code> → <code>{"predicate": { ... }}</code></li>
|
| 195 |
+
</ul>
|
| 196 |
+
If a variable is not found, it is replaced with an empty string.
|
| 197 |
</small>
|
| 198 |
</div>
|
| 199 |
<div class="mb-3">
|