pub struct InMemoryRebacManager { /* private fields */ }Expand description
In-memory ReBAC manager Ported from OxiRS for high-performance hot-path authorization
Implementations§
Source§impl InMemoryRebacManager
impl InMemoryRebacManager
Sourcepub async fn with_tuples(tuples: Vec<RelationTuple>) -> Result<Self>
pub async fn with_tuples(tuples: Vec<RelationTuple>) -> Result<Self>
Initialize with predefined tuples (for testing/demo)
Sourcepub async fn add_tuple(&self, tuple: RelationTuple) -> Result<()>
pub async fn add_tuple(&self, tuple: RelationTuple) -> Result<()>
Add a relationship tuple
Sourcepub async fn remove_tuple(&self, tuple: &RelationTuple) -> Result<()>
pub async fn remove_tuple(&self, tuple: &RelationTuple) -> Result<()>
Remove a relationship tuple
Sourcepub async fn check(&self, request: &CheckRequest) -> Result<CheckResponse>
pub async fn check(&self, request: &CheckRequest) -> Result<CheckResponse>
Check if a subject has a relation to an object
Sourcepub async fn list_subject_tuples(
&self,
subject: &Subject,
) -> Result<Vec<RelationTuple>>
pub async fn list_subject_tuples( &self, subject: &Subject, ) -> Result<Vec<RelationTuple>>
List all tuples for a subject
Sourcepub async fn list_object_tuples(
&self,
namespace: &str,
object_id: &str,
) -> Result<Vec<RelationTuple>>
pub async fn list_object_tuples( &self, namespace: &str, object_id: &str, ) -> Result<Vec<RelationTuple>>
List all tuples for an object
Sourcepub async fn batch_check(
&self,
requests: &[CheckRequest],
) -> Result<Vec<CheckResponse>>
pub async fn batch_check( &self, requests: &[CheckRequest], ) -> Result<Vec<CheckResponse>>
Batch check multiple requests
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InMemoryRebacManager
impl !RefUnwindSafe for InMemoryRebacManager
impl Send for InMemoryRebacManager
impl Sync for InMemoryRebacManager
impl Unpin for InMemoryRebacManager
impl !UnwindSafe for InMemoryRebacManager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more