Created api_key_api_client.

Implementation of create, revoke and show api keys for service.
These calls work, however we still need to fix the tests.
This commit is contained in:
Rebecca Law
2016-01-20 17:32:55 +00:00
parent 9784a9936c
commit 41c775cd68
6 changed files with 42 additions and 18 deletions

View File

@@ -35,21 +35,18 @@
empty_message="You havent created any API keys yet",
caption="API keys",
caption_visible=False,
field_headings=['Key name', 'Created at', hidden_field_heading('Action')]
field_headings=['Key name', hidden_field_heading('Action')]
) %}
{% call field() %}
{{ item.name }}
{% endcall %}
{% call field() %}
{{ item.last_used }}
{% endcall %}
{% if item.revoked %}
{% if item.expiry_date %}
{% call field(align='right', status='default') %}
Revoked {{ item.revoked }}
Revoked {{ item.expiry_date }}
{% endcall %}
{% else %}
{% call field(align='right', status='error') %}
<a href='{{ url_for('.revoke_api_key', service_id=123, key_id=item.id) }}'>Revoke</a>
<a href='{{ url_for('.revoke_api_key', service_id=service_id, key_id=item.id) }}'>Revoke</a>
{% endcall %}
{% endif %}
{% endcall %}

View File

@@ -20,7 +20,7 @@
once you leave this page.
</p>
{{ api_key('d30512af92e1386d63b90e5973b49a10', 'CRM application') }}
{{ api_key(secret, key_name) }}
</div>
</div>