pub struct AtprotoPermissionTranslator { /* private fields */ }Expand description
A configured, fail-closed ATProto OAuth/lexicon → UCAN+MAC translator.
It owns no DID resolver and has no network capability. Enrollment resolves
and pins the DID before this translator is ever called; authorization reads
only EnrolledPeer::context. This keeps did:web/did:plc/PLC resolution out
of the per-operation authorization path by construction.
Implementations§
Source§impl AtprotoPermissionTranslator
impl AtprotoPermissionTranslator
Sourcepub fn new(
mappings: impl IntoIterator<Item = (AtprotoPermission, AtprotoPermissionMapping)>,
) -> Result<Self>
pub fn new( mappings: impl IntoIterator<Item = (AtprotoPermission, AtprotoPermissionMapping)>, ) -> Result<Self>
Build from a closed, locally administered mapping table. Duplicate external permissions are rejected rather than allowing load order to select an authority unexpectedly.
Sourcepub fn translate(
&self,
peer: &EnrolledPeer,
dpop_binding: VerifiedDpopBinding,
permissions: &[AtprotoPermission],
) -> Result<TranslatedAtprotoAuthorization>
pub fn translate( &self, peer: &EnrolledPeer, dpop_binding: VerifiedDpopBinding, permissions: &[AtprotoPermission], ) -> Result<TranslatedAtprotoAuthorization>
Translate verified external permissions into narrowly bounded interior capability requests.
The OAuth resource server must verify DPoP before constructing
dpop_binding; the gateway then requires every permission to have an
exact local mapping and every target label to be dominated by the cached
enrollment context. Any missing mapping, over-clearance request, absent
peer, or malformed binding returns Err — there is no fallback,
wildcard, or default capability.
Trait Implementations§
Source§impl Clone for AtprotoPermissionTranslator
impl Clone for AtprotoPermissionTranslator
Source§fn clone(&self) -> AtprotoPermissionTranslator
fn clone(&self) -> AtprotoPermissionTranslator
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for AtprotoPermissionTranslator
impl Default for AtprotoPermissionTranslator
Source§fn default() -> AtprotoPermissionTranslator
fn default() -> AtprotoPermissionTranslator
Auto Trait Implementations§
impl Freeze for AtprotoPermissionTranslator
impl RefUnwindSafe for AtprotoPermissionTranslator
impl Send for AtprotoPermissionTranslator
impl Sync for AtprotoPermissionTranslator
impl Unpin for AtprotoPermissionTranslator
impl UnsafeUnpin for AtprotoPermissionTranslator
impl UnwindSafe for AtprotoPermissionTranslator
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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>
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