{% extends 'users/base.html' %} {% from '_switch.html' import switch %} {% from 'api/_messages.html' import get_enable_persistent_msg, get_disable_persistent_msg %} {% block user_content %}
{%- trans %}API Key{% endtrans -%}
{% if key and can_modify %}
{% endif %}
{% if not key %}

{%- trans -%} You do not have an API key at the moment. If you would like to use our API, please create an API key using the button below. {%- endtrans -%}

{% else %}
{% trans %}Token{% endtrans %}
{{ key.token }} {% if key.is_blocked %} {% endif %}
{% if use_signatures %}
{% trans %}Secret{% endtrans %}
{{ key.secret }}
{% endif %}
{% trans %}Created{% endtrans %}
{{ key.created_dt | format_datetime('short') }}
{% trans %}Total uses{% endtrans %}
{{ key.use_count }}
{% if key.last_used_dt %}
{% trans %}Last used{% endtrans %}
{{ key.last_used_dt | format_datetime('short') }}
{% endif %} {% if key.last_used_ip %}
{% trans %}Last IP{% endtrans %}
{{ key.last_used_ip }}
{% endif %} {% if key.last_used_uri %}
{% trans %}Last request{% endtrans %}
{{ key.last_used_uri }} {% if key.last_used_auth %} {% else %} {% endif %}
{% endif %} {% if allow_persistent and use_signatures %}
{% trans %}Persistent signatures{% endtrans %}
{{ switch(id='toggle-persistent-signatures', checked=key.is_persistent_allowed, on_label=_('On'), off_label=_('Off'), disabled=not can_modify, data_href=url_for('.key_toggle_persistent'), data_confirm_enable=get_enable_persistent_msg(), data_confirm_disable=get_disable_persistent_msg()) }}
{% endif %}
{% endif %}
{%- trans %}Token-based links{% endtrans -%}
{% trans %} Token-based unique links are secret URLs which Indico uses to allow you to easily fetch data from within other applications (e.g. calendar schedulers through iCalendar). They are generated through a digital signature based on a secret key that is unique per Indico user. If one of your links is compromised, you should click this button. All other links will be invalidated. {% endtrans %}
{% if session.user.is_admin and (key or old_keys) %}
{%- trans %}Administration{% endtrans -%}
{% if key %}
{% if key.is_blocked %} {% else %} {% endif %}
{% endif %}

{% trans %}This is the list of old keys associated with this user.{% endtrans %}

{% if old_keys %}
    {% for old_key in old_keys -%}
  • {{ old_key.token }} {%- if not old_key.use_count -%} {%- trans %}never used{% endtrans -%} {%- else -%} {%- trans n = old_key.use_count -%} used once {%- pluralize -%} used {{ n }} times {%- endtrans -%} {%- if old_key.last_used_dt -%} , {% trans date=old_key.last_used_dt|format_datetime('short')|ensure_unicode -%} last used on {{ date }} {%- endtrans %} {%- endif -%} {%- endif -%}
  • {% endfor %}
{% else %}

{% trans %}There are no old keys.{% endtrans %}

{% endif %}
{% endif %}
{% endblock %}