tenantctx

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ContextFile = "context.yaml"

ContextFile is the filename for the local registry manifest.

Variables

This section is empty.

Functions

func EnsureContext

func EnsureContext(ctx context.Context, creds *credentials.Credentials, envSet *environments.EnvironmentSet, log *zerolog.Logger) error

EnsureContext guarantees the registry manifest exists for the current environment. API key users always fetch fresh; bearer token users use the cached file from login.

func FetchAndWriteContext

func FetchAndWriteContext(ctx context.Context, gqlClient *graphqlclient.Client, envName string, log *zerolog.Logger) error

FetchAndWriteContext fetches the user context from the service and writes the registry manifest to ~/.cre/<ContextFile>.

Types

type EnvironmentContext

type EnvironmentContext struct {
	TenantID         string      `yaml:"tenant_id"`
	DefaultDonFamily string      `yaml:"default_don_family"`
	VaultGatewayURL  string      `yaml:"vault_gateway_url"`
	Registries       []*Registry `yaml:"registries"`
}

EnvironmentContext holds user context for a single CLI environment.

func LoadContext

func LoadContext(envName string) (*EnvironmentContext, error)

LoadContext reads the registry manifest from ~/.cre/<ContextFile> and returns the EnvironmentContext for the given environment name.

func LoadContextFromPath

func LoadContextFromPath(path string, envName string) (*EnvironmentContext, error)

LoadContextFromPath reads the registry manifest at the given path and returns the EnvironmentContext for the given environment name.

type Registry

type Registry struct {
	ID               string   `yaml:"id" json:"id"`
	Label            string   `yaml:"label" json:"label"`
	Type             string   `yaml:"type" json:"type"`
	ChainSelector    *string  `yaml:"chain_selector,omitempty" json:"chainSelector,omitempty"`
	Address          *string  `yaml:"address,omitempty" json:"address,omitempty"`
	SecretsAuthFlows []string `yaml:"secrets_auth_flows" json:"secretsAuthFlows"`
}

Registry represents a single available workflow registry.

Jump to

Keyboard shortcuts

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