Skip to main content
GuideServerConfigure and deploy Tabsdata servers on your machine.TutorialsConfigure data integration workflows within a running Tabsdata server.Advanced TutorialsBuild end-to-end workflows between two specific systems.API ReferenceCLI ReferenceRelease Notes
Version: 2.0.0

StrOrSecretSpec

type_alias
StrOrSecretSpec: Union[str, Secret]

Resolved type:

str | Secret

Categories: credentials

A connector field that accepts either a plain string or a Secret.

Annotate a connection/source/destination field with it directly.

Each value carries a marker so the two shapes are unambiguous on the wire:

  • "str:<value>" -- a plain string (<value> may be empty);
  • "secret:<value>" -- a secret carrying <value>;
  • ":secret:" -- a secret with no value yet (resolved at run time).

An unmarked string is rejected. After validation a plain arm is a str and a secret arm a Secret, so read the value with a normal str or with Secret.value() respectively. Connector code that must resolve either arm to a concrete value uses the connector-common _convert helper.

Examples

class MyConn(Conn):
bucket: StrOrSecretSpec