8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-28 01:43:46 +00:00

Precision, clef ssh pub et pas hash stocké

This commit is contained in:
chirac 2018-06-24 13:04:27 +02:00 committed by Maël Kervella
parent 7ccc93cf4c
commit 352a416647
2 changed files with 42 additions and 4 deletions

View 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),
),
]

View file

@ -201,14 +201,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