Compare commits

..
Author SHA1 Message Date
Jørgen StensrudandClaude Opus 5.5 03a1cebf17 feat(keycloak): audience mapper for forte-drop-mcp on forte-cli (fallback)
/ test (pull_request) Successful in 23s
Adds an oidc-audience-mapper to the forte-cli client so its access
tokens carry aud=https://mcp.drop.forteapps.net/mcp, the audience the
forte-drop-mcp auth sidecar verifies. Fallback for the case where
Keycloak ignores the RFC 8707 resource= parameter the skill sends.
Stacks on #26.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 11:11:36 +02:00
Jørgen StensrudandClaude Fable 5.1 46eab199ee Add forte-cli public device-code Keycloak client
/ test (pull_request) Successful in 7s
Add a shared public client `forte-cli` to the `forte` realm so downloaded
skills (forte-drop first) can do RFC 8628 device-code login through the
Auth Sidecar. Today no client in the realm has the device grant enabled,
so the flow cannot start.

Client (inline in forte-realm.json, imported verbatim by keycloak-config-cli):
- publicClient: true, standardFlowEnabled: false,
  directAccessGrantsEnabled: false
- attributes: oauth2.device.authorization.grant.enabled=true
- no secret, no redirectUris/webOrigins, no k8s.secret.sync

It has to go in the realm JSON because the self-service registrar
hardcodes publicClient:false/standardFlowEnabled:true and drops
attributes. Also add forte-cli to the cleanup CronJob's protected list
(belt-and-braces; it does not match the UUID pattern anyway).

Additive only: gitea/grafana/argocd and all other realm settings are
unchanged. Keycloak is deployed only via the upc-dev overlay, which
inherits base values, so this lands on id.forteapps.net.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QciXev3MtCxo3eomcfrDRW
2026-09-03 09:56:31 +02:00
13 changed files with 56 additions and 108 deletions
@@ -7,8 +7,7 @@ metadata:
namespace: mcp10x
spec:
encryptedData:
BENKEN_CLIENT_SECRET: AgBjps8BCn20C8upAaAdb1fG4Qh3eKBbTeFuuWhQb8WoIvHmk+v03mw8i39evkQwlUWvLBWV1mtGiKwpCNhmAAdicRFG6u0m30+21K6ZtYqtKEniPKo/kjPd9nDbtxvIwiaqKs+kv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+vWtpP9ZZ/31MXELuu/ho3Wn9Q==
template:
metadata:
creationTimestamp: null
+5 -5
View File
@@ -1,24 +1,24 @@
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.16.0/.schema/devbox.schema.json",
"packages": [
"kubectl@1.36.3",
"kubectl@1.33.2",
"kubernetes-helm@3.18.4",
"k9s@0.50.7",
"kubeseal@0.30.0",
"argocd@2.14.11",
"kubecm@0.33.1",
"kubectl-tree@0.6.0",
"kubectl-tree@0.4.3",
"kind@0.29.0",
"kustomize@5.7.0",
"kyverno@1.14.3",
"syft@1.29.0",
"grype@0.92.2",
"traefik@3.6.7",
"claude-code@0.2.122",
"claude-code@latest",
"go@latest",
"dotnet-sdk@2.1.810",
"dotnet-sdk@latest",
"opentofu@1.11.6",
"_1password@1.12.2",
"_1password@latest",
"github-cli@latest",
"upcloud-cli@3.29.0",
"awscli2@2.34.24"
+6
View File
@@ -1469,6 +1469,12 @@ ArgoCD will sync the Keycloak config, and the registrar CronJob will pick up the
| `k8s.secret.client-id-key` | No | `client-id` | Field name for the client ID in the K8s Secret |
| `k8s.secret.client-secret-key` | No | `client-secret` | Field name for the client secret in the K8s Secret |
#### Public CLI Client (Device-Code Login)
`forte-cli` is a shared **public** client (no secret) with the RFC 8628 device-authorization grant enabled (`oauth2.device.authorization.grant.enabled: "true"`, `standardFlowEnabled: false`, `directAccessGrantsEnabled: false`). Downloaded skills and CLI tools that log in through the Auth Sidecar (forte-drop first) use it with `<PREFIX>_CLIENT_ID=forte-cli`; nothing per-tool needs to be registered in Keycloak.
It must be defined in `forte-realm.json` (this legacy path): the self-service registrar hardcodes `publicClient: false` / `standardFlowEnabled: true` and drops `attributes`, so a `client-config` Secret cannot produce a public device-code client. It carries no `k8s.secret.sync` attribute (the registrar's secret sync skips it) and is listed in the cleanup CronJob's protected clients.
### Retrieving Secrets for External Deployments
The registrar always writes a **central copy** of every synced secret to the `secrets` namespace, in addition to the target namespace. This allows operators to retrieve client credentials for applications deployed outside this cluster:
+1 -1
View File
@@ -17,7 +17,7 @@ spec:
sources:
- repoURL: https://fluent.github.io/helm-charts
chart: fluent-bit
targetRevision: 0.58.2
targetRevision: 0.47.10
helm:
releaseName: fluent-bit
valueFiles:
+1 -1
View File
@@ -36,7 +36,7 @@ spec:
source:
chart: kyverno
repoURL: https://kyverno.github.io/kyverno/
targetRevision: 3.9.1
targetRevision: v3.7.0 # Update to latest stable version
helm:
releaseName: kyverno
valuesObject:
+1 -1
View File
@@ -17,7 +17,7 @@ spec:
sources:
- repoURL: https://grafana.github.io/helm-charts
chart: loki
targetRevision: "7.0.0"
targetRevision: "6.0.0"
helm:
releaseName: loki
valueFiles:
+1 -1
View File
@@ -17,7 +17,7 @@ spec:
sources:
- repoURL: ghcr.io/renovatebot/charts
chart: renovate
targetRevision: "46.318.0"
targetRevision: "46.109.0"
helm:
releaseName: renovate
valueFiles:
+2 -2
View File
@@ -16,8 +16,8 @@ spec:
source:
chart: sealed-secrets
repoURL: https://bitnami.github.io/sealed-secrets
targetRevision: 2.20.0
repoURL: https://bitnami-labs.github.io/sealed-secrets
targetRevision: 2.16.2 # Update to latest stable version
helm:
releaseName: sealed-secrets
parameters:
+1 -1
View File
@@ -17,7 +17,7 @@ spec:
sources:
- repoURL: https://helm.releases.hashicorp.com
chart: vault
targetRevision: "0.34.1"
targetRevision: "0.32.0"
helm:
releaseName: vault
valueFiles:
+36 -12
View File
@@ -186,6 +186,35 @@ keycloakConfigCli:
}
}
]
},
{
"clientId": "forte-cli",
"name": "Forte CLI",
"description": "Shared public client for RFC 8628 device-code login from downloaded skills/CLI tools (forte-drop first) against services behind Auth Sidecar. No client secret.",
"enabled": true,
"protocol": "openid-connect",
"standardFlowEnabled": false,
"directAccessGrantsEnabled": false,
"publicClient": true,
"redirectUris": [],
"webOrigins": [],
"attributes": {
"oauth2.device.authorization.grant.enabled": "true"
},
"protocolMappers": [
{
"name": "audience-forte-drop-mcp",
"protocol": "openid-connect",
"protocolMapper": "oidc-audience-mapper",
"consentRequired": false,
"config": {
"included.custom.audience": "https://mcp.drop.forteapps.net/mcp",
"access.token.claim": "true",
"id.token.claim": "false",
"introspection.token.claim": "true"
}
}
]
}
],
"browserFlow": "browser-auto-idp",
@@ -290,7 +319,6 @@ extraDeploy:
namespace: keycloak
spec:
schedule: "*/2 * * * *"
timeZone: "Europe/Oslo"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 3
@@ -303,7 +331,7 @@ extraDeploy:
restartPolicy: Never
containers:
- name: registrar
image: alpine:3.24
image: alpine:3.20
command: [ "/bin/sh", "-c" ]
args:
- |
@@ -618,9 +646,7 @@ extraDeploy:
name: keycloak-client-cleanup
namespace: keycloak
spec:
schedule: "0 3 1 * *"
timeZone: "Europe/Oslo"
startingDeadlineSeconds: 3600
schedule: "0 3 * * 0"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 3
@@ -633,7 +659,7 @@ extraDeploy:
restartPolicy: Never
containers:
- name: cleanup
image: alpine:3.24
image: alpine:3.20
command: [ "/bin/sh", "-c" ]
args:
- |
@@ -671,21 +697,19 @@ extraDeploy:
MIN_AGE_SEC=$((MIN_AGE_DAYS * 86400))
# Hardcoded protected clients (never delete these)
PROTECTED_JSON='["gitea","grafana","argocd","vaultwarden","account","account-console","admin-cli","broker","realm-management","security-admin-console"]'
PROTECTED_JSON='["gitea","grafana","argocd","forte-cli","vaultwarden","account","account-console","admin-cli","broker","realm-management","security-admin-console"]'
echo "Fetching clients from realm '${REALM}'..."
CLIENTS=$(curl -sf -H "Authorization: Bearer ${TOKEN}" \
"${KEYCLOAK_URL}/admin/realms/${REALM}/clients")
CANDIDATES=$(echo "$CLIENTS" | jq -c --argjson protected "$PROTECTED_JSON" \
--argjson now "$NOW_SEC" --argjson min_age "$MIN_AGE_SEC" --arg pattern "$CLIENT_ID_PATTERN" '
CANDIDATES=$(echo "$CLIENTS" | jq -c --argjson protected "$PROTECTED_JSON" --argjson now "$NOW_SEC" --argjson min_age "$MIN_AGE_SEC" --arg pattern "$CLIENT_ID_PATTERN" '
[
.[]
| select(.clientId as $cid | $protected | index($cid) | not)
| select(.attributes["k8s.secret.sync"] != "true")
| select(.clientId | test($pattern; "i"))
| select(.attributes["client.secret.creation.time"] != null)
| select((.attributes["client.secret.creation.time"] | tonumber) < ($now - $min_age))
| select((.createdTimestamp // 0) / 1000 < ($now - $min_age))
]
')
@@ -733,7 +757,7 @@ extraDeploy:
- name: DRY_RUN
value: "false"
- name: MIN_AGE_DAYS
value: "60"
value: "15"
volumeMounts:
- name: keycloak-credentials
mountPath: /secrets
-9
View File
@@ -17,14 +17,7 @@ loki:
period: 24h
object_store: filesystem # we're storing on filesystem so there's no real persistence here.
schema: v13
compactor:
working_directory: /var/loki/compactor
retention_enabled: true
delete_request_store: filesystem
compaction_interval: 10m
retention_delete_delay: 2h
limits_config:
retention_period: 168h # 7 days
reject_old_samples: true
reject_old_samples_max_age: 168h
ingestion_rate_mb: 15
@@ -35,8 +28,6 @@ chunksCache:
resultsCache:
enabled: false
singleBinary:
persistence:
size: 20Gi
replicas: 1
resources:
requests:
-5
View File
@@ -21,11 +21,6 @@ renovate:
"assignees": ["danijel.simeunovic"],
"reviewers": ["danijel.simeunovic"]
},
{
"matchRepositories": ["**/launchpad"],
"assignees": ["danijel.simeunovic"],
"reviewers": ["danijel.simeunovic"]
},
{
"matchRepositories": ["**/forte-helm"],
"assignees": ["danijel.simeunovic"],
-67
View File
@@ -1,67 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
"group:allNonMajor",
":dependencyDashboard",
":semanticCommits"
],
"timezone": "Europe/Oslo",
"labels": ["renovate"],
"reviewers": ["danijel.simeunovic"],
"prConcurrentLimit": 10,
"prHourlyLimit": 4,
"minimumReleaseAge": "3 days",
"ignorePaths": [
"**/*-sealed.yaml",
"cluster-resources/policies/**",
"private/**",
".devbox/**"
],
"argocd": {
"description": "ArgoCD Applications live under infra/, apps/ and the root app-of-apps files. The manager skips any file without an argoproj.io apiVersion, so matching broadly is safe.",
"managerFilePatterns": [
"/^_app-of-apps-.+\\.yaml$/",
"/^apps/.+\\.yaml$/",
"/^infra/.+\\.yaml$/"
]
},
"helm-values": {
"description": "Values files are named <app>-values.yaml, not the default values.yaml.",
"managerFilePatterns": ["/^infra/values/.+\\.ya?ml$/"]
},
"kubernetes": {
"description": "Plain manifests with inline image references. Kyverno policies are excluded via ignorePaths - their images are Go templates, not tags.",
"managerFilePatterns": [
"/^cluster-resources/.+\\.yaml$/",
"/^apps/.+/resources/.+\\.yaml$/"
]
},
"packageRules": [
{
"description": "Every Application carries a second source pointing at this repo at HEAD for $values. HEAD is not a version.",
"matchDatasources": ["git-tags"],
"matchDepNames": ["/forteapps\\.net/"],
"enabled": false
},
{
"description": "Platform chart majors usually carry values-schema or CRD breaks - flag them for a careful read.",
"matchFileNames": ["infra/**"],
"matchUpdateTypes": ["major"],
"labels": ["renovate", "breaking-change"],
"minimumReleaseAge": "7 days"
},
{
"description": "Patch-level platform bumps are routine - let them through faster.",
"matchFileNames": ["infra/**"],
"matchUpdateTypes": ["patch"],
"minimumReleaseAge": "1 day"
}
]
}