✨ Keycloak replaced with hub IdP.#567
Draft
jortel wants to merge 16 commits into
Draft
Conversation
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
- Grant the operator RBAC for the new IdpClient / IdentityProvider /
LdapProvider CRDs (under tackle.konveyor.io) so reconcile doesn't
fail on the first IdpClient lookup.
- Rework the llm-proxy e2e test:
- happy path goes through the UI's /hub reverse-proxy (the real
client flow): port-forward service/tackle-ui, then Basic Auth on
POST /hub/auth/tokens to mint a long-lived API key, and use that
PAT as a Bearer token on the /hub/services/llm-proxy chat-completion
calls. Mirrors how real clients are expected to talk to the hub:
short-lived credential at the door, API key for service calls.
- security check goes to the hub directly (separate port-forward
on service/tackle-hub) and asserts the hub itself rejects an
invalid Bearer token with 401/403. We deliberately bypass the UI
for this one assertion — the UI may 302 unrecognized tokens to its
OIDC login page (browser UX), which is not the same as the hub
refusing the request, and what we want to verify is the hub's
own auth enforcement on /services/...
- capture the HTTP status code + truncated body on a failed
chat-completion so auth failures (401/403) are distinguishable
from upstream errors (5xx).
- Dump tackle-hub logs in the debug step on failure so auth/scope
decisions are visible.
Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
Fix llm-proxy CI on oidc2
Signed-off-by: Jeff Ortel <jortel@redhat.com>
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.
Another attempt at #562.
Created:
● # OIDC Refactoring: Remove Keycloak Management, Enable Hub as OIDC Provider
Summary
This PR removes the operator's responsibility for deploying and managing Keycloak/RHBK/RHSSO identity providers and transitions to using Hub
as the OIDC provider. This is a major architectural change that simplifies authentication, reduces resource footprint, and enables
enterprise identity federation.
Key Change: Hub now provides OIDC functionality directly, making operator-deployed Keycloak redundant.
Motivation
The Hub has evolved to become a full OIDC Identity Provider capable of:
This eliminates the need for the operator to deploy and manage Keycloak, PostgreSQL databases, and OAuth proxies, significantly reducing
complexity and operational overhead.
Changes
🗑️ Removed (~4,000 lines)
Keycloak Deployment Code:
Variables & Configuration:
defaults/main.ymlfeature_auth_typevariable (no longer needed)Total Removed:
roles/tackle/tasks/main.yml✨ Added (~16,000 lines)
New Custom Resource Definitions:
IdpClient- OIDC clients that authenticate to HubIdentityProvider- External OIDC providers for federationLdapProvider- LDAP servers for federationNew Custom Resources:
Three
IdpClientCRs created automatically:New Templates:
customresource-idpclients.yml.j2- Creates all three OIDC clientscustomresource-identityprovider.yml.j2- Federation to external IdP (upgrade path)Network policies for improved security
Keycloak Detection Logic:
IdentityProviderCR on upgrade to federate to existing KeycloakHub Changes:
APIKEY_SECRETenvironment variable for API key authenticationKEYCLOAK_ADMIN_USER/KEYCLOAK_ADMIN_PASS(Hub is no longer a Keycloak admin)KEYCLOAK_*env vars only when federating to external KeycloakLLM_PROXY_URLfor routing LLM proxy requests through HubUI Changes:
OIDC_ISSUERpointing to Hub's OIDC endpoint (${hub_url}/oidc)OIDC_CLIENT_IDset toweb-uiKEYCLOAK_SERVER_URLwhen Keycloak detected (backward compatibility)LLM Proxy Changes:
kai_llm_proxy_url→kai_llm_proxy_internal_urlHelm Chart:
helm/templates/crds/🔄 Modified
Hub Deployment:
UI Deployment:
Ingress/Route:
/authpath routing only when Keycloak detectedBundle/OLM:
tackle-operatortokonveyor-operatorDeployment Scenarios
Fresh Installation (No Existing Keycloak)
What happens:
IdpClientCRs created (web-ui, kantra, kai-ide)IdentityProviderCR createdUser Experience:
Upgrade (Existing Operator-Deployed Keycloak)
What happens:
IdentityProviderCR created pointing to existing Keycloak/authpath for Keycloak realm accessUser Experience:
Disabling Authentication (
feature_auth_required: false)What happens:
Architecture
Before (Operator-Deployed Keycloak)
User → UI → Keycloak (OIDC provider) → Keycloak issues token → Hub validates token
↓
OAuth Proxy
After (Hub as OIDC Provider)
Standalone Mode:
User → UI → Hub (OIDC provider) → Hub issues token → User authenticated
Federated Mode (with IdentityProvider CR):
User → UI → Hub (OIDC provider) → External IdP (validates user) → Hub issues token
LLM Proxy Routing:
UI → Hub reverse proxy → LLM Proxy
↑ (validates token, forwards user identity)
Breaking Changes
None (Graceful Migration)
This PR is designed for zero-downtime upgrades:
Manual Steps for Users (Optional)
To remove operator-deployed Keycloak after upgrade:
Users can optionally clean up operator-deployed Keycloak resources after confirming the new OIDC flow works:
And the Secret:
Or LdapProvider CR for LDAP:
And you'd need to create the Secret separately:
Testing
Test Scenarios Validated
Upgrade Path
Automatic Migration
When upgrading an existing Tackle installation with operator-deployed Keycloak:
Result: Zero downtime, existing users continue working seamlessly.
Benefits
For Operators
For Users
For Developers
Checklist