access

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package access asks the access virtual workspace which workspaces a caller can see.

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 resolves a caller's workspaces from the access virtual workspace.

Results are cached per identity for CacheTTL, because a single MCP session makes many tool calls and each one needs the same list. The cache is the reason an HTTP hop is acceptable here at all.

func New

func New(opts Options) (*Client, error)

New returns a Client. It does not contact the access virtual workspace; failures surface on the first Workspaces call.

func (*Client) Invalidate

func (c *Client) Invalidate(u user.Info)

Invalidate drops any cached answer for u.

func (*Client) Workspaces

func (c *Client) Workspaces(ctx context.Context, u user.Info) ([]Workspace, error)

Workspaces returns the workspaces u may use, from cache when fresh.

type Options

type Options struct {
	// BaseURL is the access virtual workspace's address, up to and including
	// its /services/access prefix.
	BaseURL string

	// CAFile verifies the access VW's serving certificate. Empty uses the
	// system pool.
	CAFile string

	// Impersonator is this server's own credential. SelfClusterAccessReview
	// answers for whoever the request authenticates as, so asking on a caller's
	// behalf means impersonating them.
	Impersonator *rest.Config

	// CacheTTL bounds how long an answer is reused per caller.
	CacheTTL time.Duration
}

Options configures a Client.

type Workspace

type Workspace struct {
	Name     string
	Endpoint string
}

Workspace is one workspace a caller may use.

Jump to

Keyboard shortcuts

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