identity

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package identity says who is calling: a person, the AI, an agent or an API token.

Index

Constants

View Source
const (
	KindUser   = "user"
	KindAI     = "ai"
	KindAgent  = "agent"
	KindToken  = "token"
	KindPlugin = "plugin"
)

Variables

This section is empty.

Functions

func With

func With(ctx context.Context, s Subject) context.Context

With makes s the caller for everything run with ctx: a server request's account.

Types

type Subject

type Subject struct {
	Kind   string   `json:"kind"`
	Name   string   `json:"name"`
	Groups []string `json:"groups,omitempty"`
	Roles  []string `json:"roles,omitempty"`
	// Approve lists action globs an agent must get approved even where its writes are otherwise allowed.
	Approve []string `json:"approve,omitempty"`
}

func AI

func AI(on Subject) Subject

AI is the assistant acting for on, with on's roles.

func Agent

func Agent(name string, approve []string, on Subject) Subject

Agent is a rig.yaml agent acting for on, with on's roles.

func From

func From(ctx context.Context) (Subject, bool)

func Local

func Local() Subject

Local is the person at this terminal; locally they own everything.

func (Subject) String

func (s Subject) String() string

Jump to

Keyboard shortcuts

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