mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 19:03:30 -05:00
Implementation of create, revoke and show api keys for service. These calls work, however we still need to fix the tests.
59 lines
1.5 KiB
HTML
59 lines
1.5 KiB
HTML
{% extends "withnav_template.html" %}
|
||
{% from "components/table.html" import list_table, field, hidden_field_heading %}
|
||
|
||
{% block page_title %}
|
||
GOV.UK Notify | API keys and documentation
|
||
{% endblock %}
|
||
|
||
{% block maincolumn_content %}
|
||
|
||
<h1 class="heading-xlarge">
|
||
API keys
|
||
</h1>
|
||
|
||
<p>
|
||
To connect to the API you will need to send your service ID, encrypted with
|
||
an API key. The API key stays secret.
|
||
</p>
|
||
|
||
<p>
|
||
There are client libraries for several languages which manage this for
|
||
you. See
|
||
<a href="{{ url_for(".documentation", service_id=service_id) }}">the
|
||
developer documentation</a> for more information.
|
||
</p>
|
||
|
||
<h2 class="api-key-name">
|
||
Service ID
|
||
</h2>
|
||
<p class="api-key-key">
|
||
{{ service_id }}
|
||
</p>
|
||
|
||
{% call(item) list_table(
|
||
keys,
|
||
empty_message="You haven’t created any API keys yet",
|
||
caption="API keys",
|
||
caption_visible=False,
|
||
field_headings=['Key name', hidden_field_heading('Action')]
|
||
) %}
|
||
{% call field() %}
|
||
{{ item.name }}
|
||
{% endcall %}
|
||
{% if item.expiry_date %}
|
||
{% call field(align='right', status='default') %}
|
||
Revoked {{ item.expiry_date }}
|
||
{% endcall %}
|
||
{% else %}
|
||
{% call field(align='right', status='error') %}
|
||
<a href='{{ url_for('.revoke_api_key', service_id=service_id, key_id=item.id) }}'>Revoke</a>
|
||
{% endcall %}
|
||
{% endif %}
|
||
{% endcall %}
|
||
|
||
<p>
|
||
<a href="{{ url_for('.create_api_key', service_id=service_id) }}">Create a new API key</a>
|
||
</p>
|
||
|
||
{% endblock %}
|