resources

package
v0.4.0-rc.21 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package resources owns the per-user, owner-scoped view of the sluggable proxy resources (connections, MCP servers, exec endpoints): the list of resources a principal owns, across all of their agents, with how many agents currently bind each one. It is read-only — resources are created and credentialed from an agent's needs (see service/needs); this surface is the owner's inventory, the connection/exec analogue of the git-credentials list.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resource

type Resource struct {
	ID         uuid.UUID
	Type       string // connection | mcp_server | exec_endpoint
	Slug       string
	Name       string
	AuthMode   string
	Authorized bool
	AgentCount int32
	CreatedAt  pgtype.Timestamptz
	LastUsedAt pgtype.Timestamptz
}

Resource is the wire shape for one owned resource. No secret material is carried — only what the owner inventory renders.

type Service

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

func New

func New(d *db.DB, logger *zap.Logger) *Service

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, p authz.Principal, typ string, id uuid.UUID) error

Delete removes an owned resource. Its grants cascade and any binding need's pointer is nulled, so dependent agents fall back to an unbound need.

func (*Service) List

func (s *Service) List(ctx context.Context, p authz.Principal) ([]Resource, error)

List returns every connection / MCP server / exec endpoint owned by the caller's grantee set, with the agent-bind count for each. Self-scoped: the owner filter is the caller's own grantee set, so there is no cross-owner exposure and no agent-axis gate.

func (*Service) Revoke

func (s *Service) Revoke(ctx context.Context, p authz.Principal, typ string, id uuid.UUID) error

Revoke clears the stored credentials of an owned connection or MCP server, affecting every agent that binds it. Exec endpoints carry no credentials.

Jump to

Keyboard shortcuts

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