pub struct Grant {
pub key_id: String,
pub permissions: Vec<Permission>,
pub succeeds: String,
pub issued_at: i64,
pub root_sig: Option<Signature>,
pub issuer: Option<Box<Grant>>,
}Expand description
What a key may do. The kernel trusts root keys only (kernable start --root); a root key
signs a grant over kernable.v1.grant (kernable grant). The grantee’s process presents it with
every call, hex-encoded, in the gRPC metadata entry kernable-grant; it must name the key that
signed the request (otherwise PERMISSION_DENIED). The kernel keeps the newest grant per key
(by issued_at) and ignores older ones. A grant has no time window; it ends when a newer grant
replaces it or the key, or the root key that signed it, is revoked. Streams whose key loses a
permission they use end with PERMISSION_DENIED.
A delegated grant is signed by a key that is not a root key, a delegate, whose own grant
(signed by a root key) has the action grant naming the actions it may grant
(grant=replicate,read). It carries that grant in issuer. The kernel takes it only for
those actions (never * or grant itself), without succeeds, and checks it against the
newest grant of the delegate it knows, so a newer grant of the delegate that names fewer
actions takes the rest away. One delegation only: an issuer has no issuer. Revoking the
delegate, or the root key that signed its grant, ends what it granted.
Fields§
§key_id: Stringthe grantee
permissions: Vec<Permission>§succeeds: StringAn older key this key replaces (empty: none). Listeners and aggregates registered with that key may connect with key_id and keep their registration.
issued_at: i64ms since epoch
root_sig: Option<Signature>The signature over kernable.v1.grant: by a root key, or by the delegate issuer names.
issuer: Option<Box<Grant>>A delegated grant: the delegate’s own grant, signed by a root key (absent: none).
Trait Implementations§
Source§impl Message for Grant
impl Message for Grant
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.impl StructuralPartialEq for Grant
Auto Trait Implementations§
impl Forget for Grant
impl Freeze for Grant
impl Move for Grant
impl RefUnwindSafe for Grant
impl Send for Grant
impl Sync for Grant
impl Unpin for Grant
impl UnsafeUnpin for Grant
impl UnwindSafe for Grant
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<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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request