Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyOptions ¶
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"`
CreatedID string `json:"createdId,omitempty"`
// contains filtered or unexported fields
}
type ChildFetchQuery ¶ added in v1.3.0
type ChildFetchQuery struct {
// FullRepresentation requests briefRepresentation=false so children that
// carry an attributes map (e.g. client roles) return it, matching the
// representation flag on the realm-level fetch path (ISSUE 0001 parity).
FullRepresentation bool
}
ChildFetchQuery configures a parent-scoped collection fetch (FetchChildren).
type Config ¶
type Config struct {
BaseURL string
SpecPath string
Timeout time.Duration
// Auth optionally injects a custom auth.Service. When nil, admin.New
// falls back to auth.New() (the password-grant default), preserving
// backward compatibility. The syncengine migration injects a
// client_credentials provider here.
Auth auth.Service
}
type FetchFailure ¶
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
ExactMatch bool
// FullRepresentation requests Keycloak's complete resource representation on
// collection fetches by sending briefRepresentation=false. Keycloak's list
// endpoints for users, groups and organizations otherwise return a brief
// representation that omits the attributes map. The false default preserves
// the existing brief behavior.
FullRepresentation bool
}
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)
// FetchChildren returns one child collection of one parent resource (e.g. the
// roles of a client) with exactly one HTTP GET — no depth fan-out and no
// realm-wide reference-resolution sweep. See fetch.go for the contract.
FetchChildren(ctx context.Context, parent manifest.Resource, childType string, query ChildFetchQuery) (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.