mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-18 13:39:57 -04:00
When we show an identifier, like an ID or a key, we have a pattern which adds a ‘copy to clipboard’ button. We weren’t using this pattern for service ID. This commit also moves it under the table, so hopefully people will be less likely to confuse the service ID for an API key when scanning down the page.
54 lines
1.5 KiB
HTML
54 lines
1.5 KiB
HTML
{% extends "withnav_template.html" %}
|
||
{% from "components/table.html" import list_table, field, hidden_field_heading %}
|
||
{% from "components/api-key.html" import api_key %}
|
||
|
||
{% block page_title %}
|
||
API keys – GOV.UK Notify
|
||
{% endblock %}
|
||
|
||
{% block maincolumn_content %}
|
||
|
||
<h1 class="heading-large">
|
||
API keys
|
||
</h1>
|
||
|
||
<p>
|
||
To connect to the API you will need to create an API Key. Each service can have multiple API Keys to allow
|
||
for test and live environments.
|
||
</p>
|
||
|
||
<p>
|
||
API usage is described in
|
||
<a href="{{ url_for('.documentation', service_id=current_service.id) }}">the
|
||
developer documentation</a>.
|
||
</p>
|
||
|
||
{% call(item, row_number) 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|format_datetime }}
|
||
{% endcall %}
|
||
{% else %}
|
||
{% call field(align='right', status='error') %}
|
||
<a href='{{ url_for('.revoke_api_key', service_id=current_service.id, key_id=item.id) }}'>Revoke</a>
|
||
{% endcall %}
|
||
{% endif %}
|
||
{% endcall %}
|
||
|
||
<p class='table-show-more-link'>
|
||
<a href="{{ url_for('.create_api_key', service_id=current_service.id) }}">Create a new API key</a>
|
||
</p>
|
||
|
||
{{ api_key(current_service.id, "Service ID", thing="service ID") }}
|
||
|
||
{% endblock %}
|