feat(KLEF): Create authentik plugin - #1
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary
idp-authentikKleff plugin — a gRPC adapter that connects Kleff to a self-hosted Authentik instanceGetOIDCConfigbehind asetupDoneflag so the platform'sreadycheck stays false untilEnsureSetupcompletes, preventing users from reaching the login form before the admin account existskeycloak-pluginpatternRelated Issues
Closes #
Changes
What's Included
cmd/plugin/main.go: wires the hexagonal layers; starts gRPC immediately so the platform can dial whileEnsureSetupruns in the background; callssrv.SetReady()once setup succeedsinternal/adapters/grpc/server.go: implementsIdentityPlugin,PluginHealth, andPluginUIgRPC interfaces;GetOIDCConfigreturns an empty response untilsetupDoneis setinternal/adapters/authentik/client.go: HTTP client against the Authentik API — idempotentEnsureSetup,EnsureAdmin,Login,RefreshToken,ValidateToken,Registerinternal/core/application/: service layer.github/workflows/ci.yml: build, test, Docker image build on push/PR.github/workflows/release.yml: build + push toghcr.io/kleffio/idp-authentik, create GitHub Release, open auto-merged PR toplugin-registryWhat's Not Included
Testing
How Was This Tested?
EnsureSetupcompletes (including admin user and OIDC scopes)adminuser and verified the admin role is presentTest Coverage
Breaking Changes
Does this PR introduce breaking changes?
Security Considerations
AUTHENTIK_BOOTSTRAP_TOKENis consumed only during setup and never logged. Admin password is set via Authentik'sset_passwordAPI (not sent in user creation payload). ThesetupDoneflag ensures OIDC config is never exposed before the admin account is confirmed.Documentation
Does this PR require documentation updates?
UI/UX (If Applicable)
Pre-Merge Checklist
feat: add idp-authentik plugin)Reviewer Notes
The plugin starts its gRPC server before
EnsureSetupfinishes (so the platform doesn't time out dialing).GetOIDCConfigreturns an empty proto untilSetReady()is called, which causes the platform to return{enabled: true, ready: false}and the frontend to show the spinner.SetReady()is only called after the fullEnsureSetupsucceeds, so the admin user, OAuth2 provider, and OIDC scopes are all guaranteed to exist beforeready: truefires.