pub struct ReadScopeRefusal {
pub resource: String,
pub identifier: Option<String>,
pub scope: ReadScope,
pub status: u16,
}Expand description
A role-scoped read whose answer was decided by the caller’s identity scope rather than by the data.
Carried by AxonFlowError::ReadScope, which exists because “no rows” and
“no identity” are the same bytes on the wire. The platform distinguishes them
in the X-Axonflow-Read-Scope header; this is that distinction made visible,
so a read that could not have succeeded reports a cause instead of a
confident nothing.
Two shapes, told apart by ReadScopeRefusal::identity_missing:
ReadScope::None— no identity was RESOLVED; the read returned zero rows by construction and says nothing about what exists.ReadScope::OwnRows— an identity WAS resolved, and the row is not among the ones attributed to it. That does NOT mean the row exists and belongs to somebody else: the platform answers “not attributed to you” and “not there at all” with the identical 404, deliberately, so that a miss cannot be used to probe for another user’s rows. This reports the scope, not a claim about what exists.
The presented token is never included in the message: it is safe to log, which is the point of putting the diagnosis in a type rather than in a string the caller assembles from the credential.
Fields§
§resource: StringWhat was read, e.g. "decision".
identifier: Option<String>The identifier that was read; None for a list read.
scope: ReadScopeThe scope the platform reported.
status: u16The HTTP status the platform answered with (404 for a scoped miss, 200 for a scoped-empty page).
Implementations§
Source§impl ReadScopeRefusal
impl ReadScopeRefusal
Sourcepub fn identity_missing(&self) -> bool
pub fn identity_missing(&self) -> bool
Whether the read failed because no per-user identity was RESOLVED, as opposed to one being resolved and not matching.
Trait Implementations§
Source§impl Clone for ReadScopeRefusal
impl Clone for ReadScopeRefusal
Source§fn clone(&self) -> ReadScopeRefusal
fn clone(&self) -> ReadScopeRefusal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReadScopeRefusal
impl Debug for ReadScopeRefusal
Source§impl Display for ReadScopeRefusal
impl Display for ReadScopeRefusal
impl Eq for ReadScopeRefusal
Source§impl PartialEq for ReadScopeRefusal
impl PartialEq for ReadScopeRefusal
impl StructuralPartialEq for ReadScopeRefusal
Auto Trait Implementations§
impl Freeze for ReadScopeRefusal
impl RefUnwindSafe for ReadScopeRefusal
impl Send for ReadScopeRefusal
impl Sync for ReadScopeRefusal
impl Unpin for ReadScopeRefusal
impl UnsafeUnpin for ReadScopeRefusal
impl UnwindSafe for ReadScopeRefusal
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.