{% extends "base.html" %} {% block title %}API Keys · API Gateway{% endblock %} {% macro trash(label) %} {% endmacro %} {% macro pencil(label, modal) %} {% endmacro %} {% macro close_button() %} {% endmacro %} {% macro tree_node(node, granted) %} {% if node.children %}
{% for e in node.endpoints | sort(attribute='method') %} {% endfor %} {% for name, child in node.children | dictsort %} {{ tree_node(child, granted) }} {% endfor %}
{% else %} {% for e in node.endpoints | sort(attribute='method') %} {% endfor %} {% endif %} {% endmacro %} {% macro endpoint_picker(services, trees, synced, granted) %}
{% for s in services %}
{% for e in trees[s.id].endpoints | sort(attribute='method') %} {% endfor %} {% for name, child in trees[s.id].children | dictsort %} {{ tree_node(child, granted) }} {% endfor %} {% if not trees[s.id].children and not trees[s.id].endpoints %} No endpoints known for this service. {% endif %}
{% else %} Register a service first. {% endfor %}
{% endmacro %} {% block content %}

API Keys & Access

{% if new_key %}
New API key created — copy it now, it will not be shown again:
{{ new_key }}
{% endif %}
{% for k in keys %} {% else %} {% endfor %}
NameOwnerKeyAccessRate limitLast usedOn
{{ k.name }} {{ k.user.username }} {{ k.prefix }}… {% if k.endpoints %}{{ k.endpoints | length }} endpoint{{ '' if k.endpoints | length == 1 else 's' }} {% else %}none{% endif %} {{ k.rate_limit_per_minute if k.rate_limit_per_minute else '∞' }}/min {{ k.last_used_at.strftime("%Y-%m-%d %H:%M") if k.last_used_at else 'never' }}
{{ pencil('Edit access for ' ~ k.name, 'modal-key-' ~ k.id) }}
{{ trash('Delete key ' ~ k.name) }}
No API keys yet.
Endpoint catalogs are mirrored from each service's OpenAPI document (refreshed at most every 5 minutes; grants on removed endpoints are cleaned up). Refresh now

How consumers call the gateway

Send requests to /<service-slug>/<path> with the header X-API-Key: <key>. The request must match one of the service's endpoints and the key must hold a grant on it.

{% for k in keys %} {% endfor %} {% endblock %} {% block scripts %} {% endblock %}