51 lines
2 KiB
HTML
51 lines
2 KiB
HTML
|
{% extends 'base.html' %}
|
||
|
|
||
|
{% block header %}
|
||
|
<h1>{% block title %}
|
||
|
{% if g.user %}
|
||
|
Certificates for Pubkey {{ g.pubkeys['fullname'] }}
|
||
|
{% else %}
|
||
|
Certificates
|
||
|
{% endif %}
|
||
|
{% endblock %}</h1>
|
||
|
{% if g.user %}
|
||
|
<a class="action" href="{{ url_for('certificates.create') }}">New</a>
|
||
|
{% endif %}
|
||
|
{% endblock %}
|
||
|
|
||
|
{% block content %}
|
||
|
{% if g.user %}
|
||
|
{% for certificate in certificates %}
|
||
|
<article class="post">
|
||
|
<header>
|
||
|
<div>
|
||
|
<h1>Certificate ({{ certificate['id'] }}): {{ certificate['key_id'] }} </h1>
|
||
|
</div>
|
||
|
{% if g.user['id'] == pubkey['user_id'] %}
|
||
|
<a class="action" href="{{ url_for('certificates.revoke', id=certificate['id']) }}">Revoke</a>
|
||
|
{% endif %}
|
||
|
</header>
|
||
|
<p class="body{% if pubkey['revoked'] != 0 %} revoked {% endif %}">
|
||
|
Serialnumber: {{ certificate['serial'] }}{% if pubkey['revoked'] != 0 %} - revoked {% endif %}"
|
||
|
Validity duration: {{ certificate['valid_from'].strftime('%Y-%m-%d %H:%M') }} - {{ certificate['valid_until'].strftime('%Y-%m-%d %H:%M') }}
|
||
|
Principals: {{ certificate['principals'] }}
|
||
|
Valid Client IP: {{ certificate['from_ip'] }}
|
||
|
Allowed Command: {{ certificate['commands'] }}
|
||
|
Capabilities: {{ certificate['capabilities'] }}
|
||
|
</p>
|
||
|
<p class="about">created on {{ certificate['created'].strftime('%Y-%m-%d') }}</p>
|
||
|
</form>
|
||
|
<form action="{{ url_for('certificates.revoke', id=certificate['id']) }}" method="POST">
|
||
|
<input class="danger" type="submit" value="Revoke" onclick="return confirm('Are you sure?');">
|
||
|
</form>
|
||
|
</article>
|
||
|
{% if not loop.last %}
|
||
|
<hr>
|
||
|
{% endif %}
|
||
|
{% endfor %}
|
||
|
{% else %}
|
||
|
<div class="danger">To view pubkeys and certificates, please log in</div>
|
||
|
{% endif %}
|
||
|
{% endblock %}
|
||
|
|