config

package
v2.55.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 10 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	// Enabled - UI checks this first before reading your provider config
	Enabled bool `yaml:"enabled"`
	// RedirectToProvider - skip the UI login page and redirect unauthenticated users directly to the auth provider
	RedirectToProvider bool `yaml:"redirectToProvider"`
	// A list of auth providers. Currently enables only the first provider in the list.
	Providers []AuthProvider `yaml:"providers"`
	// MaxSessionDuration - optional maximum session duration. If set, users will be
	// forced to re-login after this duration regardless of token validity.
	// Example values: "8h", "24h", "168h" (1 week). If zero, no max duration is enforced.
	MaxSessionDuration time.Duration `yaml:"maxSessionDuration"`
}

func (*Auth) Validate

func (c *Auth) Validate() error

Validate validates the persistence config

type AuthProvider

type AuthProvider struct {
	// Label - optional label for the provider
	Label string `yaml:"label"`
	// Type of the auth provider. Only OIDC is supported today
	Type string `yaml:"type"`
	// OIDC .well-known/openid-configuration URL, ex. https://accounts.google.com/
	ProviderURL string `yaml:"providerUrl"`
	// IssuerUrl - optional. Needed only when differs from the auth provider URL
	IssuerUrl    string `yaml:"issuerUrl"`
	ClientID     string `yaml:"clientId"`
	ClientSecret string `yaml:"clientSecret"`
	// Scopes for auth. Typically [openid, profile, email]
	Scopes []string `yaml:"scopes"`
	// CallbackURL - URL for the callback URL, ex. https://localhost:8080/sso/callback
	CallbackURL string `yaml:"callbackUrl"`
	// Options added as URL query params when redirecting to auth provider. Can be used to configure custom auth flows such as Auth0 invitation flow.
	Options map[string]interface{} `yaml:"options"`
	// UseIDTokenAsBearer - Use ID token instead of access token as Bearer in Authorization header
	UseIDTokenAsBearer bool `yaml:"useIdTokenAsBearer"`
	// RefreshTokenDuration - optional lifetime of the refresh token this provider issues.
	// It is only needed for providers that issue opaque (non-JWT) refresh tokens, whose
	// lifetime the server cannot read. For JWT refresh tokens the exp claim is used and
	// this value is ignored. If neither is available, a 7 day default applies.
	// Example values: "8h", "24h", "168h" (1 week).
	RefreshTokenDuration time.Duration `yaml:"refreshTokenDuration"`
}

type CORS

type CORS struct {
	AllowOrigins          []string `yaml:"allowOrigins"`
	UnsafeAllowAllOrigins bool     `yaml:"unsafeAllowAllOrigins"`
	// CookieInsecure allows CSRF cookie to be sent to servers that the browser considers
	// unsecured. Useful for cases where the connection is secured via VPN rather than
	// HTTPS directly.
	CookieInsecure bool `yaml:"cookieInsecure"`
}

type Codec

type Codec struct {
	Endpoint            string `yaml:"endpoint"`
	PassAccessToken     bool   `yaml:"passAccessToken"`
	IncludeCredentials  bool   `yaml:"includeCredentials"`
	DefaultErrorMessage string `yaml:"defaultErrorMessage"`
	DefaultErrorLink    string `yaml:"defaultErrorLink"`
}

type Config

type Config struct {
	TemporalGRPCAddress string `yaml:"temporalGrpcAddress"`
	Host                string `yaml:"host"`
	Port                int    `yaml:"port"`
	PublicPath          string `yaml:"publicPath"`
	TLS                 TLS    `yaml:"tls"`
	Auth                Auth   `yaml:"auth"`
	EnableUI            bool   `yaml:"enableUi"`
	CloudUI             bool   `yaml:"cloudUi"`
	UIAssetPath         string `yaml:"uiAssetPath"`
	CORS                CORS   `yaml:"cors"`
	DefaultNamespace    string `yaml:"defaultNamespace"`
	FeedbackURL         string `yaml:"feedbackUrl"`
	DisableNewsFetch    bool   `yaml:"disableNewsFetch"`
	NotifyOnNewVersion  bool   `yaml:"notifyOnNewVersion"`
	// How this server was installed: cli, docker, helm, or server
	Distribution string `yaml:"distribution"`
	// Version of the distribution, such as the CLI or Helm chart version
	DistributionVersion string `yaml:"distributionVersion"`
	// Show temporal-system namespace in namespace selector
	ShowTemporalSystemNamespace bool `yaml:"showTemporalSystemNamespace"`
	// Collapse the left navigation and saved views navigation by default
	NavCollapsedByDefault bool `yaml:"navCollapsedByDefault"`
	// How often to reload the config
	RefreshInterval     time.Duration `yaml:"refreshInterval"`
	Codec               Codec         `yaml:"codec"`
	DisableWriteActions bool          `yaml:"disableWriteActions"`
	// Discrete configuration for Workflow Actions in the UI
	WorkflowTerminateDisabled bool `yaml:"workflowTerminateDisabled"`
	WorkflowCancelDisabled    bool `yaml:"workflowCancelDisabled"`
	WorkflowSignalDisabled    bool `yaml:"workflowSignalDisabled"`
	WorkflowUpdateDisabled    bool `yaml:"workflowUpdateDisabled"`
	WorkflowResetDisabled     bool `yaml:"workflowResetDisabled"`
	WorkflowPauseDisabled     bool `yaml:"workflowPauseDisabled"`
	// Whether bulk/batch actions are enabled in the UI
	BatchActionsDisabled bool `yaml:"batchActionsDisabled"`
	// Whether start workflow is enabled in the UI
	StartWorkflowDisabled bool `yaml:"startWorkflowDisabled"`
	// Whether to hide server errors for workflow queries in UI
	HideWorkflowQueryErrors bool `yaml:"hideWorkflowQueryErrors"`
	// Whether to disable refreshing workflow counts in UI
	RefreshWorkflowCountsDisabled bool `yaml:"refreshWorkflowCountsDisabled"`
	// Whether to disable activity commands in the UI
	ActivityCommandsDisabled bool `yaml:"activityCommandsDisabled"`
	// Custom UI extensions that can mount iframe content into stable UI slots
	CustomUI CustomUI `yaml:"customUi"`
	// Forward specified HTTP headers from HTTP API requests to Temporal gRPC backend
	ForwardHeaders []string `yaml:"forwardHeaders"`
	HideLogs       bool     `yaml:"hideLogs"`
	// TLS configuration options to start UI Server in TLS mode
	UIServerTLS UIServerTLS `yaml:"uiServerTLS"`
}

Config contains the configuration for the UI server

func (*Config) GetConfig

func (c *Config) GetConfig() (*Config, error)

GetConfig implements ConfigProvider.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates this config

type ConfigProvider

type ConfigProvider interface {
	GetConfig() (*Config, error)
}

ConfigProvider serves as a common interface to read UI server configuration.

type ConfigProviderWithRefresh

type ConfigProviderWithRefresh struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewConfigProviderWithRefresh

func NewConfigProviderWithRefresh(cfgProvider ConfigProvider) (*ConfigProviderWithRefresh, error)

func (*ConfigProviderWithRefresh) Close

func (s *ConfigProviderWithRefresh) Close()

func (*ConfigProviderWithRefresh) GetConfig

func (r *ConfigProviderWithRefresh) GetConfig() (*Config, error)

type CustomUI added in v2.55.0

type CustomUI struct {
	Enabled          bool              `yaml:"enabled"`
	IframeExtensions []IframeExtension `yaml:"iframeExtensions"`
}

func (CustomUI) IframeFrameSources added in v2.55.0

func (c CustomUI) IframeFrameSources(authEnabled bool) ([]string, error)

IframeFrameSources returns the canonical origins that may be added to the index response's frame-src directive. Invalid configuration produces no partial allowlist.

func (CustomUI) Validate added in v2.55.0

func (c CustomUI) Validate(authEnabled bool) error

Validate validates custom UI definitions. An extension with any permission is privileged and must use an explicit, dedicated HTTPS origin so the host can address postMessage traffic to a non-opaque origin. "self" is never accepted when authentication is enabled because extension code would then be directly reachable on the origin that stores the UI session.

type Filesystem added in v2.3.0

type Filesystem struct {
	Path string `yaml:"path"`
}

type IframeExtension added in v2.55.0

type IframeExtension struct {
	ID            string                `yaml:"id"`
	Title         string                `yaml:"title"`
	Slot          string                `yaml:"slot"`
	Src           string                `yaml:"src"`
	AllowedOrigin string                `yaml:"allowedOrigin"`
	RoutePatterns []string              `yaml:"routePatterns"`
	Sandbox       IframeSandbox         `yaml:"sandbox"`
	Sizing        IframeExtensionSizing `yaml:"sizing"`
	Permissions   []string              `yaml:"permissions"`
}

type IframeExtensionSizing added in v2.55.0

type IframeExtensionSizing struct {
	DefaultHeight int `yaml:"defaultHeight"`
	MinHeight     int `yaml:"minHeight"`
	MaxHeight     int `yaml:"maxHeight"`
	DefaultWidth  int `yaml:"defaultWidth"`
	MinWidth      int `yaml:"minWidth"`
	MaxWidth      int `yaml:"maxWidth"`
}

type IframeSandbox added in v2.55.0

type IframeSandbox struct {
	AllowDownloads  bool `yaml:"allowDownloads"`
	AllowForms      bool `yaml:"allowForms"`
	AllowModals     bool `yaml:"allowModals"`
	AllowPopups     bool `yaml:"allowPopups"`
	AllowSameOrigin bool `yaml:"allowSameOrigin"`
}

type TLS

type TLS struct {
	CaFile                 string `yaml:"caFile"`
	CertFile               string `yaml:"certFile"`
	KeyFile                string `yaml:"keyFile"`
	CaData                 string `yaml:"caData"`
	CertData               string `yaml:"certData"`
	KeyData                string `yaml:"keyData"`
	EnableHostVerification bool   `yaml:"enableHostVerification"`
	ServerName             string `yaml:"serverName"`
}

type UIServerTLS added in v2.43.0

type UIServerTLS struct {
	CertFile string `yaml:"certFile"`
	KeyFile  string `yaml:"keyFile"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL