From 37a1bd87f9eb4c21fb9155e5a1f8799034ee1137 Mon Sep 17 00:00:00 2001 From: chirac Date: Sun, 24 Jun 2018 13:04:27 +0200 Subject: [PATCH] =?UTF-8?q?Precision,=20clef=20ssh=20pub=20et=20pas=20hash?= =?UTF-8?q?=20stock=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0086_auto_20180624_1254.py | 30 +++++++++++++++++++ machines/models.py | 16 +++++++--- .../machines/aff_sshfingerprint.html | 2 +- 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 machines/migrations/0086_auto_20180624_1254.py diff --git a/machines/migrations/0086_auto_20180624_1254.py b/machines/migrations/0086_auto_20180624_1254.py new file mode 100644 index 00000000..7474ac8b --- /dev/null +++ b/machines/migrations/0086_auto_20180624_1254.py @@ -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), + ), + ] diff --git a/machines/models.py b/machines/models.py index 5b564852..9872bbb3 100644 --- a/machines/models.py +++ b/machines/models.py @@ -205,14 +205,22 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): return str(self.user) + ' - ' + str(self.id) + ' - ' + str(self.name) 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) - hash_entry = models.TextField(max_length=512) - algo = models.ForeignKey('SshFprAlgo', on_delete=models.PROTECT) + pub_key_entry = models.TextField( + help_text="Clef publique ssh", + max_length=2048 + ) + algo = models.ForeignKey( + 'SshFprAlgo', + on_delete=models.PROTECT + ) comment = models.CharField( + help_text="Commentaire", max_length=255, null=True, blank=True diff --git a/machines/templates/machines/aff_sshfingerprint.html b/machines/templates/machines/aff_sshfingerprint.html index 33e7d7ad..d3ecfb64 100644 --- a/machines/templates/machines/aff_sshfingerprint.html +++ b/machines/templates/machines/aff_sshfingerprint.html @@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% for sshfpr in sshfingerprint_list %} - {{ sshfpr.hash_entry }} + {{ sshfpr.pub_key_entry }} {{ sshfpr.algo }} {{ sshfpr.comment }}