Struct kanidm::entry::Entry[][src]

pub struct Entry<VALID, STATE> { /* fields omitted */ }
Expand description

Entry is the core data storage type of the server. Almost every aspect of the server is designed to read, handle and manipulate entries.

Entries store attribute value assertions, or AVA. These are sets of key-values.

Entries have a lifecycle within a single operation, and as part of replication. The lifecycle for operations is defined through state and valid types. Each entry has a pair Of these types at anytime. The first is the AVA schema and access control assertion state. This is represented by the type VALID as one of EntryValid, EntryInvalid or EntryReduced. Every entry starts as EntryInvalid, and when checked by the schema for correctness, transitions to EntryValid. While an entry is EntryValid it can not be altered - you must invalidate it to EntryInvalid, then modify, then check again. An entry that has had access controls applied moves from EntryValid to EntryReduced, to show that the AVAs have reduced to the valid read set of the current event user.

The second type of STATE represents the database commit state and internal db ID’s. A new entry that has never been committed is EntryNew, but an entry that has been retrieved from the database is EntryCommitted. This affects the operations you can apply IE modify or delete.

These types exist to prevent at compile time, mishandling of Entries, to ensure they are always handled with the correct lifecycles and processes.

Implementations

pub fn from_proto_entry(
    e: &ProtoEntry,
    qs: &QueryServerWriteTransaction<'_>
) -> Result<Self, OperationError>

Consume a Protocol Entry from JSON, and validate and process the data into an internal Entry type.

pub fn from_proto_entry_str(
    es: &str,
    qs: &QueryServerWriteTransaction<'_>
) -> Result<Self, OperationError>

Given a proto entry in JSON formed as a serialised string, processed that string into an Entry.

Assign the Change Identifier to this Entry, allowing it to be modified and then written to the Backend

Compare this entry to another.

Add an attribute-value-assertion to this Entry.

Replace the existing content of an attribute set of this Entry, with a new set of Values.

Validate that this entry and it’s attribute-value sets are conformant to the systems schema and the releant syntaxes.

Convert this entry into a recycled entry, that is “in the recycle bin”.

Given this validated and sealed entry, process it with a Backend ID number so that it can be then serialised to the database.

If this entry has ever been commited to disk, retrieve it’s database id number.

Insert a claim to this entry. This claim can NOT be persisted to disk, this is only used during a single Event session.

Serialise this entry to it’s Database format ready for storage.

Safety

This function bypasses the access control validation logic and should NOT be used without special care and attention to ensure that no private data is leaked incorrectly to clients. Generally this is ONLY used inside of the access control processing functions which correctly applies the reduction steps.

Given a set of attributes that are allowed to be seen on this entry, process and remove all other values that are NOT allowed in this query.

Convert this recycled entry, into a tombstone ready for reaping.

Given a current transaction change identifier, mark this entry as valid and committed.

Transform this reduced entry into a JSON protocol form that can be sent to clients.

Transform this reduced entry into an LDAP form that can be sent to clients.

Overwrite the current set of values for an attribute, with this new set.

Get an iterator over the current set of attribute names that this entry contains.

Return a reference to the current set of values that are associated to this attribute.

If possible, return an iterator over the set of values transformed into a &str.

If possible, return an iterator over the set of values transformed into a &Uuid.

If possible, return an iterator over the set of ssh key values transformed into a &str.

Return a single value of this attributes name, or None if it is NOT present, or there are multiple values present (ambiguous).

Return a single bool, if valid to transform this value into a boolean.

Return a single uint32, if valid to transform this value.

Return a single syntax type, if valid to transform this value.

Return a single credential, if valid to transform this value.

Return a single secret value, if valid to transform this value.

Return a single datetime, if valid to transform this value.

Return a single &str, if valid to transform this value.

Return a single &Url, if valid to transform this value.

Return a single protocol filter, if valid to transform this value.

Assert if an attribute of this name is present on this entry.

Assert if an attribute of this name is present, and one of it’s values contains the an exact match of this partial value.

Assert if an attribute of this name is present, and one of it’s values contains the following substring, if possible to perform the substring comparison.

Assert if an attribute of this name is present, and one of it’s values is less than the following partial value

Test if the following filter applies to and matches this entry.

Given this entry, generate a filter containing the requested attributes strings as equality components.

Given this entry, generate a modification list that would “assert” another entry is in the same/identical attribute state.

Merge an existing value set into this attributes value set. If they are not the same type, an error is returned. If no attribute exists, then this valueset is cloned “as is”.

Remove all values of this attribute from the entry.

Remove all values of this attribute from the entry, and return their content.

Replace the content of this attribute with a new value set.

Apply the content of this modlist to this entry, enforcing the expressed state.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

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

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

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