Commit 7616a939 authored by Stefano Alberto Russo's avatar Stefano Alberto Russo
Browse files

Merge branch 'feature/user_auth_tracking' into develop

parents d1280df4 a60feec6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ class RosettaOIDCAuthenticationBackend(OIDCAuthenticationBackend):
        user = super(RosettaOIDCAuthenticationBackend, self).create_user(claims)

        # Add profile, keys etc.
        finalize_user_creation(user)
        finalize_user_creation(user, auth='oidc')

        return user

+7 −1
Original line number Diff line number Diff line
@@ -9,6 +9,12 @@ def export_vars(request):
    else:
        data['OPENID_ENABLED'] = False

    # Set local auth enabled or not
    if settings.DISABLE_LOCAL_AUTH:
        data['LOCAL_AUTH_ENABLED'] = False
    else:
        data['LOCAL_AUTH_ENABLED'] = True

    # Set invitation code required or not
    if settings.INVITATION_CODE:
        data['INVITATION_CODE_ENABLED'] = True
+3 −3
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ class Command(BaseCommand):
            testuser.is_superuser=True
            testuser.save() 
            print('Creating testuser profile')
            Profile.objects.create(user=testuser, authtoken='129aac94-284a-4476-953c-ffa4349b4a50')
            Profile.objects.create(user=testuser, auth='local', authtoken='129aac94-284a-4476-953c-ffa4349b4a50')

            # Create default keys
            print('Creating testuser default keys')
@@ -82,8 +82,8 @@ class Command(BaseCommand):
                <br/><br/>
                A test user with admin rights registered with email <code>testuser@rosetta.platform</code> and password 
                <code>testpass</code> has been created as well, which you can use to login on the menu on the right and give Rosetta
                immediately a try. If you run with the default docker-compose file (i.e. you just run <code>rosetta/setup</code>),
                then you will also have a few demo computing and storage resources (beside the internal engine) already available
                immediately a try. If you are using the default docker-compose file (i.e. you just ran <code>rosetta/setup</code>),
                then you will also have a few demo computing and storage resources (beside the internal one) already available
                and that you can play with, including a small Slurm cluster. Otherwise, you will need to setup your own ones
                from the <a href="/admin">admin</a> section.
                <br />
+19 −0
Original line number Diff line number Diff line
# Generated by Django 2.2.1 on 2021-11-15 17:51

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('core_app', '0019_auto_20211115_1547'),
    ]

    operations = [
        migrations.AddField(
            model_name='profile',
            name='auth',
            field=models.CharField(default='oidc', max_length=36, verbose_name='User auth mode'),
            preserve_default=False,
        ),
    ]
+2 −1
Original line number Diff line number Diff line
@@ -43,8 +43,9 @@ class Profile(models.Model):

    uuid      = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    user      = models.OneToOneField(User, on_delete=models.CASCADE)
    auth      = models.CharField('User auth mode', max_length=36)
    timezone  = models.CharField('User Timezone', max_length=36, default='UTC')
    authtoken = models.CharField('User auth token', max_length=36, blank=True, null=True)
    authtoken = models.CharField('User auth token', max_length=36, blank=True, null=True) # This is used for testing, not a login token.
    is_power_user = models.BooleanField('Power user status', default=False)
    extra_confs   = JSONField(blank=True, null=True)

Loading