From ee93a73160b04a59a931b13036aeb957dff79cc8 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Thu, 1 Jan 2026 20:37:12 +0100 Subject: [PATCH] fix: use AUTHENTIK_USERNAME/PASSWORD env vars to match production MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- CHANGELOG.md | 6 ++++++ pyproject.toml | 2 +- src/auth/service.py | 8 ++++---- src/config.py | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e98d20..79816fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.4.1] - 2026-01-01 + +### Fixed + +- Authentik config now uses AUTHENTIK_USERNAME/PASSWORD to match production env vars + ## [1.4.0] - 2026-01-01 ### Added diff --git a/pyproject.toml b/pyproject.toml index b10948d..36e8570 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "core-api" -version = "1.4.0" +version = "1.4.1" description = "Core Code API - Infrastructure management and tools API" readme = "README.md" requires-python = ">=3.12" diff --git a/src/auth/service.py b/src/auth/service.py index f20d191..b5846ce 100644 --- a/src/auth/service.py +++ b/src/auth/service.py @@ -296,7 +296,7 @@ class AuthService: if data.get("component") == "ak-stage-identification": resp = await client.post( flow_url, - json={"uid_field": settings.authentik_admin_user}, + json={"uid_field": settings.authentik_username}, headers=headers, ) resp.raise_for_status() @@ -312,7 +312,7 @@ class AuthService: if data.get("component") == "ak-stage-password": resp = await client.post( flow_url, - json={"password": settings.authentik_admin_password}, + json={"password": settings.authentik_password}, headers=headers, ) resp.raise_for_status() @@ -342,8 +342,8 @@ class AuthService: Returns: BulkSyncResultSchema with counts of created/updated/failed users """ - if not settings.authentik_admin_user or not settings.authentik_admin_password: - raise ValueError("AUTHENTIK_ADMIN_USER and AUTHENTIK_ADMIN_PASSWORD must be configured") + if not settings.authentik_username or not settings.authentik_password: + raise ValueError("AUTHENTIK_USERNAME and AUTHENTIK_PASSWORD must be configured") created = 0 updated = 0 diff --git a/src/config.py b/src/config.py index ff47c99..079ab11 100644 --- a/src/config.py +++ b/src/config.py @@ -122,8 +122,8 @@ class Settings(BaseSettings): # Authentik API (for token validation and user management) authentik_url: str = "http://192.168.86.149:9000" # Authentik base URL - authentik_admin_user: str = "" # Admin username for API access - authentik_admin_password: str = "" # Admin password for API access + authentik_username: str = "" # Admin username for API access (AUTHENTIK_USERNAME env var) + authentik_password: str = "" # Admin password for API access (AUTHENTIK_PASSWORD env var) @property def model_aliases(self) -> dict: