pub struct ScopePermissionMap { /* private fields */ }Expand description
The production S3-scope permission map. See the module docs for the injective/exact contract and the registry-determinism rule.
Implementations§
Source§impl ScopePermissionMap
impl ScopePermissionMap
Sourcepub fn new<C, N>(
subject_type: SubjectType,
objects: impl IntoIterator<Item = (C, N)>,
) -> Self
pub fn new<C, N>( subject_type: SubjectType, objects: impl IntoIterator<Item = (C, N)>, ) -> Self
Build the map for subject_type over a closed object registry of
(class, name) pairs (e.g. ("model", "llama")). Duplicates collapse;
ids are assigned 0..n over the sorted registry (deterministic across
nodes given the same registry).
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Is the registry empty? (An empty registry grants nothing — fail-closed.)
Sourcepub fn object_type(&self, class: &str, name: &str) -> Option<ObjectType>
pub fn object_type(&self, class: &str, name: &str) -> Option<ObjectType>
Look up a registered object’s interned id (PEP-side interning: the PEP
resolves the same (class, name) to the same id the compiler used).
Trait Implementations§
Source§impl Clone for ScopePermissionMap
impl Clone for ScopePermissionMap
Source§fn clone(&self) -> ScopePermissionMap
fn clone(&self) -> ScopePermissionMap
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScopePermissionMap
impl Debug for ScopePermissionMap
Source§impl PermissionMap for ScopePermissionMap
impl PermissionMap for ScopePermissionMap
Source§fn permissions_for(&self, cap: &Capability) -> BTreeSet<TeRule>
fn permissions_for(&self, cap: &Capability) -> BTreeSet<TeRule>
The TE rules a single capability grants. Empty for an unrecognized
capability — it grants nothing (fail-closed; never a wildcard rule).
Source§fn granted_access(&self, rule: &TeRule) -> Option<AccessRequest>
fn granted_access(&self, rule: &TeRule) -> Option<AccessRequest>
The most-permissive concrete access a rule grants at runtime, used to check
the rule against the grant.
None for an unrecognized rule (treated as an
escalation). Must be deterministic and independent of permissions_for.Auto Trait Implementations§
impl Freeze for ScopePermissionMap
impl RefUnwindSafe for ScopePermissionMap
impl Send for ScopePermissionMap
impl Sync for ScopePermissionMap
impl Unpin for ScopePermissionMap
impl UnsafeUnpin for ScopePermissionMap
impl UnwindSafe for ScopePermissionMap
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<T> JaggedSlice<T> for T
impl<T> JaggedSlice<T> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more