mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-05 01:16:27 +00:00
Precision, clef ssh pub et pas hash stocké
This commit is contained in:
parent
ab4b55874c
commit
37a1bd87f9
3 changed files with 43 additions and 5 deletions
30
machines/migrations/0086_auto_20180624_1254.py
Normal file
30
machines/migrations/0086_auto_20180624_1254.py
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.10.7 on 2018-06-24 10:54
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('machines', '0085_auto_20180623_1817'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='sshfingerprint',
|
||||||
|
old_name='hash_entry',
|
||||||
|
new_name='pub_key_entry',
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='sshfingerprint',
|
||||||
|
name='comment',
|
||||||
|
field=models.CharField(blank=True, help_text='Commentaire', max_length=255, null=True),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='sshfingerprint',
|
||||||
|
name='pub_key_entry',
|
||||||
|
field=models.TextField(help_text='Clef publique ssh', max_length=2048),
|
||||||
|
),
|
||||||
|
]
|
|
@ -205,14 +205,22 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model):
|
||||||
return str(self.user) + ' - ' + str(self.id) + ' - ' + str(self.name)
|
return str(self.user) + ' - ' + str(self.id) + ' - ' + str(self.name)
|
||||||
|
|
||||||
class SshFingerprint(RevMixin, AclMixin, models.Model):
|
class SshFingerprint(RevMixin, AclMixin, models.Model):
|
||||||
"""Hash de la clef ssh d'une machine"""
|
"""Stockage de la clef ssh publique d'une machine
|
||||||
|
et calcul de ses hash"""
|
||||||
|
|
||||||
PRETTY_NAME = "Fingerprint ssh"
|
PRETTY_NAME = "Clef publique ssh"
|
||||||
|
|
||||||
machine = models.ForeignKey('Machine', on_delete=models.CASCADE)
|
machine = models.ForeignKey('Machine', on_delete=models.CASCADE)
|
||||||
hash_entry = models.TextField(max_length=512)
|
pub_key_entry = models.TextField(
|
||||||
algo = models.ForeignKey('SshFprAlgo', on_delete=models.PROTECT)
|
help_text="Clef publique ssh",
|
||||||
|
max_length=2048
|
||||||
|
)
|
||||||
|
algo = models.ForeignKey(
|
||||||
|
'SshFprAlgo',
|
||||||
|
on_delete=models.PROTECT
|
||||||
|
)
|
||||||
comment = models.CharField(
|
comment = models.CharField(
|
||||||
|
help_text="Commentaire",
|
||||||
max_length=255,
|
max_length=255,
|
||||||
null=True,
|
null=True,
|
||||||
blank=True
|
blank=True
|
||||||
|
|
|
@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
</thead>
|
</thead>
|
||||||
{% for sshfpr in sshfingerprint_list %}
|
{% for sshfpr in sshfingerprint_list %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ sshfpr.hash_entry }}</td>
|
<td>{{ sshfpr.pub_key_entry }}</td>
|
||||||
<td>{{ sshfpr.algo }}</td>
|
<td>{{ sshfpr.algo }}</td>
|
||||||
<td>{{ sshfpr.comment }}</td>
|
<td>{{ sshfpr.comment }}</td>
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
|
|
Loading…
Reference in a new issue