type

PluginEndpointContext

type PluginEndpointContext struct { // Writer receives the endpoint response. Writer http.ResponseWriter // Request is the original namespaced HTTP request. Request *http.Request // ClientIP is the direct or trusted-forwarded client address resolved by // the framework HTTP boundary. Authentication transports should use this // value instead of interpreting forwarding headers independently. ClientIP string // Actor is the authenticated user, or nil for an anonymous request. Actor *store.Document // ActorCollection identifies the auth collection that owns Actor. ActorCollection schema.CollectionSlug // Local enters the same access-controlled operation engine as other APIs. Local *LocalAPI // AdmitAuthAttempt applies the application's distributed IP and identity // admission policy. Authentication transports must call it before work that // can be amplified by aliases or repeated requests. AdmitAuthAttempt func(context.Context, string, string) error // ReportError records a stable transport error code and sends trusted error // detail to HandlerOptions.RequestError without exposing it to the client. // Plugins that implement their own error envelopes should call this for // internal failures. Passing nil records only Code in request observations. ReportError func(error, string) }

Authenticated HTTP and LocalAPI context for a plugin endpoint.

Source core/plugin.go:206

@param Writer
Receives the endpoint response.
@param Request
The original namespaced HTTP request.
@param ClientIP
The framework-resolved direct or trusted-forwarded client address.
@param Actor
The authenticated user, or nil for an anonymous request.
@param ActorCollection
Identifies the auth collection owning Actor.
@param Local
Enters the ordinary access-controlled operation engine.
@param AdmitAuthAttempt
Applies distributed IP and identity admission before amplifiable authentication work.
@param ReportError
Records a stable code and trusted diagnostic detail without exposing it to the client.

Related types

  • Document

    A stored document with status and version metadata.

  • CollectionSlug

    A validated collection or global slug.

  • LocalAPI

    In-process content operations that share the REST authorization and lifecycle pipeline.