Documentation
¶
Overview ¶
Package resources owns the per-user inventory and management surface for reusable resources.
Index ¶
- type ConnectorStatus
- type Consumer
- type Grant
- type Resource
- type Service
- func (s *Service) Consumers(ctx context.Context, p authz.Principal, typ string, id uuid.UUID) ([]Consumer, error)
- func (s *Service) Delete(ctx context.Context, p authz.Principal, typ string, id uuid.UUID) error
- func (s *Service) DeleteGrant(ctx context.Context, p authz.Principal, typ string, id, userID uuid.UUID) error
- func (s *Service) List(ctx context.Context, p authz.Principal) ([]Resource, error)
- func (s *Service) ListGrants(ctx context.Context, p authz.Principal, typ string, id uuid.UUID) ([]Grant, error)
- func (s *Service) Rename(ctx context.Context, p authz.Principal, typ string, id uuid.UUID, ...) error
- func (s *Service) Revoke(ctx context.Context, p authz.Principal, typ string, id uuid.UUID) error
- func (s *Service) Transfer(ctx context.Context, p authz.Principal, typ string, id, newOwnerID uuid.UUID) error
- func (s *Service) UpsertGrant(ctx context.Context, p authz.Principal, typ string, id, userID uuid.UUID, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectorStatus ¶ added in v0.6.1
type ConnectorStatus struct {
Readiness string
ReadinessDetail string
Online bool
Lifecycle string
ProtocolMajor int32
ProtocolMinor int32
ArtifactVersion string
ArtifactDigest string
InterfaceHash string
ArtifactFreshness string
UpdateStatus string
LatestArtifactVersion string
LastHeartbeatAt pgtype.Timestamptz
ActiveProvenance string
ActiveObservationState string
ObservedActiveDigest string
InventoryRevision uint64
}
type Consumer ¶
type Consumer struct {
AgentID uuid.UUID
AgentName string
AgentSlug string
NeedType string
NeedSlug string
CanAccessAgent bool
}
Consumer identifies an agent need bound to a resource.
type Grant ¶ added in v0.6.1
type Grant struct {
ID uuid.UUID
UserID uuid.UUID
Email string
DisplayName string
Capabilities []string
CreatedAt pgtype.Timestamptz
}
Grant is a user capability grant. Secret material and principal internals are deliberately absent from this operator-facing shape.
type Resource ¶
type Resource struct {
ID uuid.UUID
Type string // connection | mcp_server | git_credential | connector | host | connector_target_group
OwnerID uuid.UUID
OwnerName string
Slug string
Name string
DisplayName string
AuthMode string
Authorized bool
AgentCount int32
Capabilities []string
CreatedAt pgtype.Timestamptz
HostID uuid.UUID
Connector *ConnectorStatus
}
Resource is one resource available to the caller through ownership or a grant. It carries no secret material.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Consumers ¶
func (s *Service) Consumers(ctx context.Context, p authz.Principal, typ string, id uuid.UUID) ([]Consumer, error)
Consumers lists every agent need bound to a resource. Resource view capability is required; agent membership is not, because the grant controls visibility of this resource-level relationship.
func (*Service) Delete ¶
Delete removes a resource. Connector rows are tombstoned for durable cleanup.
func (*Service) DeleteGrant ¶ added in v0.6.1
func (s *Service) DeleteGrant(ctx context.Context, p authz.Principal, typ string, id, userID uuid.UUID) error
DeleteGrant removes one user's grant without changing resource bindings.
func (*Service) List ¶
List returns resources available through ownership or a resource grant and exposes the caller's capabilities on each one.
func (*Service) ListGrants ¶ added in v0.6.1
func (s *Service) ListGrants(ctx context.Context, p authz.Principal, typ string, id uuid.UUID) ([]Grant, error)
ListGrants returns user grants only to resource managers.
func (*Service) Rename ¶
func (s *Service) Rename(ctx context.Context, p authz.Principal, typ string, id uuid.UUID, displayName string) error
Rename updates a resource's non-unique user-controlled display name.
func (*Service) Transfer ¶ added in v0.6.1
func (s *Service) Transfer(ctx context.Context, p authz.Principal, typ string, id, newOwnerID uuid.UUID) error
Transfer moves ownership to an existing user and records the actor and both owners in the same transaction. Existing grants and agent bindings remain.