# bookclerk_library::entities::encrypted_secrets

SeaORM entity for the `encrypted_secrets` table.

Retained in the schema and entities per the multi-storefront design; the
encryption / secrets-file removal work lives in [`crate::secrets`](/docs/internals/crates/bookclerk_library/secrets/index.md).

| Item | Kind | Summary |
| --- | --- | --- |
| [`Model`](#model) | struct | Row shape for this table (`DeriveEntityModel`). |
| [`ColumnIter`](#columniter) | struct | An iterator over the variants of [Column] |
| [`Entity`](#entity) | struct | Generated by sea-orm-macros |
| [`PrimaryKeyIter`](#primarykeyiter) | struct | An iterator over the variants of [PrimaryKey] |
| [`ActiveModel`](#activemodel) | struct | Generated by sea-orm-macros |
| [`RelationIter`](#relationiter) | struct | An iterator over the variants of [Relation] |
| [`Column`](#column) | enum | Generated by sea-orm-macros |
| [`PrimaryKey`](#primarykey) | enum | Generated by sea-orm-macros |
| [`Relation`](#relation) | enum | Declared SeaORM relations (none unless FK edges are modeled). |

## Structs

### Model

```rust
pub struct Model {
    pub id: i64,
    pub kind: String,
    pub provider: Option<String>,
    pub account_type: String,
    pub account_id: Option<String>,
    pub name: String,
    pub format: String,
    pub ciphertext: Vec<u8>,
    pub kdf_algorithm: Option<String>,
    pub kdf_salt: Option<Vec<u8>>,
    pub kdf_m_cost: Option<i64>,
    pub kdf_t_cost: Option<i64>,
    pub kdf_p_cost: Option<i64>,
    pub cipher_algorithm: Option<String>,
    pub cipher_nonce: Option<Vec<u8>>,
    pub created_at: String,
    pub updated_at: String,
}
```

Row shape for this table (`DeriveEntityModel`).

**Fields**

- `id`: Surrogate primary key assigned by the database.
- `kind`: Secret kind discriminator (`source_auth`, `s3`, …).
- `provider`: External identity or integration provider id (for example ABS).
- `account_type`: Ownership namespace: [`crate::secrets::secret_account_type`](/docs/internals/crates/bookclerk_library/secret_account_type/index.md).
- `account_id`: Store or operator account id this row belongs to.
- `name`: Human-readable or logical name for this row.
- `format`: Sealing format tag (`sealed-v1`, legacy `json-encrypted`, …).
- `ciphertext`: Encrypted payload bytes for this secret.
- `kdf_algorithm`: KDF algorithm id for legacy rows (for example `argon2id`).
- `kdf_salt`: Random salt for legacy Argon2 key derivation.
- `kdf_m_cost`: Argon2 memory cost in KiB for legacy rows.
- `kdf_t_cost`: Argon2 time cost (iterations) for legacy rows.
- `kdf_p_cost`: Argon2 parallel lane count stored for legacy `json-encrypted` rows.
- `cipher_algorithm`: AEAD algorithm id (for example `xchacha20poly1305`).
- `cipher_nonce`: AEAD nonce bytes used with `ciphertext`.
- `created_at`: RFC 3339 timestamp when the row was inserted.
- `updated_at`: RFC 3339 timestamp when the row was last modified.

#### Model::into_ex

```rust
pub fn into_ex(self) -> Self
```

Generated by sea-orm-macros

Implements: `Clone`, `Debug`, `Eq`, `From<Model>`, `FromQueryResult`, `IntoActiveModel<ActiveModel>`, `ModelTrait`, `PartialEq`, `TryFrom<ActiveModel>`, `TryIntoModel<Model>`

### ColumnIter

```rust
pub struct ColumnIter {
    /* private fields */
}
```

An iterator over the variants of [Column](#column)

Implements: `Clone`, `Debug`, `DoubleEndedIterator`, `ExactSizeIterator`, `FusedIterator`, `Iterator`

### Entity

```rust
pub struct Entity;
```

Generated by sea-orm-macros

Implements: `Clone`, `Copy`, `Debug`, `Default`, `EntityName`, `EntityTrait`, `Iden`, `IdenStatic`

### PrimaryKeyIter

```rust
pub struct PrimaryKeyIter {
    /* private fields */
}
```

An iterator over the variants of [PrimaryKey](#primarykey)

Implements: `Clone`, `Debug`, `DoubleEndedIterator`, `ExactSizeIterator`, `FusedIterator`, `Iterator`

### ActiveModel

```rust
pub struct ActiveModel {
    pub id: ActiveValue<i64>,
    pub kind: ActiveValue<String>,
    pub provider: ActiveValue<Option<String>>,
    pub account_type: ActiveValue<String>,
    pub account_id: ActiveValue<Option<String>>,
    pub name: ActiveValue<String>,
    pub format: ActiveValue<String>,
    pub ciphertext: ActiveValue<Vec<u8>>,
    pub kdf_algorithm: ActiveValue<Option<String>>,
    pub kdf_salt: ActiveValue<Option<Vec<u8>>>,
    pub kdf_m_cost: ActiveValue<Option<i64>>,
    pub kdf_t_cost: ActiveValue<Option<i64>>,
    pub kdf_p_cost: ActiveValue<Option<i64>>,
    pub cipher_algorithm: ActiveValue<Option<String>>,
    pub cipher_nonce: ActiveValue<Option<Vec<u8>>>,
    pub created_at: ActiveValue<String>,
    pub updated_at: ActiveValue<String>,
}
```

Generated by sea-orm-macros

**Fields**

- `id`: Generated by sea-orm-macros
- `kind`: Generated by sea-orm-macros
- `provider`: Generated by sea-orm-macros
- `account_type`: Generated by sea-orm-macros
- `account_id`: Generated by sea-orm-macros
- `name`: Generated by sea-orm-macros
- `format`: Generated by sea-orm-macros
- `ciphertext`: Generated by sea-orm-macros
- `kdf_algorithm`: Generated by sea-orm-macros
- `kdf_salt`: Generated by sea-orm-macros
- `kdf_m_cost`: Generated by sea-orm-macros
- `kdf_t_cost`: Generated by sea-orm-macros
- `kdf_p_cost`: Generated by sea-orm-macros
- `cipher_algorithm`: Generated by sea-orm-macros
- `cipher_nonce`: Generated by sea-orm-macros
- `created_at`: Generated by sea-orm-macros
- `updated_at`: Generated by sea-orm-macros

Implements: `ActiveModelBehavior`, `ActiveModelTrait`, `Clone`, `Debug`, `Default`, `From<Model>`, `IntoActiveModel<ActiveModel>`, `PartialEq`, `TryFrom<ActiveModel>`, `TryIntoModel<Model>`

### RelationIter

```rust
pub struct RelationIter {
    /* private fields */
}
```

An iterator over the variants of [Relation](#relation)

Implements: `Clone`, `Debug`, `DoubleEndedIterator`, `ExactSizeIterator`, `FusedIterator`, `Iterator`

## Enums

### Column

```rust
pub enum Column {
    Id,
    Kind,
    Provider,
    AccountType,
    AccountId,
    Name,
    Format,
    Ciphertext,
    KdfAlgorithm,
    KdfSalt,
    KdfMCost,
    KdfTCost,
    KdfPCost,
    CipherAlgorithm,
    CipherNonce,
    CreatedAt,
    UpdatedAt,
}
```

Generated by sea-orm-macros

**Variants**

- `Id`: Generated by sea-orm-macros
- `Kind`: Generated by sea-orm-macros
- `Provider`: Generated by sea-orm-macros
- `AccountType`: Generated by sea-orm-macros
- `AccountId`: Generated by sea-orm-macros
- `Name`: Generated by sea-orm-macros
- `Format`: Generated by sea-orm-macros
- `Ciphertext`: Generated by sea-orm-macros
- `KdfAlgorithm`: Generated by sea-orm-macros
- `KdfSalt`: Generated by sea-orm-macros
- `KdfMCost`: Generated by sea-orm-macros
- `KdfTCost`: Generated by sea-orm-macros
- `KdfPCost`: Generated by sea-orm-macros
- `CipherAlgorithm`: Generated by sea-orm-macros
- `CipherNonce`: Generated by sea-orm-macros
- `CreatedAt`: Generated by sea-orm-macros
- `UpdatedAt`: Generated by sea-orm-macros

Implements: `Clone`, `ColumnTrait`, `Copy`, `Debug`, `FromStr`, `Iden`, `IdenStatic`, `IntoEnumIterator`

### PrimaryKey

```rust
pub enum PrimaryKey {
    Id,
}
```

Generated by sea-orm-macros

**Variants**

- `Id`: Generated by sea-orm-macros

Implements: `Clone`, `Copy`, `Debug`, `Iden`, `IdenStatic`, `IntoEnumIterator`, `PrimaryKeyToColumn`, `PrimaryKeyTrait`

### Relation

```rust
pub enum Relation {}
```

Declared SeaORM relations (none unless FK edges are modeled).

Implements: `Clone`, `Copy`, `Debug`, `IntoEnumIterator`, `RelationTrait`
