1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (C) 2022 KeyBoxen Authors
// SPDX-License-Identifier: GPL-3.0-or-later
//! Items module
//!
//! This module implements the object that represents each
//! [item][ch03]. An item is a container for a [secret][ch02] and its
//! associated parameters.
//!
//! # Lazy loading
//! The secret is not loaded into memory by default. It is loaded only on
//! demand from the on-disk database in its encrypted form. The secret
//! is then decrypted using the key from the collection before sending
//! it to the client via DBus.
//!
//! # Locking
//! The items can be locked in a **soft** form.
//!
//! If the collection is already unlocked, then the user will be just
//! prompted for confirmation (allow/disallow) before the secret is
//! passed to the client.
//!
//! If the collection is locked, then the user will be prompted for
//! the collection's password. Both the collection and the item will
//! be considered unlocked upon successful password entry.
//!
//! ## Default locking
//! Items can be set to be locked by default. If it is marked as such,
//! then the user will be prompted for confirmation to unlock in every
//! new session where the secret is needed.
//!
//! [ch02]: https://specifications.freedesktop.org/secret-service/latest/ch02.html
//! [ch03]: https://specifications.freedesktop.org/secret-service/latest/ch03.html
use ;