pub struct Subject {
    pub subject_kind: String,
    pub subject_details: HashMap<String, OwnedValue>,
}
Expand description

This struct describes subjects such as UNIX processes. It is typically used to check if a given process is authorized for an action.

The following kinds of subjects are known:

  • Unix Process. subject_kind should be set to unix-process with keys pid (of type uint32) and start-time (of type uint64).

  • Unix Session. subject_kind should be set to unix-session with the key session-id (of type string).

  • System Bus Name. subject_kind should be set to system-bus-name with the key name (of type string).

Fields§

§subject_kind: String

The type of the subject.

§subject_details: HashMap<String, OwnedValue>

Details about the subject. Depending of the value of subject_kind, a set of well-defined key/value pairs are guaranteed to be available.

Implementations§

source§

impl Subject

source

pub fn new_for_owner( pid: u32, start_time: Option<u64>, uid: Option<u32> ) -> Result<Self, Error>

Create a Subject for pid, start_time & uid.

Arguments
  • pid - The process ID

  • start_time - The start time for pid or None to look it up in e.g. /proc

  • uid - The (real, not effective) uid of the owner of pid or None to look it up in e.g. /proc

source

pub fn new_for_message_header( message_header: &MessageHeader<'_> ) -> Result<Self, Error>

Create a Subject for a message for querying if the sender of a Message is permitted to execute an action.

Arguments
  • message_header - The header of the message which caused an authentication to be necessary.

Trait Implementations§

source§

impl Debug for Subject

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Subject

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Subject

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Type for Subject

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<'de, T> DynamicDeserialize<'de> for Twhere T: Type + Deserialize<'de> + ?Sized,

§

type Deserializer = PhantomData<T>

A DeserializeSeed implementation for this type.
source§

fn deserializer_for_signature<S>( signature: S ) -> Result<<T as DynamicDeserialize<'de>>::Deserializer, Error>where S: TryInto<Signature<'de>>, <S as TryInto<Signature<'de>>>::Error: Into<Error>,

Get a deserializer compatible with this signature.
source§

impl<T> DynamicType for Twhere T: Type + ?Sized,

source§

fn dynamic_signature(&self) -> Signature<'_>

Get the signature for the implementing type. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,