dn-scribe commited on
Commit
65d1f4d
·
1 Parent(s): 24f5129

add templating doc in webhook form

Browse files
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> You can use variables in the form <code>"--varname--"</code> (double quote, two dashes, name, two dashes, double quote) anywhere in the URL, headers, or content.<br>
85
  <b>Supported variables:</b>
86
  <ul>
87
- <li><code>secret</code>, <code>product-key</code>, <code>product-version</code>, <code>attestation_details</code></li>
88
- <li><code>raw_attestation</code>, <code>attestation_json</code>, <code>attestation_predicate</code>, <code>attestation_predicate_b64</code> (loads attestation from storage only if used)</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>{"info": "--attestation_details--"}</code> → <code>{"info": {"id": 5, "context": {...}}}</code></li>
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
- <b>Templating:</b> You can use variables in the form <code>"--varname--"</code> (double quote, two dashes, name, two dashes, double quote) anywhere in the URL, headers, or content.<br>
184
- <b>Supported variables:</b>
185
- <ul>
186
- <li><code>secret</code>, <code>product-key</code>, <code>product-version</code>, <code>attestation_details</code></li>
187
- <li><code>raw_attestation</code>, <code>attestation_json</code>, <code>attestation_predicate</code>, <code>attestation_predicate_b64</code> (loads attestation from storage only if used)</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>{"info": "--attestation_details--"}</code> → <code>{"info": {"id": 5, "context": {...}}}</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">
 
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">