hyperhive/swarm-secret-client/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas e263681f1d swarm-secret-client: one module per kind of secret, not one struct
mara, reviewing the previous commit: "the field is specific to matrix, why
add it to the general struct". She is right, and the answer is that there was
no general struct — `Credential` had one consumer, the crate's only path
builder was `matrix_account`, and `value` is pinned by
`glue-matrix-bao-token.nix`, a matrix unit. It was matrix's throughout,
wearing a general name; adding `homeserver` is what made that visible.

`client` now moves whatever type a caller names and decodes nothing itself.
That is forwarding rather than machinery: `vaultrs::kv2::read`/`set` are
already generic over the payload.

The matrix agreement moves to its own module holding both halves — where a
credential lives (`account_path`, was `path::matrix_account`) and what the
object at that path holds. `path` keeps only what every path obeys, so a
second kind of swarm secret becomes a module beside `matrix` rather than
another optional field on a struct it shares. argus raised the same collision
from the other direction on #4092: two mutually-exclusive `Option`s modelling
one concept is the failure mode this forecloses.

`checked_segment` stays public in `path`: hive-priv builds an on-disk path
from the same names and must accept the same charset.

Behaviour is unchanged. The compatibility properties move with the struct —
`Option` is what lets a pre-`homeserver` stored object decode, and
`skip_serializing_if` is what keeps a token-only object free of
`"homeserver":null` for that nix reader.

Refs #3726
2026-09-08 15:53:50 +02:00
..
client.rs swarm-secret-client: one module per kind of secret, not one struct 2026-09-08 15:53:50 +02:00
lib.rs swarm-secret-client: one module per kind of secret, not one struct 2026-09-08 15:53:50 +02:00
matrix.rs swarm-secret-client: one module per kind of secret, not one struct 2026-09-08 15:53:50 +02:00
path.rs swarm-secret-client: one module per kind of secret, not one struct 2026-09-08 15:53:50 +02:00