A web app lists pending requests with full detail, leases and the audit log grouped by request, and sends Web Push notifications that can answer requests. Approvers sign in through an OpenID Connect provider; policy can require a fresh passkey (`confirm = "passkey"`) to approve, which only the web app can then give. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
56 lines
2.6 KiB
HTML
56 lines
2.6 KiB
HTML
{# A padlock, marking what needs a passkey #}
|
|
{% macro lock() -%}
|
|
<svg class="lock" viewBox="0 0 16 16" aria-hidden="true"><path d="M4 7V5a4 4 0 0 1 8 0v2h1v8H3V7zm2 0h4V5a2 2 0 0 0-4 0z"/></svg>
|
|
{%- endmacro %}
|
|
|
|
{% macro card(entry, csrf, open) %}
|
|
<article class="request{% if entry.passkey %} needs-passkey{% endif %}" id="r-{{ entry.id }}">
|
|
<h2><a href="/requests/{{ entry.id }}">{{ entry.summary }}</a></h2>
|
|
<p class="meta">{{ entry.requester }} · {{ entry.op }} · <span class="expires" data-left="{{ entry.expires_in }}">expires in {{ self::left(entry.expires_in) }}</span>
|
|
{%- if entry.passkey %} <span class="badge passkey">{% call lock() %}{% endcall %}Needs passkey</span>{% endif %}
|
|
{%- if entry.sensitive %} <span class="badge warn">Sensitive</span>{% endif %}</p>
|
|
{% if let Some(label) = entry.label %}
|
|
<p class="label">Label (agent-supplied): {{ label }}</p>
|
|
{% endif %}
|
|
{% let lines = entry.detail.lines().count() %}
|
|
{% if lines > 0 %}
|
|
<details{% if open %} open{% endif %}><summary>Details ({{ lines }} line{% if lines != 1 %}s{% endif %})</summary><pre>{{ entry.detail }}</pre></details>
|
|
{% endif %}
|
|
<form method="post" action="/requests/{{ entry.id }}" class="answers">
|
|
<input type="hidden" name="csrf" value="{{ csrf }}">
|
|
{% for decision in entry.offers %}
|
|
{% let deny = self::is_deny(decision) %}
|
|
<button type="submit" name="decision" value="{{ decision.name() }}" class="{% if deny %}deny{% else %}approve{% endif %}">
|
|
{%- if entry.passkey && !deny %}{% call lock() %}{% endcall %}{% endif %}{{ self::answer(decision) }}</button>
|
|
{% endfor %}
|
|
</form>
|
|
{% if entry.passkey %}
|
|
<p class="note">Policy wants a fresh passkey for this one: approving sends you to sign in again. Denying doesn't.</p>
|
|
{% endif %}
|
|
</article>
|
|
{% endmacro %}
|
|
|
|
{% macro time(rfc3339) -%}
|
|
<time datetime="{{ rfc3339 }}">{{ rfc3339.replace('T', " ").trim_end_matches('Z') }} UTC</time>
|
|
{%- endmacro %}
|
|
|
|
{% macro outcome(outcome) -%}
|
|
<span class="outcome {{ outcome.tone() }}">{{ outcome.name() }}</span>
|
|
{%- endmacro %}
|
|
|
|
{% macro timeline(records) %}
|
|
<ol class="timeline">
|
|
{% for record in records %}
|
|
{% let (text, detail) = self::describe(record) %}
|
|
<li>{% call time(record.time) %}{% endcall %} <span>{{ text }}</span>
|
|
{%- if let Some(detail) = detail %}<details><summary>Details</summary><pre>{{ detail }}</pre></details>{% endif %}</li>
|
|
{% endfor %}
|
|
</ol>
|
|
{% endmacro %}
|
|
|
|
{% macro select(name, label, chosen, options) -%}
|
|
<label>{{ label }} <select name="{{ name }}"><option value="">Any</option>
|
|
{%- for (value, text) in options %}<option value="{{ value }}"{% if value.as_str() == chosen.as_str() %} selected{% endif %}>{{ text }}</option>{% endfor -%}
|
|
</select></label>
|
|
{%- endmacro %}
|