tenantctx

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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"`
	Forwarders       []Forwarder `yaml:"forwarders,omitempty"`
}

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 Forwarder added in v1.15.0

type Forwarder struct {
	ChainSelector uint64 `yaml:"chain_selector" json:"chainSelector"`
	Address       string `yaml:"address" json:"address"`
}

Forwarder is a chain selector and mock forwarder contract address for the tenant.

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