admin

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyOptions

type ApplyOptions struct {
	DryRun          bool
	Delete          bool
	ContinueOnError bool
	Reconcile       bool
}

type ApplyReport

type ApplyReport struct {
	Results []ApplyResult
	Failed  int
}

type ApplyResult

type ApplyResult struct {
	Resource string `json:"resource"`
	Realm    string `json:"realm,omitempty"`
	Name     string `json:"name"`
	Action   string `json:"action"`
	Status   int    `json:"status"`
	Error    string `json:"error,omitempty"`
}

type Config

type Config struct {
	BaseURL  string
	SpecPath string
	Timeout  time.Duration
}

type Error

type Error struct {
	Kind       ErrorKind
	Operation  string
	Resource   string
	StatusCode int
	Err        error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ErrorKind

type ErrorKind string
const (
	ErrorUnauthorized ErrorKind = "unauthorized"
	ErrorNotFound     ErrorKind = "not-found"
	ErrorConflict     ErrorKind = "conflict"
	ErrorValidation   ErrorKind = "validation"
	ErrorTransport    ErrorKind = "transport"
)

type FetchFailure

type FetchFailure struct {
	Resource string
	Detail   string
	NotFound bool
	Err      error
}

FetchFailure describes a single resource that could not be fetched.

NotFound is true when the underlying error was an HTTP 404, meaning an optional resource is simply absent rather than genuinely broken — for example authorization resources/scopes on a client that does not have authorization services enabled, or organizations on a realm where the feature is disabled. The command layer aggregates these separately from real failures so the output distinguishes "absent" from "broken".

Resource is the resource type (e.g. "scope", "organization") and is used as the aggregation key. Detail carries additional context such as the parent identifier or realm.

func (FetchFailure) String

func (f FetchFailure) String() string

type FetchQuery

type FetchQuery struct {
	Realm                string
	Resources            string
	Search               string
	Max                  int
	Parent               string
	IncludeRelationships bool
	Depth                int
	Filter               string
}

type FetchReport

type FetchReport struct {
	Resources     []manifest.Resource
	Relationships []manifest.RelationshipOperation
	Failures      []FetchFailure
}

type Service

type Service interface {
	Spec() *catalog.Spec
	Fetch(ctx context.Context, query FetchQuery) (FetchReport, error)
	Apply(ctx context.Context, resources []manifest.Resource, relationships []manifest.RelationshipOperation, options ApplyOptions) (ApplyReport, error)
}

Service is the public admin API used by command handlers.

func New

func New(config Config) (Service, error)

Directories

Path Synopsis
Package internal is an implementation detail of the admin module.
Package internal is an implementation detail of the admin module.

Jump to

Keyboard shortcuts

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