From 591d9dd958cab3f86121406336d8bb491e003e2c Mon Sep 17 00:00:00 2001 From: Erich Blume Date: Sat, 28 Feb 2026 09:22:01 -0800 Subject: [PATCH] C2(authentik-source-build): close authentik-api-client-generation All three derivations verified on ringtail (nixos-25.11): - client-go: Go API client generated and formatted with gofmt - client-ts: TypeScript fetch client generated and compiled with tsc - api-go-vendor-hook: setup hook built successfully Co-Authored-By: Claude Opus 4.6 --- .../authentik-api-client-generation.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/how-to/authentik/authentik-api-client-generation.md b/docs/how-to/authentik/authentik-api-client-generation.md index 1624f72..f08b712 100644 --- a/docs/how-to/authentik/authentik-api-client-generation.md +++ b/docs/how-to/authentik/authentik-api-client-generation.md @@ -1,7 +1,6 @@ --- title: Generate Authentik API Clients modified: 2026-02-28 -status: active tags: - how-to - authentik @@ -30,7 +29,22 @@ Both clients are generated from the same `schema.yml` OpenAPI spec in the main a - Source spec: `schema.yml` in the authentik repo root - Go client replaces `vendor/goauthentik.io/api/v3/` in the server build - TypeScript client replaces `web/node_modules/@goauthentik/api/` in the web UI build -- The nixpkgs derivation patches the generated Go client (`client-go-config.patch`) — check if still needed +- The `client-go-config.patch` adds `disallowAdditionalPropertiesIfNotPresent: false` to the OpenAPI generator config — still needed as of 2025.12.4 + +## What We Learned + +- The Go client source comes from `goauthentik/client-go` (separate repo), not the main authentik repo. It contains `schema.yml`, `config.yaml`, `go.mod`, and `go.sum`. +- The TypeScript client uses the main authentik source's `schema.yml` and `scripts/api/ts-config.yaml`. +- The `apiGoVendorHook` must skip itself during FOD builds (checking `$outputHash`) so the Go `vendorHash` only depends on `go.sum`, not generated client content. +- Both clients build cleanly on nixos-25.11 with `openapi-generator-cli` 7.17.0. + +## Files + +- `containers/authentik/client-go.nix` — Go client derivation +- `containers/authentik/client-ts.nix` — TypeScript client derivation +- `containers/authentik/api-go-vendor-hook.nix` — Go vendor injection hook +- `containers/authentik/client-go-config.patch` — OpenAPI generator config patch +- `containers/authentik/source.nix` — Shared version and source fetch ## Related