Skip to content

feat(openfga): derive the pc-applications values - #680

Open
NJona wants to merge 3 commits into
mainfrom
jona/openfga-pc-apps-values
Open

feat(openfga): derive the pc-applications values#680
NJona wants to merge 3 commits into
mainfrom
jona/openfga-pc-apps-values

Conversation

@NJona

@NJona NJona commented Aug 12, 2026

Copy link
Copy Markdown
Member

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.

@NJona NJona self-assigned this Aug 12, 2026
@NJona
NJona requested a review from NautiluX August 12, 2026 08:08
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
NJona force-pushed the jona/openfga-install-config branch from 5d4c44e to c2bc728 Compare August 12, 2026 11:16
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
NJona force-pushed the jona/openfga-pc-apps-values branch from 95cda58 to 4b11a1c Compare August 12, 2026 11:17
Comment thread internal/installer/openfga_pc_apps.go Outdated
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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split it up, authnValues is its own function now and carries that paragraph (entry point is down to 4 lines).

Comment thread internal/installer/openfga_pc_apps.go Outdated
Base automatically changed from jona/openfga-install-config to main August 13, 2026 09:35
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>
@NJona
NJona requested a review from NautiluX August 13, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants