diff --git a/authentik/outposts/api/outposts.py b/authentik/outposts/api/outposts.py index 4cf47d907..11a6c5fbf 100644 --- a/authentik/outposts/api/outposts.py +++ b/authentik/outposts/api/outposts.py @@ -77,6 +77,7 @@ class OutpostSerializer(ModelSerializer): "service_connection_obj", "token_identifier", "config", + "managed", ] extra_kwargs = {"type": {"required": True}} diff --git a/authentik/outposts/migrations/0017_outpost_managed.py b/authentik/outposts/migrations/0017_outpost_managed.py new file mode 100644 index 000000000..f5dcff1ad --- /dev/null +++ b/authentik/outposts/migrations/0017_outpost_managed.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.4 on 2021-06-23 19:25 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('authentik_outposts', '0016_alter_outpost_type'), + ] + + operations = [ + migrations.AddField( + model_name='outpost', + name='managed', + field=models.TextField(default=None, help_text='Objects which are managed by authentik. These objects are created and updated automatically. This is flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update.', null=True, unique=True, verbose_name='Managed by authentik'), + ), + ] diff --git a/authentik/outposts/models.py b/authentik/outposts/models.py index 9276becdf..ff80960a7 100644 --- a/authentik/outposts/models.py +++ b/authentik/outposts/models.py @@ -34,6 +34,7 @@ from authentik.lib.config import CONFIG from authentik.lib.models import InheritanceForeignKey from authentik.lib.sentry import SentryIgnoredException from authentik.lib.utils.http import USER_ATTRIBUTE_CAN_OVERRIDE_IP +from authentik.managed.models import ManagedModel from authentik.outposts.controllers.k8s.utils import get_namespace from authentik.outposts.docker_tls import DockerInlineTLS @@ -281,7 +282,7 @@ class KubernetesServiceConnection(OutpostServiceConnection): verbose_name_plural = _("Kubernetes Service-Connections") -class Outpost(models.Model): +class Outpost(ManagedModel): """Outpost instance which manages a service user and token""" uuid = models.UUIDField(default=uuid4, editable=False, primary_key=True) diff --git a/schema.yml b/schema.yml index 8e85f84f7..a0982f018 100644 --- a/schema.yml +++ b/schema.yml @@ -21217,6 +21217,14 @@ components: config: type: object additionalProperties: {} + managed: + type: string + nullable: true + title: Managed by authentik + description: Objects which are managed by authentik. These objects are created + and updated automatically. This is flag only indicates that an object + can be overwritten by migrations. You can still modify the objects via + the API, but expect changes to be overwritten in a later update. required: - config - name @@ -21279,6 +21287,14 @@ components: config: type: object additionalProperties: {} + managed: + type: string + nullable: true + title: Managed by authentik + description: Objects which are managed by authentik. These objects are created + and updated automatically. This is flag only indicates that an object + can be overwritten by migrations. You can still modify the objects via + the API, but expect changes to be overwritten in a later update. required: - config - name @@ -24953,6 +24969,14 @@ components: config: type: object additionalProperties: {} + managed: + type: string + nullable: true + title: Managed by authentik + description: Objects which are managed by authentik. These objects are created + and updated automatically. This is flag only indicates that an object + can be overwritten by migrations. You can still modify the objects via + the API, but expect changes to be overwritten in a later update. PatchedPasswordExpiryPolicyRequest: type: object description: Password Expiry Policy Serializer