From 57d9ddc2c6b46ed2fad25bc8ce0decf2fe9e56ac Mon Sep 17 00:00:00 2001 From: Ben Cole Date: Fri, 22 May 2020 14:04:35 +0100 Subject: [PATCH] Add certhash field to Mumble user --- .../migrations/0010_mumbleuser_certhash.py | 18 ++++++++++++++++++ allianceauth/services/modules/mumble/models.py | 11 +++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 allianceauth/services/modules/mumble/migrations/0010_mumbleuser_certhash.py diff --git a/allianceauth/services/modules/mumble/migrations/0010_mumbleuser_certhash.py b/allianceauth/services/modules/mumble/migrations/0010_mumbleuser_certhash.py new file mode 100644 index 00000000..00237748 --- /dev/null +++ b/allianceauth/services/modules/mumble/migrations/0010_mumbleuser_certhash.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.11 on 2020-05-22 13:02 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('mumble', '0009_set_mumble_dissplay_names'), + ] + + operations = [ + migrations.AddField( + model_name='mumbleuser', + name='certhash', + field=models.CharField(blank=True, editable=False, help_text='Hash of Mumble client certificate as presented when user authenticates', max_length=254, null=True, verbose_name='Certificate Hash'), + ), + ] diff --git a/allianceauth/services/modules/mumble/models.py b/allianceauth/services/modules/mumble/models.py index db9757dd..4f00f6c8 100644 --- a/allianceauth/services/modules/mumble/models.py +++ b/allianceauth/services/modules/mumble/models.py @@ -66,11 +66,18 @@ class MumbleUser(AbstractServiceModel): pwhash = models.CharField(max_length=80) hashfn = models.CharField(max_length=20, default='sha1') groups = models.TextField(blank=True, null=True) + certhash = models.CharField( + verbose_name="Certificate Hash", + max_length=254, + blank=True, + null=True, + editable=False, + help_text="Hash of Mumble client certificate as presented when user authenticates" + ) + display_name = models.CharField(max_length=254, unique=True) objects = MumbleManager() - display_name = models.CharField(max_length=254, unique=True) - def __str__(self): return self.username