pub struct StandardResourceProvider<S: StorageProvider> { /* private fields */ }Expand description
Standard resource provider with pluggable storage backend.
This provider separates SCIM protocol logic from storage concerns by delegating data persistence to a StorageProvider implementation while handling all SCIM-specific business logic, validation, and metadata management.
Implementations§
Source§impl<S: StorageProvider> StandardResourceProvider<S>
impl<S: StorageProvider> StandardResourceProvider<S>
Sourcepub async fn get_stats(&self) -> InMemoryStats
pub async fn get_stats(&self) -> InMemoryStats
Get statistics about stored data.
Source§impl<S: StorageProvider> StandardResourceProvider<S>
impl<S: StorageProvider> StandardResourceProvider<S>
pub async fn conditional_update( &self, resource_type: &str, id: &str, data: Value, expected_version: &ScimVersion, context: &RequestContext, ) -> Result<ConditionalResult<VersionedResource>, InMemoryError>
pub async fn conditional_delete( &self, resource_type: &str, id: &str, expected_version: &ScimVersion, context: &RequestContext, ) -> Result<ConditionalResult<()>, InMemoryError>
pub async fn conditional_patch_resource( &self, resource_type: &str, id: &str, patch_request: &Value, expected_version: &ScimVersion, context: &RequestContext, ) -> Result<ConditionalResult<VersionedResource>, InMemoryError>
pub async fn get_versioned_resource( &self, resource_type: &str, id: &str, context: &RequestContext, ) -> Result<Option<VersionedResource>, InMemoryError>
pub async fn create_versioned_resource( &self, resource_type: &str, data: Value, context: &RequestContext, ) -> Result<VersionedResource, InMemoryError>
Trait Implementations§
Source§impl<S: Clone + StorageProvider> Clone for StandardResourceProvider<S>
impl<S: Clone + StorageProvider> Clone for StandardResourceProvider<S>
Source§fn clone(&self) -> StandardResourceProvider<S>
fn clone(&self) -> StandardResourceProvider<S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S: Debug + StorageProvider> Debug for StandardResourceProvider<S>
impl<S: Debug + StorageProvider> Debug for StandardResourceProvider<S>
Source§impl<S: StorageProvider> ResourceProvider for StandardResourceProvider<S>
impl<S: StorageProvider> ResourceProvider for StandardResourceProvider<S>
Source§fn apply_patch_operation(
&self,
resource_data: &mut Value,
operation: &Value,
) -> Result<(), Self::Error>
fn apply_patch_operation( &self, resource_data: &mut Value, operation: &Value, ) -> Result<(), Self::Error>
Override the default patch operation implementation
Source§type Error = InMemoryError
type Error = InMemoryError
Error type returned by all provider operations
Source§async fn create_resource(
&self,
resource_type: &str,
data: Value,
context: &RequestContext,
) -> Result<Resource, Self::Error>
async fn create_resource( &self, resource_type: &str, data: Value, context: &RequestContext, ) -> Result<Resource, Self::Error>
Create a resource for the tenant specified in the request context. Read more
Source§async fn get_resource(
&self,
resource_type: &str,
id: &str,
context: &RequestContext,
) -> Result<Option<Resource>, Self::Error>
async fn get_resource( &self, resource_type: &str, id: &str, context: &RequestContext, ) -> Result<Option<Resource>, Self::Error>
Get a resource by ID from the tenant specified in the request context. Read more
Source§async fn update_resource(
&self,
resource_type: &str,
id: &str,
data: Value,
context: &RequestContext,
) -> Result<Resource, Self::Error>
async fn update_resource( &self, resource_type: &str, id: &str, data: Value, context: &RequestContext, ) -> Result<Resource, Self::Error>
Update a resource in the tenant specified in the request context. Read more
Source§async fn delete_resource(
&self,
resource_type: &str,
id: &str,
context: &RequestContext,
) -> Result<(), Self::Error>
async fn delete_resource( &self, resource_type: &str, id: &str, context: &RequestContext, ) -> Result<(), Self::Error>
Delete a resource from the tenant specified in the request context. Read more
Source§async fn list_resources(
&self,
resource_type: &str,
query: Option<&ListQuery>,
context: &RequestContext,
) -> Result<Vec<Resource>, Self::Error>
async fn list_resources( &self, resource_type: &str, query: Option<&ListQuery>, context: &RequestContext, ) -> Result<Vec<Resource>, Self::Error>
List resources from the tenant specified in the request context. Read more
Source§async fn find_resource_by_attribute(
&self,
resource_type: &str,
attribute: &str,
value: &Value,
context: &RequestContext,
) -> Result<Option<Resource>, Self::Error>
async fn find_resource_by_attribute( &self, resource_type: &str, attribute: &str, value: &Value, context: &RequestContext, ) -> Result<Option<Resource>, Self::Error>
Find a resource by attribute value within the tenant specified in the request context. Read more
Source§async fn resource_exists(
&self,
resource_type: &str,
id: &str,
context: &RequestContext,
) -> Result<bool, Self::Error>
async fn resource_exists( &self, resource_type: &str, id: &str, context: &RequestContext, ) -> Result<bool, Self::Error>
Check if a resource exists within the tenant specified in the request context. Read more
Source§async fn patch_resource(
&self,
resource_type: &str,
id: &str,
patch_request: &Value,
context: &RequestContext,
) -> Result<Resource, Self::Error>
async fn patch_resource( &self, resource_type: &str, id: &str, patch_request: &Value, context: &RequestContext, ) -> Result<Resource, Self::Error>
Apply PATCH operations to a resource 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<S> Freeze for StandardResourceProvider<S>where
S: Freeze,
impl<S> RefUnwindSafe for StandardResourceProvider<S>where
S: RefUnwindSafe,
impl<S> Send for StandardResourceProvider<S>
impl<S> Sync for StandardResourceProvider<S>
impl<S> Unpin for StandardResourceProvider<S>where
S: Unpin,
impl<S> UnwindSafe for StandardResourceProvider<S>where
S: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.