From ce49d7ea5b278365fdd547ed64cf387295afddd0 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 29 Jun 2021 16:20:44 +0200 Subject: [PATCH] outposts: make managed outposts Signed-off-by: Jens Langhammer --- authentik/outposts/managed.py | 18 ++++++++++++++++++ .../migrations/0017_outpost_managed.py | 14 ++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 authentik/outposts/managed.py diff --git a/authentik/outposts/managed.py b/authentik/outposts/managed.py new file mode 100644 index 000000000..e43225db7 --- /dev/null +++ b/authentik/outposts/managed.py @@ -0,0 +1,18 @@ +"""Outpost managed objects""" +from authentik.outposts.models import Outpost, OutpostType +from authentik.managed.manager import EnsureExists, ObjectManager + + +class OutpostManager(ObjectManager): + """Outpost managed objects""" + + def reconcile(self): + return [ + EnsureExists( + Outpost, + "goauthentik.io/outposts/inbuilt", + name="authentik Bundeled Outpost", + object_field="name", + type=OutpostType.PROXY, + ), + ] diff --git a/authentik/outposts/migrations/0017_outpost_managed.py b/authentik/outposts/migrations/0017_outpost_managed.py index f5dcff1ad..70b47841a 100644 --- a/authentik/outposts/migrations/0017_outpost_managed.py +++ b/authentik/outposts/migrations/0017_outpost_managed.py @@ -6,13 +6,19 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('authentik_outposts', '0016_alter_outpost_type'), + ("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'), + 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", + ), ), ]