connreach

package
v1.167.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 7 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

Overview

Package connreach answers, in the deployment's own terms, which connections one caller's authority reaches.

It is the enumeration a picker is filled from and the enumeration an automatic approval is checked against, and it is one implementation because those two have to agree: a form offering a connection the run then refuses, or an approval refusing a connection the picker offered, are the same defect read from opposite ends.

The persona predicate is connscope's, which delegates to the same persona.ToolFilter rule the authorizer applies to a tool call, so nothing here re-derives what a persona may reach.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// Name is the name a persona's rules match and a tool call's connection
	// argument carries — not always the name the enumeration leads with, since a
	// single-connection toolkit's entry carries its INSTANCE name.
	Name        string
	Kind        string
	Description string
}

Connection is one connection a caller reaches: the value a call binds, and what a person needs to pick it by.

type Deps

type Deps struct {
	// Toolkits is the live toolkit registry. Nil yields a nil Lister, which
	// answers nothing rather than answering "reaches no connection".
	Toolkits *registry.Registry
	// Personas resolves a persona's connection rules. Nil denies every named
	// connection, matching the fail-closed action path.
	Personas *persona.Registry
	// Stored is the connection store, which is what says a connection exists:
	// a picker filled from this process alone offers a different set depending
	// on which replica rendered it (#1757). Nil lists what this process serves.
	Stored connview.StoreLister
}

Deps are the live registries a listing reads. They are held rather than snapshotted, so a connection added or a persona edited through the admin API takes effect on the next call.

type Lister

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

Lister enumerates connections for one caller at a time.

func New

func New(deps Deps) *Lister

New builds a Lister, or nil when there is no toolkit registry to read.

Nil is meaningful: a deployment that cannot enumerate its connections should serve no set at all rather than an empty one, which a form renders as "this reaches nothing" and an approval would read as a refusal.

func (*Lister) ForPersona

func (l *Lister) ForPersona(ctx context.Context, personaName string, unrestricted bool) []Connection

ForPersona lists what one resolved persona reaches. unrestricted lifts the persona boundary for an administrator, whose reach is unrestricted by design.

Jump to

Keyboard shortcuts

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