outposts: make managed outposts

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-06-29 16:20:44 +02:00
parent 8429dd19b2
commit ce49d7ea5b
2 changed files with 28 additions and 4 deletions

View File

@ -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,
),
]

View File

@ -6,13 +6,19 @@ from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('authentik_outposts', '0016_alter_outpost_type'), ("authentik_outposts", "0016_alter_outpost_type"),
] ]
operations = [ operations = [
migrations.AddField( migrations.AddField(
model_name='outpost', model_name="outpost",
name='managed', 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'), 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",
),
), ),
] ]