boundary

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a small SDK-backed Boundary client for bndry workflows.

func NewClient

func NewClient(addr string, token string) *Client

NewClient creates a Boundary client.

func (*Client) AddGrantToRole

func (c *Client) AddGrantToRole(ctx context.Context, roleID string, targetID string) error

AddGrantToRole grants authorize-session on the target.

func (*Client) AddHostSetToTarget

func (c *Client) AddHostSetToTarget(ctx context.Context, targetID string, hostSetID string) error

AddHostSetToTarget attaches a host set to a target.

func (*Client) AddHostsToSet

func (c *Client) AddHostsToSet(ctx context.Context, hostSetID string, hostIDs ...string) error

AddHostsToSet attaches one or more hosts to a host set.

func (*Client) AddPrincipalToRole

func (c *Client) AddPrincipalToRole(ctx context.Context, roleID string, principalID string) error

AddPrincipalToRole adds a user or managed group principal to a role.

func (*Client) ConnectSSH

func (c *Client) ConnectSSH(ctx context.Context, targetID, username, hostAlias string) error

ConnectSSH starts an interactive SSH session using a target ID.

func (*Client) CreateRole

func (c *Client) CreateRole(ctx context.Context, scopeID string, name string) (Role, error)

CreateRole creates a role in the supplied scope.

func (*Client) CreateSSHBundle

func (c *Client) CreateSSHBundle(ctx context.Context, req CreateSSHBundleRequest) (*CreatedSSHBundle, error)

CreateSSHBundle performs the full host -> host set -> target -> role workflow.

func (*Client) CreateStaticHost

func (c *Client) CreateStaticHost(ctx context.Context, catalogID string, name string, address string) (Host, error)

CreateStaticHost creates a host in a static catalog.

func (*Client) CreateStaticHostCatalog

func (c *Client) CreateStaticHostCatalog(ctx context.Context, scopeID string, name string) (HostCatalog, error)

CreateStaticHostCatalog creates a static host catalog.

func (*Client) CreateStaticHostSet

func (c *Client) CreateStaticHostSet(ctx context.Context, catalogID string, name string) (HostSet, error)

CreateStaticHostSet creates a static host set.

func (*Client) CreateTCPTarget

func (c *Client) CreateTCPTarget(ctx context.Context, scopeID string, name string, port int) (Target, error)

CreateTCPTarget creates a TCP target, suitable for SSH.

func (*Client) InspectTarget

func (c *Client) InspectTarget(ctx context.Context, targetID string) (*TargetInspection, error)

InspectTarget returns the target plus resolved host sources, host sets, and hosts.

func (*Client) ListScopes

func (c *Client) ListScopes(ctx context.Context) ([]Scope, error)

ListScopes returns all scopes recursively from global.

func (*Client) ListTargets

func (c *Client) ListTargets(ctx context.Context, scopeID string) ([]Target, error)

ListTargets lists targets for a scope.

func (*Client) StartOIDCAuth

func (c *Client) StartOIDCAuth(ctx context.Context, authMethodID string) (*OIDCAuthStart, error)

StartOIDCAuth starts an interactive OIDC authentication flow.

func (*Client) WaitForOIDCToken

func (c *Client) WaitForOIDCToken(ctx context.Context, authMethodID string, tokenID string) (string, error)

WaitForOIDCToken polls Boundary until the OIDC flow returns an auth token.

type CreateSSHBundleRequest

type CreateSSHBundleRequest struct {
	ScopeID     string
	CatalogName string
	HostName    string
	HostAddress string
	HostSetName string
	TargetName  string
	Port        int
	CreateRole  bool
	RoleName    string
	PrincipalID string
}

CreateSSHBundleRequest contains the input for the guided SSH setup flow.

type CreatedSSHBundle

type CreatedSSHBundle struct {
	Catalog HostCatalog
	Host    Host
	HostSet HostSet
	Target  Target
	Role    *Role
}

CreatedSSHBundle contains the resources created during setup.

type Host

type Host struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Address     string   `json:"address"`
	Type        string   `json:"type,omitempty"`
	HostSetIDs  []string `json:"host_set_ids,omitempty"`
	IPAddresses []string `json:"ip_addresses,omitempty"`
	DNSNames    []string `json:"dns_names,omitempty"`
}

Host represents a static host entry.

type HostCatalog

type HostCatalog struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Type    string `json:"type"`
	ScopeID string `json:"scope_id"`
}

HostCatalog represents a static host catalog.

type HostSet

type HostSet struct {
	ID            string   `json:"id"`
	Name          string   `json:"name"`
	Type          string   `json:"type"`
	HostCatalogID string   `json:"host_catalog_id,omitempty"`
	HostIDs       []string `json:"host_ids,omitempty"`
}

HostSet represents a static host set.

type OIDCAuthStart

type OIDCAuthStart struct {
	AuthMethodID string
	AuthURL      string
	TokenID      string
}

OIDCAuthStart contains the values needed to complete an OIDC login.

type Role

type Role struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	ScopeID string `json:"scope_id"`
}

Role represents a Boundary role.

type Scope

type Scope struct {
	ID            string `json:"id"`
	Name          string `json:"name"`
	Type          string `json:"type"`
	ParentScopeID string `json:"parent_scope_id"`
}

Scope represents a Boundary scope.

func FilterProjectScopes

func FilterProjectScopes(scopes []Scope) []Scope

FilterProjectScopes returns only project scopes.

type Target

type Target struct {
	ID            string   `json:"id"`
	Name          string   `json:"name"`
	Type          string   `json:"type"`
	ScopeID       string   `json:"scope_id"`
	DefaultPort   int      `json:"default_port"`
	Address       string   `json:"address,omitempty"`
	HostSourceIDs []string `json:"host_source_ids,omitempty"`
}

Target represents a Boundary target.

func FindTargetByName

func FindTargetByName(targets []Target, name string) (Target, bool)

FindTargetByName locates a target using an exact or case-insensitive name match.

func FindTargetsByName

func FindTargetsByName(targets []Target, name string) []Target

FindTargetsByName returns all exact matches, or case-insensitive matches when no exact match exists.

type TargetHostSourceDetails

type TargetHostSourceDetails struct {
	HostSet     HostSet     `json:"host_set"`
	HostCatalog HostCatalog `json:"host_catalog"`
	Hosts       []Host      `json:"hosts,omitempty"`
}

TargetHostSourceDetails describes one host set attached to a target.

type TargetInspection

type TargetInspection struct {
	Target      Target                    `json:"target"`
	HostSources []TargetHostSourceDetails `json:"host_sources,omitempty"`
}

TargetInspection contains the target plus its backing host source details.

Jump to

Keyboard shortcuts

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