agent

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 27 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

Index

Constants

View Source
const DefaultOrigin = "https://id.realmroot.dev"

Variables

View Source
var ErrAuthorizationContextAmbiguous = errors.New("multiple authorization contexts can satisfy the operation")

Functions

func AgentSessionCacheKey added in v0.5.0

func AgentSessionCacheKey() (string, error)

func NewInteractiveResponseMiddleware

func NewInteractiveResponseMiddleware(
	runtime *restish.CLI,
	open func(string) error,
	diagnostics io.Writer,
	noBrowser bool,
	profileName string,
) restish.ResponseMiddleware

NewInteractiveResponseMiddleware handles profiled controller interactions for any Resource Server without knowing its endpoint names.

Types

type AccessOffer

type AccessOffer struct {
	AgentID              string
	Scopes               []string
	ResourceIndicator    string
	AuthorizationDetails []map[string]any
	Endpoint             string
	ProofAlgorithm       string
	ProofMethod          string
	ProofURI             string
}

type AuthorizationContext

type AuthorizationContext struct {
	AuthorizationDetails []map[string]any `json:"authorizationDetails"`
	Scopes               []string         `json:"scopes"`
	Active               bool             `json:"active"`
}

type CredentialBinding

type CredentialBinding struct {
	Reference string
	Scopes    []string
}

type CredentialSource

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

func (*CredentialSource) Describe

func (source *CredentialSource) Describe(ctx context.Context, _, _, _, reference string, scopes []string) (restish.DPoPCredentialDescription, error)

func (*CredentialSource) Issue

func (source *CredentialSource) Issue(ctx context.Context, _, _, _, reference, proof string, scopes []string) (restish.DPoPIssuedCredential, error)

type ExecutionIdentity

type ExecutionIdentity struct {
	Name  string
	Email string
}

type Identity

type Identity struct {
	ID       string `json:"id"`
	Issuer   string `json:"issuer"`
	Subject  string `json:"subject"`
	Username string `json:"username"`
	Nickname string `json:"nickname"`
	Runtime  string `json:"runtime"`
}

type Service

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

func NewService

func NewService(origin string, client *http.Client) (*Service, error)

func (*Service) APIBaseURL

func (s *Service) APIBaseURL() string

func (*Service) AcceptAccessOffer

func (s *Service) AcceptAccessOffer(offer AccessOffer) (CredentialBinding, error)

func (*Service) ActiveBindingForResource

func (s *Service) ActiveBindingForResource(resourceIndicator string) (CredentialBinding, error)

func (*Service) Authenticate

func (s *Service) Authenticate(ctx context.Context, request *http.Request, scopes []string) error

func (*Service) AuthorizationContexts

func (s *Service) AuthorizationContexts(resourceIndicator string) ([]AuthorizationContext, error)

func (*Service) BindingForAuthorizationContext

func (s *Service) BindingForAuthorizationContext(resourceIndicator string, details []map[string]any) (CredentialBinding, AuthorizationContext, error)

func (*Service) BindingForAuthorizationContextAllAuthority

func (s *Service) BindingForAuthorizationContextAllAuthority(resourceIndicator string, details []map[string]any) (CredentialBinding, error)

func (*Service) BindingForAuthorizationContextScopeAlternatives

func (s *Service) BindingForAuthorizationContextScopeAlternatives(resourceIndicator string, details []map[string]any, alternatives [][]string) (CredentialBinding, error)

func (*Service) BindingForReferenceScopeAlternatives

func (s *Service) BindingForReferenceScopeAlternatives(resourceIndicator, reference string, alternatives [][]string) (CredentialBinding, error)

func (*Service) BindingForResource

func (s *Service) BindingForResource(resourceIndicator string) (CredentialBinding, error)

func (*Service) ClearContext

func (s *Service) ClearContext(resourceIndicator string) error

func (*Service) CredentialSource

func (s *Service) CredentialSource() *CredentialSource

func (*Service) Enroll

func (s *Service) Enroll(ctx context.Context, username, nickname string) (Identity, error)

func (*Service) ExecutionBinding

func (s *Service) ExecutionBinding(resourceIndicator string, details []map[string]any) (CredentialBinding, error)

func (*Service) ExecutionIdentity

func (s *Service) ExecutionIdentity(ctx context.Context) (ExecutionIdentity, error)

func (*Service) HTTPClient

func (s *Service) HTTPClient() *http.Client

func (*Service) OpenApproval

func (s *Service) OpenApproval(rawURL string) error

func (*Service) Origin

func (s *Service) Origin() string

func (*Service) RequestEditor

func (s *Service) RequestEditor(scopes ...string) restishRequestEditor

func (*Service) Runtime

func (s *Service) Runtime() (string, error)

func (*Service) SelectAuthorizationContext

func (s *Service) SelectAuthorizationContext(resourceIndicator string, details []map[string]any) (AuthorizationContext, error)

func (*Service) SelectedContext

func (s *Service) SelectedContext(resourceIndicator string) ([]map[string]any, error)

func (*Service) StoreContext

func (s *Service) StoreContext(resourceIndicator string, details []map[string]any) error

func (*Service) WhoAmI

func (s *Service) WhoAmI(ctx context.Context) (Identity, error)

Jump to

Keyboard shortcuts

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