pub struct TenantValidatingProvider<P> { /* private fields */ }Expand description
Validation wrapper that ensures tenant context is properly handled.
This wrapper validates tenant contexts and provides clear error messages when operations are performed with incorrect tenant contexts.
Implementations§
Source§impl<P> TenantValidatingProvider<P>
impl<P> TenantValidatingProvider<P>
Trait Implementations§
Source§impl<P> ResourceProvider for TenantValidatingProvider<P>
impl<P> ResourceProvider for TenantValidatingProvider<P>
type Error = AdapterError<<P as ResourceProvider>::Error>
Source§fn create_resource(
&self,
resource_type: &str,
data: Value,
context: &RequestContext,
) -> impl Future<Output = Result<Resource, Self::Error>> + Send
fn create_resource( &self, resource_type: &str, data: Value, context: &RequestContext, ) -> impl Future<Output = Result<Resource, Self::Error>> + Send
Create a resource for the tenant specified in the request context. Read more
Source§fn get_resource(
&self,
resource_type: &str,
id: &str,
context: &RequestContext,
) -> impl Future<Output = Result<Option<Resource>, Self::Error>> + Send
fn get_resource( &self, resource_type: &str, id: &str, context: &RequestContext, ) -> impl Future<Output = Result<Option<Resource>, Self::Error>> + Send
Get a resource by ID from the tenant specified in the request context. Read more
Source§fn update_resource(
&self,
resource_type: &str,
id: &str,
data: Value,
context: &RequestContext,
) -> impl Future<Output = Result<Resource, Self::Error>> + Send
fn update_resource( &self, resource_type: &str, id: &str, data: Value, context: &RequestContext, ) -> impl Future<Output = Result<Resource, Self::Error>> + Send
Update a resource in the tenant specified in the request context. Read more
Source§fn delete_resource(
&self,
resource_type: &str,
id: &str,
context: &RequestContext,
) -> impl Future<Output = Result<(), Self::Error>> + Send
fn delete_resource( &self, resource_type: &str, id: &str, context: &RequestContext, ) -> impl Future<Output = Result<(), Self::Error>> + Send
Delete a resource from the tenant specified in the request context. Read more
Source§fn list_resources(
&self,
resource_type: &str,
query: Option<&ListQuery>,
context: &RequestContext,
) -> impl Future<Output = Result<Vec<Resource>, Self::Error>> + Send
fn list_resources( &self, resource_type: &str, query: Option<&ListQuery>, context: &RequestContext, ) -> impl Future<Output = Result<Vec<Resource>, Self::Error>> + Send
List resources from the tenant specified in the request context. Read more
Source§fn find_resource_by_attribute(
&self,
resource_type: &str,
attribute: &str,
value: &Value,
context: &RequestContext,
) -> impl Future<Output = Result<Option<Resource>, Self::Error>> + Send
fn find_resource_by_attribute( &self, resource_type: &str, attribute: &str, value: &Value, context: &RequestContext, ) -> impl Future<Output = Result<Option<Resource>, Self::Error>> + Send
Find a resource by attribute value within the tenant specified in the request context. Read more
Source§fn resource_exists(
&self,
resource_type: &str,
id: &str,
context: &RequestContext,
) -> impl Future<Output = Result<bool, Self::Error>> + Send
fn resource_exists( &self, resource_type: &str, id: &str, context: &RequestContext, ) -> impl Future<Output = Result<bool, Self::Error>> + Send
Check if a resource exists within the tenant specified in the request context. Read more
Source§fn conditional_update(
&self,
resource_type: &str,
id: &str,
data: Value,
expected_version: &ScimVersion,
context: &RequestContext,
) -> impl Future<Output = Result<ConditionalResult<VersionedResource>, Self::Error>> + Sendwhere
Self: Sync,
fn conditional_update(
&self,
resource_type: &str,
id: &str,
data: Value,
expected_version: &ScimVersion,
context: &RequestContext,
) -> impl Future<Output = Result<ConditionalResult<VersionedResource>, Self::Error>> + Sendwhere
Self: Sync,
Conditionally update a resource if the version matches. Read more
Source§fn conditional_delete(
&self,
resource_type: &str,
id: &str,
expected_version: &ScimVersion,
context: &RequestContext,
) -> impl Future<Output = Result<ConditionalResult<()>, Self::Error>> + Sendwhere
Self: Sync,
fn conditional_delete(
&self,
resource_type: &str,
id: &str,
expected_version: &ScimVersion,
context: &RequestContext,
) -> impl Future<Output = Result<ConditionalResult<()>, Self::Error>> + Sendwhere
Self: Sync,
Conditionally delete a resource if the version matches. Read more
Source§fn get_versioned_resource(
&self,
resource_type: &str,
id: &str,
context: &RequestContext,
) -> impl Future<Output = Result<Option<VersionedResource>, Self::Error>> + Sendwhere
Self: Sync,
fn get_versioned_resource(
&self,
resource_type: &str,
id: &str,
context: &RequestContext,
) -> impl Future<Output = Result<Option<VersionedResource>, Self::Error>> + Sendwhere
Self: Sync,
Get a resource with its version information. Read more
Auto Trait Implementations§
impl<P> Freeze for TenantValidatingProvider<P>where
P: Freeze,
impl<P> RefUnwindSafe for TenantValidatingProvider<P>where
P: RefUnwindSafe,
impl<P> Send for TenantValidatingProvider<P>where
P: Send,
impl<P> Sync for TenantValidatingProvider<P>where
P: Sync,
impl<P> Unpin for TenantValidatingProvider<P>where
P: Unpin,
impl<P> UnwindSafe for TenantValidatingProvider<P>where
P: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ResourceProviderExt for Twhere
T: ResourceProvider,
impl<T> ResourceProviderExt for Twhere
T: ResourceProvider,
Source§fn create_single_tenant(
&self,
resource_type: &str,
data: Value,
request_id: Option<String>,
) -> impl Future<Output = Result<Resource, Self::Error>> + Sendwhere
Self: Sync,
fn create_single_tenant(
&self,
resource_type: &str,
data: Value,
request_id: Option<String>,
) -> impl Future<Output = Result<Resource, Self::Error>> + Sendwhere
Self: Sync,
Convenience method for single-tenant resource creation. Read more
Source§fn create_multi_tenant(
&self,
tenant_id: &str,
resource_type: &str,
data: Value,
request_id: Option<String>,
) -> impl Future<Output = Result<Resource, Self::Error>> + Sendwhere
Self: Sync,
fn create_multi_tenant(
&self,
tenant_id: &str,
resource_type: &str,
data: Value,
request_id: Option<String>,
) -> impl Future<Output = Result<Resource, Self::Error>> + Sendwhere
Self: Sync,
Convenience method for multi-tenant resource creation. Read more
Source§impl<T> TenantValidator for T
impl<T> TenantValidator for T
Source§fn validate_tenant_context(
&self,
expected_tenant_id: &str,
context: &RequestContext,
) -> Result<(), String>
fn validate_tenant_context( &self, expected_tenant_id: &str, context: &RequestContext, ) -> Result<(), String>
Validate that the context has the expected tenant.
Source§fn validate_single_tenant_context(
&self,
context: &RequestContext,
) -> Result<(), String>
fn validate_single_tenant_context( &self, context: &RequestContext, ) -> Result<(), String>
Validate that the context is for single-tenant operation.
Source§fn require_tenant_context(&self, context: &RequestContext) -> Result<(), String>
fn require_tenant_context(&self, context: &RequestContext) -> Result<(), String>
Extract tenant context or return error for multi-tenant operations.
Source§impl<P> ToSingleTenant<P> for Pwhere
P: ResourceProvider,
impl<P> ToSingleTenant<P> for Pwhere
P: ResourceProvider,
Source§fn to_single_tenant(self) -> TenantValidatingProvider<P>
fn to_single_tenant(self) -> TenantValidatingProvider<P>
Convert to a provider that validates single-tenant contexts.