serve-ssh-certs/servecerts/templates/certificates/index.html

52 lines
2 KiB
HTML

{% extends 'base.html' %}
{% block header %}
<h1>{% block title %}
{% if g.user %}
Certificates for Pubkey <br>
{{ pubkey['key_name'] }}
{% else %}
Certificates
{% endif %}
{% endblock %}</h1>
{% if g.user %}
<a class="action" href="{{ url_for('pubkeys.certs_create', id=1 ) }}">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('pubkeys.cert_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('pubkeys.cert_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 %}