The SecretAccessStrategy determines whether the current user is allowed to see the decrypted value of a custom field or config arg. By default, writing a secret is governed by the entity's normal / permission and only reading is gated, but a custom strategy may apply finer-grained logic based on the entity, field or operation.
CreateUpdateThis is configured via the systemOptions.secretAccessStrategy property of your VendureConfig.
InjectableStrategy(ctx: RequestContext, input: SecretAccessInput) => boolean | Promise<boolean>Returns true if the operation is permitted. When it returns false for a read, the API
returns a redaction placeholder instead of the decrypted value.
The default SecretAccessStrategy. Reading a secret's decrypted value requires the
Permission.ReadSecret permission (held by the SuperAdmin by default). Writing a secret is not
gated here — it is governed by the entity's own Create/Update permission.
SecretAccessStrategy(ctx: RequestContext, input: SecretAccessInput) => booleanThe details of the secret value being accessed, passed to SecretAccessStrategy. This is a
discriminated union on kind: a secret is either a secret custom field on an entity, or a
secret config arg on a configurable operation. Each variant carries only the information that is
actually available in that context, so there are no fields that are sometimes populated and
sometimes not.
Architecture reviews, custom plugin work, migrations, ongoing support. Get a hand from the team that builds Vendure.
Talk to the teamsecret