mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-07 15:58:25 -04:00
Add pages for create/view/revoke API keys
Copying what they’ve done on GOV.UK Pay, we should let users: - generate as many keys as they want - only see the key at time of creation - give keys a name - revoke any key at any time (this should be a one way operation) And based on discussions with @minglis and @servingUpAces, the keys should be used in conjunction with some kind of service ID, which gets encrypted with the key. In other words the secret itself never gets sent over the wire. This commit adds the UI (but not the underlying API integration) for doing the above.
This commit is contained in:
committed by
Rebecca Law
parent
5924500f3e
commit
9784a9936c
24
app/templates/views/api-keys/create.html
Normal file
24
app/templates/views/api-keys/create.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/textbox.html" import textbox %}
|
||||
|
||||
{% block page_title %}
|
||||
GOV.UK Notify | API keys and documentation
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<h1 class="heading-xlarge">
|
||||
Add a new API key
|
||||
</h1>
|
||||
|
||||
<form method="post">
|
||||
{{ textbox(key_name, hint='eg CRM application') }}
|
||||
{{ page_footer(
|
||||
'Continue',
|
||||
back_link=url_for('.api_keys', service_id=service_id),
|
||||
back_link_text='Back to API keys'
|
||||
) }}
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
37
app/templates/views/api-keys/revoke.html
Normal file
37
app/templates/views/api-keys/revoke.html
Normal file
@@ -0,0 +1,37 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/api-key.html" import api_key %}
|
||||
|
||||
{% block page_title %}
|
||||
GOV.UK Notify | API keys and documentation
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-two-thirds">
|
||||
|
||||
<h1 class="heading-xlarge">
|
||||
Revoke API key
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
‘Test key 1’ will no longer let you connect to GOV.UK Notify.
|
||||
</p>
|
||||
<p>
|
||||
You can’t undo this.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form method="post">
|
||||
{{ page_footer(
|
||||
'Revoke this API key',
|
||||
back_link=url_for('.api_keys', service_id=service_id),
|
||||
back_link_text='Back to API keys',
|
||||
destructive=True
|
||||
) }}
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
33
app/templates/views/api-keys/show.html
Normal file
33
app/templates/views/api-keys/show.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/api-key.html" import api_key %}
|
||||
|
||||
{% block page_title %}
|
||||
GOV.UK Notify | API keys and documentation
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-two-thirds">
|
||||
|
||||
<h1 class="heading-xlarge">
|
||||
New API key
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
Copy your key to somewhere safe. You won’t be able to see it again
|
||||
once you leave this page.
|
||||
</p>
|
||||
|
||||
{{ api_key('d30512af92e1386d63b90e5973b49a10', 'CRM application') }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ page_footer(
|
||||
back_link=url_for('.api_keys', service_id=service_id),
|
||||
back_link_text='Back to API keys'
|
||||
) }}
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user