logo
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

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

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

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Get the signature for the implementing type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

A DeserializeSeed implementation for this type.

Get a deserializer compatible with this signature.

Get the signature for the implementing type. Read more

Returns the argument unchanged.

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

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

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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