authentik

authentik root module

 1"""authentik root module"""
 2
 3from functools import lru_cache
 4from os import environ
 5
 6VERSION = "2027.2.0-rc1"
 7VERSION_FAMILY_PREVIOUS = "2026.11"
 8ENV_GIT_HASH_KEY = "GIT_BUILD_HASH"
 9
10
11@lru_cache
12def authentik_version() -> str:
13    return VERSION
14
15
16@lru_cache
17def authentik_version_family_previous() -> str:
18    return VERSION_FAMILY_PREVIOUS
19
20
21@lru_cache
22def authentik_build_hash(fallback: str | None = None) -> str:
23    """Get build hash"""
24    build_hash = environ.get(ENV_GIT_HASH_KEY, fallback if fallback else "")
25    return fallback if build_hash == "" and fallback else build_hash
26
27
28@lru_cache
29def authentik_full_version() -> str:
30    """Get full version, with build hash appended"""
31    version = authentik_version()
32    if (build_hash := authentik_build_hash()) != "":
33        return f"{version}+{build_hash}"
34    return version
VERSION = '2027.2.0-rc1'
VERSION_FAMILY_PREVIOUS = '2026.11'
ENV_GIT_HASH_KEY = 'GIT_BUILD_HASH'
@lru_cache
def authentik_version() -> str:
12@lru_cache
13def authentik_version() -> str:
14    return VERSION
@lru_cache
def authentik_version_family_previous() -> str:
17@lru_cache
18def authentik_version_family_previous() -> str:
19    return VERSION_FAMILY_PREVIOUS
@lru_cache
def authentik_build_hash(fallback: str | None = None) -> str:
22@lru_cache
23def authentik_build_hash(fallback: str | None = None) -> str:
24    """Get build hash"""
25    build_hash = environ.get(ENV_GIT_HASH_KEY, fallback if fallback else "")
26    return fallback if build_hash == "" and fallback else build_hash

Get build hash

@lru_cache
def authentik_full_version() -> str:
29@lru_cache
30def authentik_full_version() -> str:
31    """Get full version, with build hash appended"""
32    version = authentik_version()
33    if (build_hash := authentik_build_hash()) != "":
34        return f"{version}+{build_hash}"
35    return version

Get full version, with build hash appended