Skip to content

Read configuration and secrets from code

Platform configuration holds an application’s settings, globally or per client (tenant): an SMTP host, a partner’s API key, a per-client SFTP password. Administrators manage it in the console; your application reads it at run time with its service account. Secrets are encrypted at rest and come back masked, except through one audited reveal call. Platform configuration and secrets explains the model; this page is the code.

A value is addressed by application, section and property (orders / smtp / password), plus an optional client (id or identifier). The global value and a client’s value are separate: asking for a client’s value never falls back to the global one.

The built-in application-service role holds config:view, config:update and config:reveal for its own application, confined to the clients it is linked to (its own client list, else the clients its application is enabled for) and the global value. Anything outside that is 403.

v, err := c.PlatformConfig().Get(ctx, "orders", "smtp", "host", "" /* global */)
host := v.Value
perClient, err := c.PlatformConfig().Get(ctx, "orders", "smtp", "host", "acme")

A secret read this way returns the literal *** as its value, for every caller. That mask is not a value.

s, err := c.PlatformConfig().RevealSecret(ctx, "orders", "smtp", "password", "" /* or a client */)
if err != nil { return err }
dial(host, s.Value) // SecretResponse redacts Value in %v, %+v, %#v and slog

Every reveal is audited (who, which property, when, on whose behalf; never the value), and the SDKs neither cache nor log it. The answer has Cache-Control: no-store and an updatedAt.

Caching. Revealing on every use writes an audit row each time. If you keep a secret in memory, keep it briefly, keep it out of logs and error messages, and re-reveal when a use fails with an authentication error (the secret may have been rotated) or when updatedAt changes.

A secret may also be a reference to AWS Secrets Manager or Parameter Store (aws-sm://..., aws-ps://...) when the platform allows it; the reveal returns the secret it points at, resolved by the platform. Your code does not change.

set(app, section, property, value, valueType PLAIN|SECRET, client?) delete(app, section, property, client?)
  • Go: c.PlatformConfig().Set(ctx, "orders", "smtp", "host", &client.SetConfigPropertyRequest{Value: "smtp.example.com"})
  • Java: client.platformConfig().set("orders", "smtp", "host", request)
  • TypeScript: client.platformConfig().set("orders", "smtp", "password", { value, valueType: "SECRET" })
  • PHP: FlowCatalyst::platformConfig()->set('orders', 'smtp', 'host', 'smtp.example.com') (plain by default); delete(...) is idempotent.

Writing *** or an empty value to a secret is refused (400 SECRET_VALUE_MASKED, SECRET_VALUE_REQUIRED): to keep a secret unchanged, do not set it.

When your application changes or reveals configuration because one of its users asked (a settings page in your application, say), pass who: it is sent as X-On-Behalf-Of and recorded in the audit row beside your service account. At most 256 printable characters (400 INVALID_ON_BEHALF_OF); the platform honours it only from service accounts.

ctx = client.WithOnBehalfOf(ctx, user.Email)
s, err := c.PlatformConfig().RevealSecret(ctx, "orders", "smtp", "password", "")

It records who asked; it does not authorise them. Check the person’s permission in your application first.

Answer Meaning
403 Not your application, a client your account is not linked to, or no reveal permission
404 No such property at that scope (remember: no fall-back from client to global)
400 NOT_A_SECRET revealSecret on a plain property; use get
400 SECRET_VALUE_MASKED / SECRET_VALUE_REQUIRED Writing the mask or an empty secret
503 SECRET_REFERENCE_UNAVAILABLE, SECRET_REFERENCE_* An AWS reference could not be resolved