Create goal card and 4 prerequisite cards for building authentik from a custom Nix derivation instead of using pkgs.authentik from nixpkgs. This removes the dependency on the nixpkgs packaging timeline and gives full version control over authentik releases. Chain: mikado/authentik-source-build Leaf nodes: authentik-api-client-generation, authentik-python-backend-derivation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.7 KiB
1.7 KiB
| title | modified | status | tags | |||
|---|---|---|---|---|---|---|
| Generate Authentik API Clients | 2026-02-28 | active |
|
Generate Authentik API Clients
Build Go and TypeScript API client bindings from authentik's OpenAPI spec (schema.yml). These are build-time inputs for the Go server and web UI respectively.
Context
Authentik maintains a separate repo (goauthentik/client-go) with pre-generated Go client code. The nixpkgs derivation fetches this and injects it into the Go vendor directory via a setup hook (apiGoVendorHook). The TypeScript client is generated inline from schema.yml using openapi-generator-cli.
Both clients are generated from the same schema.yml OpenAPI spec in the main authentik repo.
What to Do
- Create a Nix derivation (
client-go) that generates Go API client bindings fromschema.ymlusingopenapi-generator-cli - Create a Nix derivation (
client-ts) that generates TypeScript fetch client bindings from the same spec - Create a setup hook (
apiGoVendorHook) that replacesgoauthentik.io/api/v3in the Go vendor directory with the generated client - Verify the generated code compiles (Go:
go build, TypeScript: type-check withtsc)
Key Details
- Source spec:
schema.ymlin 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
Related
- build-authentik-from-source — Parent goal
- authentik-go-server-derivation — Consumer of Go client
- authentik-web-ui-derivation — Consumer of TypeScript client