Documentation
¶
Overview ¶
Package prerequest defines pre-routing admission handlers for canonical calls.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrRejected = errors.New("lipsdk/prerequest: pre-request rejected")
ErrRejected is returned when a pre-request handler denies the canonical call.
Functions ¶
func IsRejected ¶
IsRejected reports whether err is or wraps a pre-request rejection.
func NewRejectError ¶
NewRejectError returns a stable rejection error for handler decisions.
Types ¶
type Decision ¶
Decision is the outcome of one pre-request handler.
type Handler ¶
type Handler interface {
ID() string
Order() int
FailureMode() sdkhooks.FailureMode
Handle(ctx context.Context, call *lipapi.Call, meta Meta, svc Services) (Decision, error)
}
Handler runs before route planning for the primary model.
func MaterializeSorted ¶
MaterializeSorted returns handlers sorted by Order, ID, and original registration index.
type Meta ¶
type Meta struct {
TraceID string
Annotations map[string]string
Principal execview.PrincipalView
Scope scope.PrincipalScopeView
Session session.SessionView
Workspace workspace.WorkspaceView
AuxiliaryDepth int
}
Meta is read-only request context for pre-request admission handlers. Scope is the authoritative principal/scope attribution for the accepted request, carried separately from the legacy Principal projection (requirement 2.6). A zero Scope preserves local/anonymous/unknown attribution semantics: SubjectKind is the empty string (the zero SubjectKind) and presence-aware Values remain unknown.
type RejectError ¶
RejectError carries a deterministic client-safe rejection message.
func (*RejectError) Error ¶
func (e *RejectError) Error() string
func (*RejectError) Unwrap ¶
func (e *RejectError) Unwrap() error