pub struct OrganizationPlugin { /* private fields */ }Expand description
Organization plugin for multi-tenancy support
Implementations§
Source§impl OrganizationPlugin
impl OrganizationPlugin
Sourcepub fn add_member_endpoint(
body: &AddOrganizationMemberRequest,
) -> AuthResult<ServerEndpoint<BasicMemberResponse>>
pub fn add_member_endpoint( body: &AddOrganizationMemberRequest, ) -> AuthResult<ServerEndpoint<BasicMemberResponse>>
Privileged server-only admission through actual installed hooks.
§Errors
Returns an error if serialization fails.
Sourcepub fn remove_member_endpoint(
body: &RemoveMemberRequest,
) -> AuthResult<ServerEndpoint<RemovedMemberResponse<OrganizationMemberRemovalSnapshot>>>
pub fn remove_member_endpoint( body: &RemoveMemberRequest, ) -> AuthResult<ServerEndpoint<RemovedMemberResponse<OrganizationMemberRemovalSnapshot>>>
Remove a member using genuine verified credentials and installed hooks.
§Errors
Returns an error if serialization fails.
Sourcepub fn create_endpoint(
body: &CreateOrganizationRequest,
user_id: Option<&str>,
) -> AuthResult<ServerEndpoint<CreateOrganizationResponse<CreatedOrganizationResponse, BasicMemberResponse>>>
pub fn create_endpoint( body: &CreateOrganizationRequest, user_id: Option<&str>, ) -> AuthResult<ServerEndpoint<CreateOrganizationResponse<CreatedOrganizationResponse, BasicMemberResponse>>>
Create through logical dispatch; an explicit user ID is a trusted server option.
§Errors
Returns an error if serialization fails.
Sourcepub fn delete_endpoint(
body: &DeleteOrganizationRequest,
) -> AuthResult<ServerEndpoint<Option<OrganizationResponse>>>
pub fn delete_endpoint( body: &DeleteOrganizationRequest, ) -> AuthResult<ServerEndpoint<Option<OrganizationResponse>>>
Delete through installed hooks and scoped organization authority.
§Errors
Returns an error if serialization fails.
Source§impl OrganizationPlugin
impl OrganizationPlugin
Sourcepub fn list_organizations_endpoint() -> ServerEndpoint<Vec<OrganizationResponse>>
pub fn list_organizations_endpoint() -> ServerEndpoint<Vec<OrganizationResponse>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn update_endpoint(
input: &UpdateOrganizationRequest,
) -> AuthResult<ServerEndpoint<Option<CreatedOrganizationResponse>>>
pub fn update_endpoint( input: &UpdateOrganizationRequest, ) -> AuthResult<ServerEndpoint<Option<CreatedOrganizationResponse>>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn get_organization_endpoint(
input: &GetOrganizationQuery,
) -> AuthResult<ServerEndpoint<Option<OrganizationResponse>>>
pub fn get_organization_endpoint( input: &GetOrganizationQuery, ) -> AuthResult<ServerEndpoint<Option<OrganizationResponse>>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn get_full_organization_endpoint(
input: &GetFullOrganizationQuery,
) -> AuthResult<ServerEndpoint<Option<FullOrganizationResponse<OrganizationResponse, InvitationView>>>>
pub fn get_full_organization_endpoint( input: &GetFullOrganizationQuery, ) -> AuthResult<ServerEndpoint<Option<FullOrganizationResponse<OrganizationResponse, InvitationView>>>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn check_slug_endpoint(
input: &CheckSlugRequest,
) -> AuthResult<ServerEndpoint<CheckSlugResponse>>
pub fn check_slug_endpoint( input: &CheckSlugRequest, ) -> AuthResult<ServerEndpoint<CheckSlugResponse>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn set_active_endpoint(
input: &SetActiveOrganizationRequest,
) -> AuthResult<ServerEndpoint<Option<OrganizationResponse>>>
pub fn set_active_endpoint( input: &SetActiveOrganizationRequest, ) -> AuthResult<ServerEndpoint<Option<OrganizationResponse>>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn leave_endpoint(
input: &LeaveOrganizationRequest,
) -> AuthResult<ServerEndpoint<SuccessResponse>>
pub fn leave_endpoint( input: &LeaveOrganizationRequest, ) -> AuthResult<ServerEndpoint<SuccessResponse>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn create_invitation_endpoint(
input: &InviteMemberRequest,
) -> AuthResult<ServerEndpoint<InvitationView>>
pub fn create_invitation_endpoint( input: &InviteMemberRequest, ) -> AuthResult<ServerEndpoint<InvitationView>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn invite_member_endpoint(
input: &InviteMemberRequest,
) -> AuthResult<ServerEndpoint<InvitationView>>
pub fn invite_member_endpoint( input: &InviteMemberRequest, ) -> AuthResult<ServerEndpoint<InvitationView>>
Construct an invitation through the canonical server API.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn get_invitation_endpoint(
input: &GetInvitationQuery,
) -> AuthResult<ServerEndpoint<GetInvitationResponse<InvitationView>>>
pub fn get_invitation_endpoint( input: &GetInvitationQuery, ) -> AuthResult<ServerEndpoint<GetInvitationResponse<InvitationView>>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn list_invitations_endpoint(
input: &ListInvitationsQuery,
) -> AuthResult<ServerEndpoint<Vec<InvitationView>>>
pub fn list_invitations_endpoint( input: &ListInvitationsQuery, ) -> AuthResult<ServerEndpoint<Vec<InvitationView>>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn list_user_invitations_endpoint(
input: &ListUserInvitationsQuery,
) -> AuthResult<ServerEndpoint<Vec<UserInvitationResponse<InvitationView>>>>
pub fn list_user_invitations_endpoint( input: &ListUserInvitationsQuery, ) -> AuthResult<ServerEndpoint<Vec<UserInvitationResponse<InvitationView>>>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn accept_invitation_endpoint(
input: &AcceptInvitationRequest,
) -> AuthResult<ServerEndpoint<AcceptInvitationResponse<InvitationView, BasicMemberResponse>>>
pub fn accept_invitation_endpoint( input: &AcceptInvitationRequest, ) -> AuthResult<ServerEndpoint<AcceptInvitationResponse<InvitationView, BasicMemberResponse>>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn reject_invitation_endpoint(
input: &RejectInvitationRequest,
) -> AuthResult<ServerEndpoint<AcceptInvitationResponse<InvitationView, Option<BasicMemberResponse>>>>
pub fn reject_invitation_endpoint( input: &RejectInvitationRequest, ) -> AuthResult<ServerEndpoint<AcceptInvitationResponse<InvitationView, Option<BasicMemberResponse>>>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn cancel_invitation_endpoint(
input: &CancelInvitationRequest,
) -> AuthResult<ServerEndpoint<InvitationView>>
pub fn cancel_invitation_endpoint( input: &CancelInvitationRequest, ) -> AuthResult<ServerEndpoint<InvitationView>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn get_active_member_endpoint() -> ServerEndpoint<MemberResponse>
pub fn get_active_member_endpoint() -> ServerEndpoint<MemberResponse>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn get_active_member_role_endpoint(
input: &GetActiveMemberRoleQuery,
) -> AuthResult<ServerEndpoint<GetActiveMemberRoleResponse>>
pub fn get_active_member_role_endpoint( input: &GetActiveMemberRoleQuery, ) -> AuthResult<ServerEndpoint<GetActiveMemberRoleResponse>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn list_members_endpoint(
input: &ListMembersQuery,
) -> AuthResult<ServerEndpoint<ListMembersResponse>>
pub fn list_members_endpoint( input: &ListMembersQuery, ) -> AuthResult<ServerEndpoint<ListMembersResponse>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn update_member_role_endpoint(
input: &UpdateMemberRoleRequest,
) -> AuthResult<ServerEndpoint<BasicMemberResponse>>
pub fn update_member_role_endpoint( input: &UpdateMemberRoleRequest, ) -> AuthResult<ServerEndpoint<BasicMemberResponse>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn has_permission_endpoint(
input: &HasPermissionRequest,
) -> AuthResult<ServerEndpoint<HasPermissionResponse>>
pub fn has_permission_endpoint( input: &HasPermissionRequest, ) -> AuthResult<ServerEndpoint<HasPermissionResponse>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn create_team_endpoint(
input: &CreateTeamRequest,
) -> AuthResult<ServerEndpoint<Team>>
pub fn create_team_endpoint( input: &CreateTeamRequest, ) -> AuthResult<ServerEndpoint<Team>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn update_team_endpoint(
input: &UpdateTeamRequest,
) -> AuthResult<ServerEndpoint<Team>>
pub fn update_team_endpoint( input: &UpdateTeamRequest, ) -> AuthResult<ServerEndpoint<Team>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn remove_team_endpoint(
input: &RemoveTeamRequest,
) -> AuthResult<ServerEndpoint<MessageResponse>>
pub fn remove_team_endpoint( input: &RemoveTeamRequest, ) -> AuthResult<ServerEndpoint<MessageResponse>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn set_active_team_endpoint(
input: &SetActiveTeamRequest,
) -> AuthResult<ServerEndpoint<Option<Team>>>
pub fn set_active_team_endpoint( input: &SetActiveTeamRequest, ) -> AuthResult<ServerEndpoint<Option<Team>>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn add_team_member_endpoint(
input: &TeamMemberRequest,
) -> AuthResult<ServerEndpoint<TeamMember>>
pub fn add_team_member_endpoint( input: &TeamMemberRequest, ) -> AuthResult<ServerEndpoint<TeamMember>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn remove_team_member_endpoint(
input: &TeamMemberRequest,
) -> AuthResult<ServerEndpoint<MessageResponse>>
pub fn remove_team_member_endpoint( input: &TeamMemberRequest, ) -> AuthResult<ServerEndpoint<MessageResponse>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn list_organization_teams_endpoint(
input: &TeamQuery,
) -> AuthResult<ServerEndpoint<Vec<Team>>>
pub fn list_organization_teams_endpoint( input: &TeamQuery, ) -> AuthResult<ServerEndpoint<Vec<Team>>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn list_teams_endpoint(
input: &TeamQuery,
) -> AuthResult<ServerEndpoint<Vec<Team>>>
pub fn list_teams_endpoint( input: &TeamQuery, ) -> AuthResult<ServerEndpoint<Vec<Team>>>
Construct a team listing through the canonical server API.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn list_user_teams_endpoint(
input: &TeamQuery,
) -> AuthResult<ServerEndpoint<Vec<Team>>>
pub fn list_user_teams_endpoint( input: &TeamQuery, ) -> AuthResult<ServerEndpoint<Vec<Team>>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn list_team_members_endpoint(
input: &TeamQuery,
) -> AuthResult<ServerEndpoint<Vec<TeamMember>>>
pub fn list_team_members_endpoint( input: &TeamQuery, ) -> AuthResult<ServerEndpoint<Vec<TeamMember>>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn create_org_role_endpoint(
input: &CreateRoleRequest,
) -> AuthResult<ServerEndpoint<CreateRoleResponse>>
pub fn create_org_role_endpoint( input: &CreateRoleRequest, ) -> AuthResult<ServerEndpoint<CreateRoleResponse>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn create_role_endpoint(
input: &CreateRoleRequest,
) -> AuthResult<ServerEndpoint<CreateRoleResponse>>
pub fn create_role_endpoint( input: &CreateRoleRequest, ) -> AuthResult<ServerEndpoint<CreateRoleResponse>>
Construct role creation through the canonical server API.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn update_org_role_endpoint(
input: &UpdateRoleRequest,
) -> AuthResult<ServerEndpoint<UpdateRoleResponse>>
pub fn update_org_role_endpoint( input: &UpdateRoleRequest, ) -> AuthResult<ServerEndpoint<UpdateRoleResponse>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn update_role_endpoint(
input: &UpdateRoleRequest,
) -> AuthResult<ServerEndpoint<UpdateRoleResponse>>
pub fn update_role_endpoint( input: &UpdateRoleRequest, ) -> AuthResult<ServerEndpoint<UpdateRoleResponse>>
Construct a role update through the canonical server API.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn delete_org_role_endpoint(
input: &RoleQuery,
) -> AuthResult<ServerEndpoint<SuccessResponse>>
pub fn delete_org_role_endpoint( input: &RoleQuery, ) -> AuthResult<ServerEndpoint<SuccessResponse>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn delete_role_endpoint(
input: &RoleQuery,
) -> AuthResult<ServerEndpoint<SuccessResponse>>
pub fn delete_role_endpoint( input: &RoleQuery, ) -> AuthResult<ServerEndpoint<SuccessResponse>>
Construct role deletion through the canonical server API.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn get_org_role_endpoint(
input: &RoleQuery,
) -> AuthResult<ServerEndpoint<RoleResponse>>
pub fn get_org_role_endpoint( input: &RoleQuery, ) -> AuthResult<ServerEndpoint<RoleResponse>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn get_role_endpoint(
input: &RoleQuery,
) -> AuthResult<ServerEndpoint<RoleResponse>>
pub fn get_role_endpoint( input: &RoleQuery, ) -> AuthResult<ServerEndpoint<RoleResponse>>
Construct a role read through the canonical server API.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn list_org_roles_endpoint(
input: &RoleQuery,
) -> AuthResult<ServerEndpoint<Vec<RoleResponse>>>
pub fn list_org_roles_endpoint( input: &RoleQuery, ) -> AuthResult<ServerEndpoint<Vec<RoleResponse>>>
Construct a typed native call through installed dispatch hooks.
§Errors
Returns a serialization error for input that cannot be represented.
Sourcepub fn list_roles_endpoint(
input: &RoleQuery,
) -> AuthResult<ServerEndpoint<Vec<RoleResponse>>>
pub fn list_roles_endpoint( input: &RoleQuery, ) -> AuthResult<ServerEndpoint<Vec<RoleResponse>>>
Construct a role listing through the canonical server API.
§Errors
Returns a serialization error for input that cannot be represented.
Source§impl OrganizationPlugin
impl OrganizationPlugin
Sourcepub async fn list_user_invitations(
&self,
ctx: &AuthContext<impl AuthSchema>,
email: &str,
) -> AuthResult<Vec<UserInvitationResponse<InvitationView>>>
pub async fn list_user_invitations( &self, ctx: &AuthContext<impl AuthSchema>, email: &str, ) -> AuthResult<Vec<UserInvitationResponse<InvitationView>>>
List pending invitations for an email through a trusted server-side call.
This method accepts an application-authorized email without a session. The HTTP endpoint instead derives the email from a verified session and rejects client email selectors.
§Errors
Returns errors from input validation, permission checks, storage, or configured organization hooks.
Source§impl OrganizationPlugin
impl OrganizationPlugin
Sourcepub async fn create_team<S: AuthSchema>(
&self,
ctx: &AuthContext<S>,
data: CreateTeam,
) -> AuthResult<Team>
pub async fn create_team<S: AuthSchema>( &self, ctx: &AuthContext<S>, data: CreateTeam, ) -> AuthResult<Team>
Controlled server-side creation; the organization is explicit and no request principal is fabricated.
§Errors
Returns errors from input validation, permission checks, storage, or configured organization hooks.
Sourcepub async fn create_team_with_headers<S: AuthSchema>(
&self,
ctx: &AuthContext<S>,
headers: &HashMap<String, String>,
data: CreateTeam,
) -> AuthResult<Team>
pub async fn create_team_with_headers<S: AuthSchema>( &self, ctx: &AuthContext<S>, headers: &HashMap<String, String>, data: CreateTeam, ) -> AuthResult<Team>
Create a team with the actual signed-cookie principal from supplied headers. This low-level server API enforces the same organization permissions as HTTP; builder-wide dispatch hooks and API-key session injection require normal dispatch.
§Errors
Returns an error if authentication, authorization, policy, hooks, or storage fail.
Sourcepub async fn remove_team_with_headers<S: AuthSchema>(
&self,
ctx: &AuthContext<S>,
headers: &HashMap<String, String>,
organization_id: &str,
team_id: &str,
) -> AuthResult<()>
pub async fn remove_team_with_headers<S: AuthSchema>( &self, ctx: &AuthContext<S>, headers: &HashMap<String, String>, organization_id: &str, team_id: &str, ) -> AuthResult<()>
Remove a team with the actual signed-cookie principal from supplied headers. Current active-team and organization permission checks also apply to server calls. This low-level helper does not execute builder-wide dispatch hooks.
§Errors
Returns an error if authentication, authorization, hooks, or storage fail.
Sourcepub async fn remove_team<S: AuthSchema>(
&self,
ctx: &AuthContext<S>,
organization_id: &str,
team_id: &str,
) -> AuthResult<()>
pub async fn remove_team<S: AuthSchema>( &self, ctx: &AuthContext<S>, organization_id: &str, team_id: &str, ) -> AuthResult<()>
§Errors
Returns errors from input validation, permission checks, storage, or configured organization hooks.
Source§impl OrganizationPlugin
impl OrganizationPlugin
pub fn new() -> Self
pub fn with_config(config: OrganizationConfig) -> Self
pub fn allow_user_to_create_organization(self, val: bool) -> Self
pub fn organization_limit(self, val: f64) -> Self
pub fn creator_role(self, val: impl Into<String>) -> Self
pub fn invitation_expires_in(self, val: f64) -> Self
pub fn cancel_pending_invitations_on_reinvite(self, val: bool) -> Self
pub fn disable_organization_deletion(self, val: bool) -> Self
pub fn require_email_verification_on_invitation(self, val: bool) -> Self
Source§impl OrganizationPlugin
impl OrganizationPlugin
Sourcepub async fn add_member_with_headers<S: AuthSchema>(
&self,
ctx: &AuthContext<S>,
headers: &HashMap<String, String>,
body: &AddOrganizationMemberRequest,
) -> AuthResult<BasicMemberResponse>
pub async fn add_member_with_headers<S: AuthSchema>( &self, ctx: &AuthContext<S>, headers: &HashMap<String, String>, body: &AddOrganizationMemberRequest, ) -> AuthResult<BasicMemberResponse>
Trusted server-only member admission. Explicit organization and target IDs do not require a caller session; optional signed headers provide active organization fallback and authority for a functional team-limit callback. This helper never registers a public authentication route and does not run builder-wide dispatch hooks or API-key virtual-session injection.
§Errors
Returns an error if membership validation, permission checks, admission hooks, or persistence fail.
Sourcepub async fn remove_member_with_headers<S: AuthSchema>(
&self,
ctx: &AuthContext<S>,
headers: &HashMap<String, String>,
body: &RemoveMemberRequest,
) -> AuthResult<RemovedMemberResponse<OrganizationMemberRemovalSnapshot>>
pub async fn remove_member_with_headers<S: AuthSchema>( &self, ctx: &AuthContext<S>, headers: &HashMap<String, String>, body: &RemoveMemberRequest, ) -> AuthResult<RemovedMemberResponse<OrganizationMemberRemovalSnapshot>>
Remove through a real signed-cookie session supplied by the application. This low-level helper shares HTTP business logic but does not execute builder-wide before/after dispatch hooks or API-key session injection.
§Errors
Returns an error if membership authorization, removal hooks, or persistence fail.
Sourcepub async fn delete_organization_with_headers<S: AuthSchema>(
&self,
ctx: &AuthContext<S>,
headers: &HashMap<String, String>,
body: &DeleteOrganizationRequest,
) -> AuthResult<Option<OrganizationResponse>>
pub async fn delete_organization_with_headers<S: AuthSchema>( &self, ctx: &AuthContext<S>, headers: &HashMap<String, String>, body: &DeleteOrganizationRequest, ) -> AuthResult<Option<OrganizationResponse>>
Delete using an actual signed-cookie session from supplied headers, without manufacturing an HTTP request for lifecycle callbacks. This low-level plugin helper does not execute builder-wide before/after dispatch hooks; API-key-only session injection requires normal authenticated dispatch. None represents a missing organization after its membership was resolved.
§Errors
Returns an error if organization authorization, deletion hooks, or persistence fail.
Sourcepub async fn create_organization_for_user<S: AuthSchema>(
&self,
ctx: &AuthContext<S>,
user_id: &str,
body: &CreateOrganizationRequest,
) -> AuthResult<CreateOrganizationResponse<CreatedOrganizationResponse, BasicMemberResponse>>
pub async fn create_organization_for_user<S: AuthSchema>( &self, ctx: &AuthContext<S>, user_id: &str, body: &CreateOrganizationRequest, ) -> AuthResult<CreateOrganizationResponse<CreatedOrganizationResponse, BasicMemberResponse>>
Trusted server operation. The supplied user ID is resolved from storage; HTTP creation always uses the authenticated principal instead. Like upstream’s server-only body.userId branch, this bypasses an allow-policy denial while still evaluating that policy and enforcing organization limits.
§Errors
Returns an error if creation policies, organization hooks, or persistence reject the operation.
Trait Implementations§
Source§impl<S: AuthSchema> AuthPlugin<S> for OrganizationPlugin
impl<S: AuthSchema> AuthPlugin<S> for OrganizationPlugin
Source§fn static_openapi_metadata(&self) -> PluginOpenApiMetadata
fn static_openapi_metadata(&self) -> PluginOpenApiMetadata
Source§fn openapi_metadata(&self, ctx: &AuthInitContext<S>) -> PluginOpenApiMetadata
fn openapi_metadata(&self, ctx: &AuthInitContext<S>) -> PluginOpenApiMetadata
Source§fn server_endpoints(&self) -> Vec<EndpointDefinition>
fn server_endpoints(&self) -> Vec<EndpointDefinition>
Source§fn validate_endpoint(
&self,
call: &EndpointCall,
_ctx: &AuthContext<S>,
) -> AuthResult<EndpointInput>
fn validate_endpoint( &self, call: &EndpointCall, _ctx: &AuthContext<S>, ) -> AuthResult<EndpointInput>
Source§fn on_endpoint<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
call: &'life1 EndpointCall,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = AuthResult<EndpointResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_endpoint<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
call: &'life1 EndpointCall,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = AuthResult<EndpointResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn session_fields(&self) -> FieldConfigs
fn session_fields(&self) -> FieldConfigs
Source§fn on_init<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut AuthInitContext<S>,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_init<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut AuthInitContext<S>,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn on_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = AuthResult<Option<AuthResponse>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = AuthResult<Option<AuthResponse>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn rate_limits(&self) -> Vec<PluginRateLimit>
fn rate_limits(&self) -> Vec<PluginRateLimit>
Source§fn endpoint_hooks(&self) -> Vec<&dyn EndpointHook<S>>
fn endpoint_hooks(&self) -> Vec<&dyn EndpointHook<S>>
Source§fn allowed_media_types(&self, _route: &AuthRoute) -> Vec<&'static str>
fn allowed_media_types(&self, _route: &AuthRoute) -> Vec<&'static str>
fn user_fields(&self) -> IndexMap<String, FieldConfig>
fn account_fields(&self) -> IndexMap<String, FieldConfig>
Source§fn on_http_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_req: &'life1 AuthRequest,
_ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_http_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_req: &'life1 AuthRequest,
_ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn on_http_request_action<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<HttpRequestAction>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_http_request_action<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<HttpRequestAction>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
on_http_request implementations. Request-local configuration has already
been resolved from the incoming request, matching the Source HTTP handler.Source§fn on_http_response<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_req: &'life1 AuthRequest,
_ctx: &'life2 AuthContext<S>,
_response: &'life3 AuthResponse,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn on_http_response<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_req: &'life1 AuthRequest,
_ctx: &'life2 AuthContext<S>,
_response: &'life3 AuthResponse,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Source§fn before_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_req: &'life1 AuthRequest,
_ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<BeforeRequestAction>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn before_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_req: &'life1 AuthRequest,
_ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<BeforeRequestAction>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn on_http_endpoint<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<HttpEndpointResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_http_endpoint<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<HttpEndpointResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
on_request; plugins returning a native raw response can
override this method to bypass the endpoint after-hook pipeline.