feat(openfga): derive the pc-applications values - #680
Open
NJona wants to merge 3 commits into
Open
Conversation
One OpenFGA instance serves a whole installation, so in a multi-data-center
setup exactly one data center deploys and publishes it and the others only
point at it. That is an installation-level decision rather than a chart
detail, so operators express it in config.yaml:
codesphere:
openFga:
deploy: true
apiUrl: https://openfga.1.cs.example.com
expose:
enabled: true
host: openfga.1.cs.example.com
Validation rejects the combinations that cannot work: a data center that
does not deploy OpenFGA has nowhere to fall back to and must name the
instance it uses, an exposed one needs a host, and a data center cannot
expose an OpenFGA it does not deploy.
Nothing reads the block yet; deriving the pc-applications values from it
follows separately.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Jona Neef <Jona.Neef.97@gmail.com>
NJona
force-pushed
the
jona/openfga-install-config
branch
from
August 12, 2026 11:16
5d4c44e to
c2bc728
Compare
Turns the codesphere.openFga block into values for the openfga application: whether pc-applications deploys OpenFGA here, and the gateway that publishes it, with the certificate following the installation's own cert issuer. The derived values are the base — an explicit pcApps block in config.yaml and --pc-apps-values still win over them. Authentication is not configured but read off the vault: OpenFGA requires the preshared key exactly when the installation has one. An installation whose vault predates the key stays unauthenticated and keeps working, and the Codesphere services decide the same way from the same entry, so the two cannot disagree. Services that started before the key existed pick it up when their pods roll. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Jona Neef <Jona.Neef.97@gmail.com>
NJona
force-pushed
the
jona/openfga-pc-apps-values
branch
from
August 12, 2026 11:17
95cda58 to
4b11a1c
Compare
NautiluX
reviewed
Aug 13, 2026
Comment on lines
+15
to
+31
| // OpenFgaPcAppsValues translates the customer-facing codesphere.openFga block of the install | ||
| // config into pc-applications values. | ||
| // | ||
| // OpenFGA is deployed by pc-applications, but whether a data center runs its own instance and | ||
| // whether that instance is published is an installation-level decision, not a chart detail — so | ||
| // operators configure it in config.yaml and this derives the chart values from it. The result is | ||
| // the *base* of the pc-apps values: an explicit `pcApps` block in config.yaml and any | ||
| // --pc-apps-values file still override it. | ||
| // | ||
| // Authentication follows the vault rather than the config: OpenFGA requires the preshared key | ||
| // exactly when the installation has one, which keeps it in step with the Codesphere services | ||
| // (they take the same key from the same vault entry, and treat it as optional). Pods that were | ||
| // started before the key existed keep running without it until the release rolls out, so an | ||
| // installation that adds the key mid-life restarts its Codesphere services. | ||
| // | ||
| // Returns nil when neither the config nor the vault says anything about OpenFGA, leaving the | ||
| // pc-applications chart defaults untouched. |
Member
There was a problem hiding this comment.
this is a loooooong comment. Wondering if either the code can explain some of this or if we can make the code more obvious if it's not self-explanatory
Member
Author
There was a problem hiding this comment.
Split it up, authnValues is its own function now and carries that paragraph (entry point is down to 4 lines).
The doc comment on OpenFgaPcAppsValues explained three things at once. Two of them belong to the parts they describe, so authnValues is now its own function next to gatewayValues and takes the paragraph about following the vault with it, leaving the entry point with what it actually does. It also says so when it finds no key: an installation that keeps running unauthenticated should hear about it while that is still optional. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Jona Neef <Jona.Neef.97@gmail.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.
Turns the codesphere.openFga block into values for the openfga application: whether pc-applications deploys OpenFGA here, and the gateway that publishes it, with the certificate following the installation's own cert issuer. The derived values are the base — an explicit pcApps block in config.yaml and --pc-apps-values still win over them.
Authentication is not configured but read off the vault: OpenFGA requires the preshared key exactly when the installation has one. An installation whose vault predates the key stays unauthenticated and keeps working, and the Codesphere services decide the same way from the same entry, so the two cannot disagree. Services that started before the key existed pick it up when their pods roll.