keys

package
v0.19.1237 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountCtxKey           string = "account"
	AccountIDCtxKey         string = "account_id"
	BlobServiceCtxKey       string = "blob_service"
	CfgCtxKey               string = "config"
	IsGlobalKey             string = "is_global"
	InstallWorkflowCtxKey   string = "workflow"
	FlowCtxKey              string = "flow"
	IsEmployeeCtxKey        string = "is_employee"
	LoggerFieldsCtxKey      string = "logger_fields"
	LogStreamCtxKey         string = "log_stream"
	MetricsKey              string = "metrics"
	OrgCtxKey               string = "org"
	OrgIDCtxKey             string = "org_id"
	OffPaginationCtxKey     string = "offset_pagination"
	IsPublicKey             string = "is_public"
	RunnerCtxKey            string = "runner"
	RunnerIDCtxKey          string = "runner_id"
	DisableViewCtxKey       string = "disable_view"
	PatcherCtxKey           string = "patcher"
	TraceIDCtxKey           string = "trace_id"
	FlowWorkflowIDCtxKey    string = "flow_workflow_id"
	FlowInstallIDCtxKey     string = "flow_install_id"
	WorkflowTelemetryCtxKey string = "workflow_telemetry"
	QueueIDCtxKey           string = "queue_id"
	OrgSelectorCtxKey       string = "mcp_org_selector"
	TokenRoleCtxKey         string = "token_role"
)

All of the context keys are defined here so we can use them in different contexts.

While most every package can use the cctx helpers directly, since they do leverage models, anything in the models that needs information from the context can not rely on that package directly, otherwise a circular dependency will be created.

Variables

This section is empty.

Functions

func CreatedByIDFromContext added in v0.19.850

func CreatedByIDFromContext(ctx context.Context) string

CreatedByIDFromContext returns the account ID from context. Returns empty string if not set. This is safe to call from leaf packages that cannot import the full cctx package due to circular dependencies.

func FlowInstallIDFromContext added in v0.19.1075

func FlowInstallIDFromContext(ctx context.Context) string

func FlowWorkflowIDFromContext added in v0.19.1075

func FlowWorkflowIDFromContext(ctx context.Context) string

func OrgIDFromContext added in v0.19.850

func OrgIDFromContext(ctx context.Context) string

OrgIDFromContext returns the org ID from context. Returns empty string if not set. This is safe to call from leaf packages that cannot import the full cctx package due to circular dependencies.

func TokenRoleFromContext added in v0.19.1150

func TokenRoleFromContext(ctx context.Context) string

TokenRoleFromContext returns the authenticating token's role, or "" if unset.

func WithOrgSelector added in v0.19.1150

func WithOrgSelector(ctx context.Context, fn OrgSelectFunc) context.Context

WithOrgSelector attaches an org-selector to the context.

func WithTokenRole added in v0.19.1150

func WithTokenRole(ctx context.Context, role string) context.Context

WithTokenRole attaches the authenticating token's org role/scope to the context (e.g. org_read_only, org_support, org_admin).

Types

type OrgSelectFunc added in v0.19.1150

type OrgSelectFunc func(orgID string)

OrgSelectFunc persists the selected org for the authenticated MCP token. It is injected by the MCP server so leaf tool handlers (in other packages) can change the active org without importing the server package.

func OrgSelectorFromContext added in v0.19.1150

func OrgSelectorFromContext(ctx context.Context) OrgSelectFunc

OrgSelectorFromContext returns the org-selector, or nil if none is set (e.g. outside the MCP server).

type WorkflowTelemetry added in v0.19.1197

type WorkflowTelemetry struct {
	OrgID        string `json:"org_id,omitempty"`
	OrgName      string `json:"org_name,omitempty"`
	WorkflowID   string `json:"workflow_id,omitempty"`
	WorkflowType string `json:"workflow_type,omitempty"`
	OwnerID      string `json:"owner_id,omitempty"`
	OwnerType    string `json:"owner_type,omitempty"`
	OwnerName    string `json:"owner_name,omitempty"`
	InstallID    string `json:"install_id,omitempty"`
	InstallName  string `json:"install_name,omitempty"`
}

func (WorkflowTelemetry) Merge added in v0.19.1197

Merge returns t with every non-empty field of overlay applied, so a caller holding partial identity never erases fields resolved further upstream.

Jump to

Keyboard shortcuts

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