Skip to content

Commit

Permalink
Merge branch 'main' into web/policy-wizard
Browse files Browse the repository at this point in the history
* main: (26 commits)
  translate: Updates for file locale/en/LC_MESSAGES/django.po in ru (#10884)
  core, web: update translations (#10887)
  web: bump typescript-eslint from 8.0.1 to 8.1.0 in /web (#10889)
  web: bump @goauthentik/api from 2024.6.3-1723234818 to 2024.6.3-1723497462 in /web/sfe (#10890)
  core: bump goauthentik.io/api/v3 from 3.2024063.8 to 3.2024063.10 (#10891)
  web: bump API Client version (#10886)
  outposts: add better UI for showing mismatched versions (#10885)
  website/integrations: Add Semgrep (#10849)
  web/elements: fix empty enterprise banner (#10882)
  root: fix docker build warnings (#10881)
  website/integrations: compress images (#10880)
  website/integrations: add Frappe (#10797)
  translate: Updates for file web/xliff/en.xlf in ru (#10878)
  core, web: update translations (#10877)
  web: bump API Client version (#10876)
  providers: add provider/ prefix for property mappings API (#10874)
  core, web: update translations (#10831)
  core: bump gunicorn from 22.0.0 to 23.0.0 (#10861)
  web: bump the swc group across 2 directories with 11 updates (#10868)
  web: bump ts-pattern from 5.2.0 to 5.3.1 in /web (#10870)
  ...
  • Loading branch information
kensternberg-authentik committed Aug 13, 2024
2 parents 4ee6c7b + ed49017 commit e527b6c
Show file tree
Hide file tree
Showing 97 changed files with 12,114 additions and 1,208 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ updates:
patterns:
- "@rollup/*"
- "rollup-*"
swc:
patterns:
- "@swc/*"
- "swc-*"
wdio:
patterns:
- "@wdio/*"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
secrets: |
GEOIPUPDATE_ACCOUNT_ID=${{ secrets.GEOIPUPDATE_ACCOUNT_ID }}
GEOIPUPDATE_LICENSE_KEY=${{ secrets.GEOIPUPDATE_LICENSE_KEY }}
build-args: |
VERSION=${{ github.ref }}
tags: ${{ steps.ev.outputs.imageTags }}
platforms: linux/amd64,linux/arm64
- uses: actions/attest-build-provenance@v1
Expand Down Expand Up @@ -111,6 +113,8 @@ jobs:
id: push
with:
push: true
build-args: |
VERSION=${{ github.ref }}
tags: ${{ steps.ev.outputs.imageTags }}
file: ${{ matrix.type }}.Dockerfile
platforms: linux/amd64,linux/arm64
Expand Down
21 changes: 12 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1

# Stage 1: Build website
FROM --platform=${BUILDPLATFORM} docker.io/library/node:22 as website-builder
FROM --platform=${BUILDPLATFORM} docker.io/library/node:22 AS website-builder

ENV NODE_ENV=production

Expand All @@ -20,7 +20,7 @@ COPY ./SECURITY.md /work/
RUN npm run build-bundled

# Stage 2: Build webui
FROM --platform=${BUILDPLATFORM} docker.io/library/node:22 as web-builder
FROM --platform=${BUILDPLATFORM} docker.io/library/node:22 AS web-builder

ARG GIT_BUILD_HASH
ENV GIT_BUILD_HASH=$GIT_BUILD_HASH
Expand Down Expand Up @@ -80,7 +80,7 @@ RUN --mount=type=cache,sharing=locked,target=/go/pkg/mod \
go build -o /go/authentik ./cmd/server

# Stage 4: MaxMind GeoIP
FROM --platform=${BUILDPLATFORM} ghcr.io/maxmind/geoipupdate:v7.0.1 as geoip
FROM --platform=${BUILDPLATFORM} ghcr.io/maxmind/geoipupdate:v7.0.1 AS geoip

ENV GEOIPUPDATE_EDITION_IDS="GeoLite2-City GeoLite2-ASN"
ENV GEOIPUPDATE_VERBOSE="1"
Expand All @@ -96,6 +96,9 @@ RUN --mount=type=secret,id=GEOIPUPDATE_ACCOUNT_ID \
# Stage 5: Python dependencies
FROM ghcr.io/goauthentik/fips-python:3.12.5-slim-bookworm-fips-full AS python-deps

ARG TARGETARCH
ARG TARGETVARIANT

WORKDIR /ak-root/poetry

ENV VENV_PATH="/ak-root/venv" \
Expand Down Expand Up @@ -123,15 +126,15 @@ RUN --mount=type=bind,target=./pyproject.toml,src=./pyproject.toml \
# Stage 6: Run
FROM ghcr.io/goauthentik/fips-python:3.12.5-slim-bookworm-fips-full AS final-image

ARG GIT_BUILD_HASH
ARG VERSION
ARG GIT_BUILD_HASH
ENV GIT_BUILD_HASH=$GIT_BUILD_HASH

LABEL org.opencontainers.image.url https://goauthentik.io
LABEL org.opencontainers.image.description goauthentik.io Main server image, see https://goauthentik.io for more info.
LABEL org.opencontainers.image.source https://github.com/goauthentik/authentik
LABEL org.opencontainers.image.version ${VERSION}
LABEL org.opencontainers.image.revision ${GIT_BUILD_HASH}
LABEL org.opencontainers.image.url=https://goauthentik.io
LABEL org.opencontainers.image.description="goauthentik.io Main server image, see https://goauthentik.io for more info."
LABEL org.opencontainers.image.source=https://github.com/goauthentik/authentik
LABEL org.opencontainers.image.version=${VERSION}
LABEL org.opencontainers.image.revision=${GIT_BUILD_HASH}

WORKDIR /

Expand Down
11 changes: 11 additions & 0 deletions authentik/admin/api/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from authentik import __version__, get_build_hash
from authentik.admin.tasks import VERSION_CACHE_KEY, VERSION_NULL, update_latest_version
from authentik.core.api.utils import PassiveSerializer
from authentik.outposts.models import Outpost


class VersionSerializer(PassiveSerializer):
Expand All @@ -22,6 +23,7 @@ class VersionSerializer(PassiveSerializer):
version_latest_valid = SerializerMethodField()
build_hash = SerializerMethodField()
outdated = SerializerMethodField()
outpost_outdated = SerializerMethodField()

def get_build_hash(self, _) -> str:
"""Get build hash, if version is not latest or released"""
Expand All @@ -47,6 +49,15 @@ def get_outdated(self, instance) -> bool:
"""Check if we're running the latest version"""
return parse(self.get_version_current(instance)) < parse(self.get_version_latest(instance))

def get_outpost_outdated(self, _) -> bool:
"""Check if any outpost is outdated/has a version mismatch"""
any_outdated = False
for outpost in Outpost.objects.all():
for state in outpost.state:
if state.version_outdated:
any_outdated = True
return any_outdated


class VersionView(APIView):
"""Get running and latest version."""
Expand Down
2 changes: 1 addition & 1 deletion authentik/enterprise/providers/google_workspace/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class GoogleWorkspaceProviderMapping(PropertyMapping):

@property
def component(self) -> str:
return "ak-property-mapping-google-workspace-form"
return "ak-property-mapping-provider-google-workspace-form"

@property
def serializer(self) -> type[Serializer]:
Expand Down
2 changes: 1 addition & 1 deletion authentik/enterprise/providers/microsoft_entra/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class MicrosoftEntraProviderMapping(PropertyMapping):

@property
def component(self) -> str:
return "ak-property-mapping-microsoft-entra-form"
return "ak-property-mapping-provider-microsoft-entra-form"

@property
def serializer(self) -> type[Serializer]:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 5.0.8 on 2024-08-12 12:54

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("authentik_providers_rac", "0004_alter_connectiontoken_expires"),
]

operations = [
migrations.AlterModelOptions(
name="racpropertymapping",
options={
"verbose_name": "RAC Provider Property Mapping",
"verbose_name_plural": "RAC Provider Property Mappings",
},
),
]
6 changes: 3 additions & 3 deletions authentik/enterprise/providers/rac/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def evaluate(self, user: User | None, request: HttpRequest | None, **kwargs) ->

@property
def component(self) -> str:
return "ak-property-mapping-rac-form"
return "ak-property-mapping-provider-rac-form"

@property
def serializer(self) -> type[Serializer]:
Expand All @@ -136,8 +136,8 @@ def serializer(self) -> type[Serializer]:
return RACPropertyMappingSerializer

class Meta:
verbose_name = _("RAC Property Mapping")
verbose_name_plural = _("RAC Property Mappings")
verbose_name = _("RAC Provider Property Mapping")
verbose_name_plural = _("RAC Provider Property Mappings")


class ConnectionToken(ExpiringModel):
Expand Down
2 changes: 1 addition & 1 deletion authentik/enterprise/providers/rac/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

api_urlpatterns = [
("providers/rac", RACProviderViewSet),
("propertymappings/rac", RACPropertyMappingViewSet),
("propertymappings/provider/rac", RACPropertyMappingViewSet),
("rac/endpoints", EndpointViewSet),
("rac/connection_tokens", ConnectionTokenViewSet),
]
2 changes: 0 additions & 2 deletions authentik/outposts/api/outposts.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from authentik.outposts.models import (
Outpost,
OutpostConfig,
OutpostState,
OutpostType,
default_outpost_config,
)
Expand Down Expand Up @@ -182,7 +181,6 @@ def health(self, request: Request, pk: int) -> Response:
outpost: Outpost = self.get_object()
states = []
for state in outpost.state:
state: OutpostState
states.append(
{
"uid": state.uid,
Expand Down
2 changes: 1 addition & 1 deletion authentik/outposts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def version_outdated(self) -> bool:
return False
if self.build_hash != get_build_hash():
return False
return parse(self.version) < OUR_VERSION
return parse(self.version) != OUR_VERSION

@staticmethod
def for_outpost(outpost: Outpost) -> list["OutpostState"]:
Expand Down
2 changes: 1 addition & 1 deletion authentik/policies/reputation/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def update_score(request: HttpRequest, identifier: str, amount: int):
if not created:
reputation.score = F("score") + amount
reputation.save()
LOGGER.debug("Updated score", amount=amount, for_user=identifier, for_ip=remote_ip)
LOGGER.info("Updated score", amount=amount, for_user=identifier, for_ip=remote_ip)


@receiver(login_failed)
Expand Down
2 changes: 1 addition & 1 deletion authentik/providers/oauth2/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class ScopeMapping(PropertyMapping):

@property
def component(self) -> str:
return "ak-property-mapping-scope-form"
return "ak-property-mapping-provider-scope-form"

@property
def serializer(self) -> type[Serializer]:
Expand Down
2 changes: 1 addition & 1 deletion authentik/providers/oauth2/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

api_urlpatterns = [
("providers/oauth2", OAuth2ProviderViewSet),
("propertymappings/scope", ScopeMappingViewSet),
("propertymappings/provider/scope", ScopeMappingViewSet),
("oauth2/authorization_codes", AuthorizationCodeViewSet),
("oauth2/refresh_tokens", RefreshTokenViewSet),
("oauth2/access_tokens", AccessTokenViewSet),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 5.0.8 on 2024-08-12 12:54

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("authentik_providers_radius", "0003_radiusproviderpropertymapping"),
]

operations = [
migrations.AlterModelOptions(
name="radiusproviderpropertymapping",
options={
"verbose_name": "Radius Provider Property Mapping",
"verbose_name_plural": "Radius Provider Property Mappings",
},
),
]
8 changes: 4 additions & 4 deletions authentik/providers/radius/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class RadiusProviderPropertyMapping(PropertyMapping):

@property
def component(self) -> str:
return "ak-property-mapping-radius-form"
return "ak-property-mapping-provider-radius-form"

@property
def serializer(self) -> type[Serializer]:
Expand All @@ -81,8 +81,8 @@ def serializer(self) -> type[Serializer]:
return RadiusProviderPropertyMappingSerializer

def __str__(self):
return f"Radius Property Mapping {self.name}"
return f"Radius Provider Property Mapping {self.name}"

class Meta:
verbose_name = _("Radius Property Mapping")
verbose_name_plural = _("Radius Property Mappings")
verbose_name = _("Radius Provider Property Mapping")
verbose_name_plural = _("Radius Provider Property Mappings")
2 changes: 1 addition & 1 deletion authentik/providers/radius/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
)

api_urlpatterns = [
("propertymappings/radius", RadiusProviderPropertyMappingViewSet),
("propertymappings/provider/radius", RadiusProviderPropertyMappingViewSet),
("outposts/radius", RadiusOutpostConfigViewSet, "radiusprovideroutpost"),
("providers/radius", RadiusProviderViewSet),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 5.0.8 on 2024-08-12 12:54

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("authentik_providers_saml", "0014_alter_samlprovider_digest_algorithm_and_more"),
]

operations = [
migrations.AlterModelOptions(
name="samlpropertymapping",
options={
"verbose_name": "SAML Provider Property Mapping",
"verbose_name_plural": "SAML Provider Property Mappings",
},
),
]
6 changes: 3 additions & 3 deletions authentik/providers/saml/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class SAMLPropertyMapping(PropertyMapping):

@property
def component(self) -> str:
return "ak-property-mapping-saml-form"
return "ak-property-mapping-provider-saml-form"

@property
def serializer(self) -> type[Serializer]:
Expand All @@ -204,8 +204,8 @@ def __str__(self):
return f"{self.name} ({name})"

class Meta:
verbose_name = _("SAML Property Mapping")
verbose_name_plural = _("SAML Property Mappings")
verbose_name = _("SAML Provider Property Mapping")
verbose_name_plural = _("SAML Provider Property Mappings")


class SAMLProviderImportModel(CreatableType, Provider):
Expand Down
2 changes: 1 addition & 1 deletion authentik/providers/saml/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
]

api_urlpatterns = [
("propertymappings/saml", SAMLPropertyMappingViewSet),
("propertymappings/provider/saml", SAMLPropertyMappingViewSet),
("providers/saml", SAMLProviderViewSet),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 5.0.8 on 2024-08-12 12:54

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("authentik_providers_scim", "0008_rename_scimgroup_scimprovidergroup_and_more"),
]

operations = [
migrations.AlterModelOptions(
name="scimmapping",
options={
"verbose_name": "SCIM Provider Mapping",
"verbose_name_plural": "SCIM Provider Mappings",
},
),
]
8 changes: 4 additions & 4 deletions authentik/providers/scim/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class SCIMMapping(PropertyMapping):

@property
def component(self) -> str:
return "ak-property-mapping-scim-form"
return "ak-property-mapping-provider-scim-form"

@property
def serializer(self) -> type[Serializer]:
Expand All @@ -142,8 +142,8 @@ def serializer(self) -> type[Serializer]:
return SCIMMappingSerializer

def __str__(self):
return f"SCIM Mapping {self.name}"
return f"SCIM Provider Mapping {self.name}"

class Meta:
verbose_name = _("SCIM Mapping")
verbose_name_plural = _("SCIM Mappings")
verbose_name = _("SCIM Provider Mapping")
verbose_name_plural = _("SCIM Provider Mappings")
2 changes: 1 addition & 1 deletion authentik/providers/scim/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
("providers/scim", SCIMProviderViewSet),
("providers/scim_users", SCIMProviderUserViewSet),
("providers/scim_groups", SCIMProviderGroupViewSet),
("propertymappings/scim", SCIMMappingViewSet),
("propertymappings/provider/scim", SCIMMappingViewSet),
]
2 changes: 1 addition & 1 deletion authentik/sources/ldap/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ class LDAPSourcePropertyMapping(PropertyMapping):

@property
def component(self) -> str:
return "ak-property-mapping-ldap-source-form"
return "ak-property-mapping-source-ldap-form"

@property
def serializer(self) -> type[Serializer]:
Expand Down
Loading

0 comments on commit e527b6c

Please sign in to comment.