Commit 0e829a3c authored by Alexander Pace's avatar Alexander Pace
Browse files

changes for 2.11.0

parent 0db534db
Pipeline #175813 failed with stages
in 16 minutes and 33 seconds
......@@ -30,7 +30,7 @@ INFO_BANNER_ENABLED = False
INFO_BANNER_MESSAGE = "TEST MESSAGE"
# Version ---------------------------------------------------------------------
PROJECT_VERSION = '2.10.0-2'
PROJECT_VERSION = '2.11.0'
# Unauthenticated access ------------------------------------------------------
# This variable should eventually control whether unauthenticated access is
......
# Generated by Django 2.2.10 on 2020-12-03 18:28
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('ligoauth', '0069_setup_asimov'),
]
operations = [
migrations.AlterField(
model_name='authorizedldapmember',
name='ldap_gname',
field=models.CharField(max_length=100, null=True, unique=True),
),
migrations.CreateModel(
name='GenericLdapUser',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('ldap_dn', models.CharField(max_length=255, unique=True)),
('ldap_member', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ligoauth.AuthorizedLdapMember')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.AddField(
model_name='x509cert',
name='ldap_user',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='ligoauth.GenericLdapUser'),
),
]
......@@ -15,12 +15,6 @@ class LigoLdapUser(User):
# print(user.name()) gives an idiotic ascii coding error otherwise. WHY!?
return u"{0} {1}".format(self.first_name, self.last_name).encode('utf-8')
class X509Cert(models.Model):
"""Model for storing X.509 certificate subjects for API access"""
subject = models.CharField(max_length=255, unique=True, null=False)
user = models.ForeignKey(User, on_delete=models.CASCADE)
class AuthGroup(Group):
"""Enhanced version of Django Group model"""
# Description of the group
......@@ -44,7 +38,7 @@ class AuthorizedLdapMember(models.Model):
"""Model for authorized ldap membership"""
# Group membership in ldap. This is analogous to the `ldap_name` in the
# AuthGroup class:
ldap_gname = models.CharField(max_length=50, unique=True, null=True)
ldap_gname = models.CharField(max_length=100, unique=True, null=True)
# Add support for authorized membership:
ldap_authgroup = models.ForeignKey(AuthGroup, null=True, on_delete=models.CASCADE)
......@@ -52,3 +46,28 @@ class AuthorizedLdapMember(models.Model):
# Give it a name:
name = models.CharField(max_length=50, unique=True, null=True)
def __str__(self):
return self.name
# Set up a model for a generic ldap user. This arose out when kagra's ldap was added
# and there were multiple users across the ligo and kagra ldap. In practice, i don't
# know how many users like that there will actually be in practice, but this is a safeguard
# from having certs overwritten each time the ldap is polled. Also, modify the X509Cert
# object to use this as a foreign key as well.
class GenericLdapUser(models.Model):
ldap_dn = models.CharField(max_length=255, null=False, unique=True)
#ldap_source = models.CharField(max_length=100, null=False) # 'ligo', 'kagra', 'etc'
# scratch this, change it to AUthorizedldapMembership
ldap_member = models.ForeignKey(AuthorizedLdapMember, null=False, on_delete=models.CASCADE)
user = models.ForeignKey(User, on_delete=models.CASCADE)
def __str__(self):
return "{}- {}".format(self.ldap_member.name,self.user.username)
class X509Cert(models.Model):
"""Model for storing X.509 certificate subjects for API access"""
subject = models.CharField(max_length=255, unique=True, null=False)
user = models.ForeignKey(User, on_delete=models.CASCADE)
ldap_user = models.ForeignKey(GenericLdapUser, null=True, on_delete=models.CASCADE)
......@@ -22,7 +22,7 @@
{% block content %}
<div class='row'>
<div class='col-md-2'>
<div class="sticky-top" style="top: 85px;">
<div class="sticky-top" style="top: 75px;">
<nav id="toc" data-toggle="toc"></nav>
</div>
</div>
......@@ -30,7 +30,7 @@
{% if object.offline %}
<div style="text-align: center;">
<h3 style="font-weight: 300; color: red; font-size:xx-large">OFFLINE EVENT</h3>
<div style="font-weight: 300; color: red; font-size:xx-large">OFFLINE EVENT</div>
</div>
<br>
{% endif %}
......
{% load static %}
<div class="fixed-top" style="margin-top: -80px; padding-top: 80px;">
<div class="fixed-top" style="margin-top: -75px; padding-top: 75px; box-shadow: 0 0 0.2rem rgba(0,0,0,.1), 0 0.2rem 0.4rem rgba(0,0,0,.2);">
<nav class="navbar navbar-expand-md navbar-gracedb navbar-dark">
<a class="navbar-brand text-white" href="/">
<img src="{% static "images/logo.svg" %}" style="width:40px;">
<img src="{% static "images/logo.svg" %}" style="width:30px;">
GraceDB
{% if config_name %}
<span class="text-danger">({{ config_name }})</span>
......
......@@ -45,7 +45,7 @@
{% block content %}
<div class='row'>
<div class='col-md-2'>
<div class="sticky-top" style="top: 85px;">
<div class="sticky-top" style="top: 75px;">
<nav id="toc" data-toggle="toc"></nav>
</div>
</div>
......
ConcurrentLogHandler==0.9.1
Django==2.2.10
Django==2.2.17
django-debug-toolbar==1.9.1
django-extensions==2.2.9
django-guardian==2.2.0
django-model-utils==4.0.0
django-ses==0.8.10
django-silk==3.0.1
django-twilio==0.9.0
django-ses==1.0.3
django-silk==4.1.0
django-twilio==0.13.0
django-user-sessions==1.7.1
djangorestframework==3.9.0
djangorestframework-guardian==0.1.1
djangorestframework==3.12.2
djangorestframework-guardian==0.3.0
dnspython==1.15.0
flake8==3.5.0
gunicorn[gthread]==19.9.0
......@@ -24,12 +24,12 @@ git+https://git.ligo.org/lscsoft/lvalert-overseer.git@python3-overseer#egg=ligo-
#ligo-lvalert-overseer==0.1.3
lscsoft-glue==2.0.0
lxml==4.2.0
matplotlib==2.0.0
matplotlib==3.3.3
mock==2.0.0
mysqlclient==1.4.2
numpy==1.17.2
mysqlclient==2.0.1
numpy==1.19.4
packaging==17.1
phonenumbers==8.8.11
phonenumbers==8.10.22
python-ldap==3.1.0
python-memcached==1.59
scipy==1.2.1
......@@ -45,17 +45,14 @@ voevent-parse==1.0.3
# problematic API changes in 2.3.1 and beyond that will need to be handled
# appropriately.
pyparsing==2.3.0
pytest<5; python_version < '3'
pytest==5.1.2; python_version >= '3'
pytest==5.4.0; python_version >= '3'
pytest-cov==2.6.1
pytest-django==3.9.0
pytest-django==4.1.0
pytz==2018.9
# Fixed at old versions to prevent bugs:
# https://github.com/fritzy/SleekXMPP/issues/477
# https://github.com/etingof/pyasn1/issues/112
pyasn1==0.3.6
pyasn1==0.3.7
pyasn1-modules==0.1.5
# Installing futures for gunicorn gthreads (Python 2 only):
futures==3.2.0; python_version < '3'
# retry bandaid for efs errors:
retry==0.9.2
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment