core: bump black from 22.12.0 to 23.1.0 (#4584)

* core: bump black from 22.12.0 to 23.1.0

Bumps [black](https://github.com/psf/black) from 22.12.0 to 23.1.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/22.12.0...23.1.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* re-format

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
dependabot[bot]
2023-02-01 11:31:32 +01:00
committed by GitHub
parent 456da49f36
commit 18cfe67719
317 changed files with 808 additions and 838 deletions

View File

@ -56,10 +56,8 @@ class OutpostSerializer(ModelSerializer):
for provider in providers:
if not isinstance(provider, type_map[self.initial_data.get("type")]):
raise ValidationError(
(
f"Outpost type {self.initial_data['type']} can't be used with "
f"{provider.__class__.__name__} providers."
)
f"Outpost type {self.initial_data['type']} can't be used with "
f"{provider.__class__.__name__} providers."
)
if self.instance and self.instance.managed == MANAGED_OUTPOST:
return providers
@ -76,7 +74,6 @@ class OutpostSerializer(ModelSerializer):
return config
class Meta:
model = Outpost
fields = [
"pk",
@ -124,7 +121,6 @@ class OutpostFilter(FilterSet):
)
class Meta:
model = Outpost
fields = {
"providers": ["isnull"],

View File

@ -37,7 +37,6 @@ class ServiceConnectionSerializer(ModelSerializer, MetaNameSerializer):
return obj.component
class Meta:
model = OutpostServiceConnection
fields = [
"pk",
@ -101,7 +100,6 @@ class DockerServiceConnectionSerializer(ServiceConnectionSerializer):
"""DockerServiceConnection Serializer"""
class Meta:
model = DockerServiceConnection
fields = ServiceConnectionSerializer.Meta.fields + [
"url",
@ -140,7 +138,6 @@ class KubernetesServiceConnectionSerializer(ServiceConnectionSerializer):
return kubeconfig
class Meta:
model = KubernetesServiceConnection
fields = ServiceConnectionSerializer.Meta.fields + ["kubeconfig", "verify_ssl"]

View File

@ -80,7 +80,6 @@ def update_config_prefix(apps: Apps, schema_editor: BaseDatabaseSchemaEditor):
class Migration(migrations.Migration):
replaces = [
("authentik_outposts", "0001_initial"),
("authentik_outposts", "0002_auto_20200826_1306"),
@ -136,7 +135,10 @@ class Migration(migrations.Migration):
("custom", "Custom"),
],
default="custom",
help_text="Select between authentik-managed deployment types or a custom deployment.",
help_text=(
"Select between authentik-managed deployment types or a custom"
" deployment."
),
),
),
],
@ -158,7 +160,10 @@ class Migration(migrations.Migration):
"local",
models.BooleanField(
default=False,
help_text="If enabled, use the local connection. Required Docker socket/Kubernetes Integration",
help_text=(
"If enabled, use the local connection. Required Docker"
" socket/Kubernetes Integration"
),
unique=True,
),
),
@ -207,7 +212,10 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
default=None,
help_text="Select Service-Connection authentik should use to manage this outpost. Leave empty if authentik should not handle the deployment.",
help_text=(
"Select Service-Connection authentik should use to manage this outpost. Leave"
" empty if authentik should not handle the deployment."
),
null=True,
on_delete=django.db.models.deletion.SET_DEFAULT,
to="authentik_outposts.outpostserviceconnection",
@ -240,7 +248,10 @@ class Migration(migrations.Migration):
field=authentik.lib.models.InheritanceForeignKey(
blank=True,
default=None,
help_text="Select Service-Connection authentik should use to manage this outpost. Leave empty if authentik should not handle the deployment.",
help_text=(
"Select Service-Connection authentik should use to manage this outpost. Leave"
" empty if authentik should not handle the deployment."
),
null=True,
on_delete=django.db.models.deletion.SET_DEFAULT,
to="authentik_outposts.outpostserviceconnection",
@ -258,7 +269,10 @@ class Migration(migrations.Migration):
name="kubeconfig",
field=models.JSONField(
default=None,
help_text="Paste your kubeconfig here. authentik will automatically use the currently selected context.",
help_text=(
"Paste your kubeconfig here. authentik will automatically use the currently"
" selected context."
),
),
preserve_default=False,
),
@ -272,7 +286,10 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
default=None,
help_text="Certificate/Key used for authentication. Can be left empty for no authentication.",
help_text=(
"Certificate/Key used for authentication. Can be left empty for no"
" authentication."
),
null=True,
on_delete=django.db.models.deletion.SET_DEFAULT,
related_name="+",
@ -285,7 +302,10 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
default=None,
help_text="CA which the endpoint's Certificate is verified against. Can be left empty for no validation.",
help_text=(
"CA which the endpoint's Certificate is verified against. Can be left empty for"
" no validation."
),
null=True,
on_delete=django.db.models.deletion.SET_DEFAULT,
related_name="+",
@ -297,7 +317,10 @@ class Migration(migrations.Migration):
name="local",
field=models.BooleanField(
default=False,
help_text="If enabled, use the local connection. Required Docker socket/Kubernetes Integration",
help_text=(
"If enabled, use the local connection. Required Docker socket/Kubernetes"
" Integration"
),
),
),
migrations.RunPython(
@ -310,7 +333,10 @@ class Migration(migrations.Migration):
model_name="dockerserviceconnection",
name="url",
field=models.TextField(
help_text="Can be in the format of 'unix://<path>' when connecting to a local docker daemon, or 'https://<hostname>:2376' when connecting to a remote system."
help_text=(
"Can be in the format of 'unix://<path>' when connecting to a local docker"
" daemon, or 'https://<hostname>:2376' when connecting to a remote system."
)
),
),
migrations.AlterField(
@ -318,7 +344,10 @@ class Migration(migrations.Migration):
name="kubeconfig",
field=models.JSONField(
blank=True,
help_text="Paste your kubeconfig here. authentik will automatically use the currently selected context.",
help_text=(
"Paste your kubeconfig here. authentik will automatically use the currently"
" selected context."
),
),
),
migrations.AlterField(
@ -331,7 +360,12 @@ class Migration(migrations.Migration):
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.",
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",

View File

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("authentik_outposts", "0001_squashed_0017_outpost_managed"),
]

View File

@ -86,7 +86,6 @@ class OutpostModel(Model):
return [self]
class Meta:
abstract = True
@ -119,10 +118,7 @@ class OutpostServiceConnection(models.Model):
local = models.BooleanField(
default=False,
help_text=_(
(
"If enabled, use the local connection. Required Docker "
"socket/Kubernetes Integration"
)
"If enabled, use the local connection. Required Docker socket/Kubernetes Integration"
),
)
@ -152,7 +148,6 @@ class OutpostServiceConnection(models.Model):
return ""
class Meta:
verbose_name = _("Outpost Service-Connection")
verbose_name_plural = _("Outpost Service-Connections")
@ -162,10 +157,8 @@ class DockerServiceConnection(SerializerModel, OutpostServiceConnection):
url = models.TextField(
help_text=_(
(
"Can be in the format of 'unix://<path>' when connecting to a local docker daemon, "
"or 'https://<hostname>:2376' when connecting to a remote system."
)
"Can be in the format of 'unix://<path>' when connecting to a local docker daemon, "
"or 'https://<hostname>:2376' when connecting to a remote system."
)
)
tls_verification = models.ForeignKey(
@ -176,10 +169,8 @@ class DockerServiceConnection(SerializerModel, OutpostServiceConnection):
related_name="+",
on_delete=models.SET_DEFAULT,
help_text=_(
(
"CA which the endpoint's Certificate is verified against. "
"Can be left empty for no validation."
)
"CA which the endpoint's Certificate is verified against. "
"Can be left empty for no validation."
),
)
tls_authentication = models.ForeignKey(
@ -208,7 +199,6 @@ class DockerServiceConnection(SerializerModel, OutpostServiceConnection):
return f"Docker Service-Connection {self.name}"
class Meta:
verbose_name = _("Docker Service-Connection")
verbose_name_plural = _("Docker Service-Connections")
@ -218,10 +208,8 @@ class KubernetesServiceConnection(SerializerModel, OutpostServiceConnection):
kubeconfig = models.JSONField(
help_text=_(
(
"Paste your kubeconfig here. authentik will automatically use "
"the currently selected context."
)
"Paste your kubeconfig here. authentik will automatically use "
"the currently selected context."
),
blank=True,
)
@ -243,7 +231,6 @@ class KubernetesServiceConnection(SerializerModel, OutpostServiceConnection):
return f"Kubernetes Service-Connection {self.name}"
class Meta:
verbose_name = _("Kubernetes Service-Connection")
verbose_name_plural = _("Kubernetes Service-Connections")
@ -261,10 +248,8 @@ class Outpost(SerializerModel, ManagedModel):
null=True,
blank=True,
help_text=_(
(
"Select Service-Connection authentik should use to manage this outpost. "
"Leave empty if authentik should not handle the deployment."
)
"Select Service-Connection authentik should use to manage this outpost. "
"Leave empty if authentik should not handle the deployment."
),
on_delete=models.SET_DEFAULT,
)
@ -315,7 +300,7 @@ class Outpost(SerializerModel, ManagedModel):
if isinstance(model_or_perm, models.Model):
model_or_perm: models.Model
code_name = (
f"{model_or_perm._meta.app_label}." f"view_{model_or_perm._meta.model_name}"
f"{model_or_perm._meta.app_label}.view_{model_or_perm._meta.model_name}"
)
try:
assign_perm(code_name, user, model_or_perm)