-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #549 from intuitem/feat/samlv2
Feat/samlv2
- Loading branch information
Showing
75 changed files
with
2,108 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -274,6 +274,7 @@ class Meta: | |
"is_active", | ||
"date_joined", | ||
"user_groups", | ||
"is_sso", | ||
] | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import os | ||
from django.apps import AppConfig | ||
from django.db.models.signals import post_migrate | ||
|
||
|
||
class SettingsConfig(AppConfig): | ||
default_auto_field = "django.db.models.BigAutoField" | ||
name = "global_settings" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Generated by Django 5.0.6 on 2024-06-20 16:48 | ||
|
||
import django.db.models.deletion | ||
import iam.models | ||
import uuid | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
initial = True | ||
|
||
dependencies = [ | ||
("iam", "0003_alter_folder_updated_at_alter_role_updated_at_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="GlobalSettings", | ||
fields=[ | ||
( | ||
"id", | ||
models.UUIDField( | ||
default=uuid.uuid4, | ||
editable=False, | ||
primary_key=True, | ||
serialize=False, | ||
), | ||
), | ||
( | ||
"created_at", | ||
models.DateTimeField(auto_now_add=True, verbose_name="Created at"), | ||
), | ||
( | ||
"updated_at", | ||
models.DateTimeField(auto_now=True, verbose_name="Updated at"), | ||
), | ||
( | ||
"is_published", | ||
models.BooleanField(default=False, verbose_name="published"), | ||
), | ||
( | ||
"name", | ||
models.CharField( | ||
choices=[("general", "General"), ("sso", "SSO")], | ||
default="general", | ||
max_length=30, | ||
unique=True, | ||
), | ||
), | ||
("value", models.JSONField(default=dict)), | ||
( | ||
"folder", | ||
models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from django.db import models | ||
|
||
from iam.models import FolderMixin | ||
from core.base_models import AbstractBaseModel | ||
|
||
|
||
class GlobalSettings(AbstractBaseModel, FolderMixin): | ||
""" | ||
Global settings for the application. | ||
New setting categories should only be added through data migrations. | ||
""" | ||
|
||
class Names(models.TextChoices): | ||
GENERAL = "general", "General" | ||
SSO = "sso", "SSO" | ||
|
||
# Name of the setting category. | ||
name = models.CharField( | ||
max_length=30, | ||
unique=True, | ||
choices=Names, | ||
default=Names.GENERAL, | ||
) | ||
# Value of the setting. | ||
value = models.JSONField(default=dict) | ||
|
||
def __str__(self): | ||
return self.name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from rest_framework.routers import Route, DynamicRoute, SimpleRouter | ||
|
||
|
||
class DefaultSettingsRouter(SimpleRouter): | ||
""" | ||
A custom router for settings views. | ||
""" | ||
|
||
routes = [ | ||
Route( | ||
url=r"^{prefix}{trailing_slash}$", | ||
mapping={ | ||
"get": "retrieve", | ||
"put": "update", | ||
"patch": "partial_update", | ||
}, | ||
name="{basename}-detail", | ||
detail=True, | ||
initkwargs={"suffix": "Instance"}, | ||
), | ||
DynamicRoute( | ||
url=r"^{prefix}/{url_path}{trailing_slash}$", | ||
name="{basename}-{url_name}", | ||
detail=True, | ||
initkwargs={}, | ||
), | ||
] |
Oops, something went wrong.