# Debian packages whose files are kept in the distroless server image.
# Everything installed in the assemble stage but not listed here is dropped.
#
# Each entry is justified below. Nothing is here "just in case": the list was
# derived from the transitive DT_NEEDED closure of /usr/bin/authentik, the
# CPython interpreter, every .so in /ak-root/.venv, plus an strace of a full
# boot (server + root worker) and a run of the Django test suite.
#
# Lines starting with # and blank lines are ignored.

# --- C runtime -------------------------------------------------------------
libc6                       # everything
libgcc-s1                   # unwinder, needed by the Rust binary and by Rust wheels
libstdc++6                  # C++ runtime, pulled in by several wheels
base-files                  # /etc/os-release, the FHS directory skeleton
netbase                     # /etc/protocols, /etc/services
tzdata                      # zoneinfo, used by Python and Django
ca-certificates             # /etc/ssl/certs, the trust store for every outbound TLS call

# --- FIPS OpenSSL ----------------------------------------------------------
libssl3t64                  # the from-source FIPS OpenSSL runtime
openssl-provider-legacy     # ossl-modules/legacy.so, dlopened by OpenSSL at init

# --- CPython extension modules --------------------------------------------
libbz2-1.0                  # _bz2
liblzma5                    # _lzma
zlib1g                      # zlib, and libxml2/libpq compression
libffi8                     # _ctypes
libzstd1                    # libpq and libxml2 compression

# --- lxml / xmlsec (SAML signing) -----------------------------------------
libxml2                     # lxml, xmlsec
libxslt1.1                  # lxml.etree.XSLT, libexslt
libgcrypt20                 # required by libexslt
libgpg-error0               # required by libgcrypt
libltdl7                    # xmlsec dlopens its crypto backend through libltdl

# --- PostgreSQL ------------------------------------------------------------
libpq5                      # psycopg[c]
libldap2                    # libpq links it (LDAP connection-service lookup)
libsasl2-2                  # libldap links it

# --- Kerberos (python gssapi, and libpq GSSAPI auth) -----------------------
libgssapi-krb5-2            # python gssapi, and libpq links it
libkrb5-3                   # required by libgssapi-krb5
libk5crypto3                # required by libgssapi-krb5 and libkrb5
libkrb5support0             # required by the other MIT Kerberos libraries
libcom-err2                 # required by libgssapi-krb5 and libkrb5
libkeyutils1                # required by libkrb5

# --- Kerberos kadmin (python-kadmin-rs) ------------------------------------
# python-kadmin-rs dlopens the kadm5 client for the source's kadmin type when it
# connects, so no DT_NEEDED closure sees these. prune.sh keeps only the listed
# packages and not their dependencies, so the whole closure is listed.
libkadm5clnt-mit12          # the MIT kadm5 client
libgssrpc4t64               # required by the MIT kadm5 client
libkadm5clnt7t64-heimdal    # the Heimdal kadm5 client
libkrb5-26t64-heimdal       # required by the Heimdal kadm5 client
libroken19t64-heimdal       # required by the Heimdal kadm5 client and libraries
libasn1-8t64-heimdal        # required by Heimdal libkrb5, libhcrypto and libhx509
libhcrypto5t64-heimdal      # required by Heimdal libkrb5 and libhx509
libheimbase1t64-heimdal     # required by Heimdal libkrb5
libhx509-5t64-heimdal       # required by Heimdal libkrb5
libwind0t64-heimdal         # required by Heimdal libkrb5 and libhx509
libsqlite3-0                # required by Heimdal libkrb5
libcrypt1                   # required by Heimdal libkrb5 and libroken
