pub struct EndpointCall { /* private fields */ }Expand description
Genuine logical endpoint data available to hooks and application callbacks.
Clones share trusted session state, observed snapshots and queued headers. Every public dispatch constructs fresh state; supplied HTTP metadata cannot carry a caller-populated virtual principal into this context.
Implementations§
Source§impl EndpointCall
impl EndpointCall
pub fn new( definition: &EndpointDefinition, body: Option<JsValue>, query: Option<JsValue>, options: EndpointOptions, ) -> Self
Sourcepub fn from_http_request(request: &AuthRequest, route: &AuthRoute) -> Self
pub fn from_http_request(request: &AuthRequest, route: &AuthRoute) -> Self
Logical HTTP endpoint input after physical routing and body parsing. The original physical request remains separate from normalized hook input.
pub fn operation_id(&self) -> &str
pub fn path(&self) -> Option<&str>
pub const fn method(&self) -> Option<&HttpMethod>
pub const fn body(&self) -> Option<&JsValue>
pub const fn query(&self) -> Option<&JsValue>
Sourcepub fn with_params_value(self, params: JsValue) -> Self
pub fn with_params_value(self, params: JsValue) -> Self
Retain supplied logical parameters in every genuine callback frame.
pub const fn params(&self) -> Option<&JsValue>
pub const fn headers(&self) -> Option<&HashMap<String, String>>
Sourcepub fn replace_headers(&mut self, headers: HashMap<String, String>)
pub fn replace_headers(&mut self, headers: HashMap<String, String>)
Replace logical headers after a physical/plugin header transformation. Session state and the distinct physical Request are retained.
pub const fn request(&self) -> Option<&AuthRequest>
pub const fn phase(&self) -> EndpointPhase
pub fn has_body(&self) -> bool
pub fn has_query(&self) -> bool
pub fn has_method(&self) -> bool
Sourcepub fn middleware_context(&self) -> Self
pub fn middleware_context(&self) -> Self
Middleware callbacks have their own path/query defaults; matchers retain raw input.
Sourcepub fn handler_context(
&self,
body: Option<JsValue>,
query: Option<JsValue>,
) -> Self
pub fn handler_context( &self, body: Option<JsValue>, query: Option<JsValue>, ) -> Self
A handler receives validated data and its registered method/path defaults.
pub const fn extensions(&self) -> &RequestExtensions
pub const fn default_method(&self) -> &HttpMethod
pub fn virtual_session(&self) -> Option<SessionView>
Sourcepub fn establish_session<S: AuthSchema>(
&self,
user: S::User,
user_view: UserView,
session: SessionView,
context: &AuthContext<S>,
)
pub fn establish_session<S: AuthSchema>( &self, user: S::User, user_view: UserView, session: SessionView, context: &AuthContext<S>, )
Retain the actual model and snapshot after a trusted hook has authenticated them. This is an application/plugin authority boundary, never client input.
Sourcepub fn session(&self) -> Option<(UserView, SessionView)>
pub fn session(&self) -> Option<(UserView, SessionView)>
Callback-visible authenticated data. This observation does not confer authority.
pub fn record_authenticated_session(&self, user: UserView, session: SessionView)
pub fn authenticated_user<S: AuthSchema>( &self, context: &AuthContext<S>, ) -> Option<S::User>
pub fn set_response_header( &self, name: impl Into<String>, value: impl Into<String>, )
pub fn queue_response_header( &self, name: impl Into<String>, value: impl Into<String>, )
pub fn take_response_headers(&self) -> Headers
pub fn set_session_hook_snapshot(&self, user: UserView, session: SessionView)
pub fn session_hook_snapshot(&self) -> Option<(UserView, SessionView)>
Sourcepub fn body_as<T: DeserializeOwned + 'static>(&self) -> AuthResult<T>
pub fn body_as<T: DeserializeOwned + 'static>(&self) -> AuthResult<T>
§Errors
Returns a typed decoding error for the current, post-hook body.
Sourcepub fn query_as<T: DeserializeOwned + 'static>(&self) -> AuthResult<T>
pub fn query_as<T: DeserializeOwned + 'static>(&self) -> AuthResult<T>
§Errors
Returns a typed decoding error for the current, post-hook query.