grpc: directory replication API for websites to mirror accounts/channels
Snapshot (full read) + Subscribe (live stream) over the same committed-entry channel gossip uses. Identity and metadata only — password hashes, SCRAM verifiers, cert fingerprints, and the finer channel-ops-list events never cross this API. Bearer-token authenticated, optional server TLS. Verified end-to-end against a live test-net registration, not just unit tests.
This commit is contained in:
parent
bdcce01f11
commit
e5a0d2acdf
11 changed files with 1188 additions and 8 deletions
|
|
@ -12,6 +12,28 @@ pub struct Config {
|
|||
// Outbound email (password resets). Absent = email features are off.
|
||||
#[serde(default)]
|
||||
pub email: Option<Email>,
|
||||
// Directory replication (gRPC), for websites mirroring the account/channel
|
||||
// directory. Absent = the RPC server does not start.
|
||||
#[serde(default)]
|
||||
pub grpc: Option<Grpc>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct Grpc {
|
||||
// Address to accept client connections on, e.g. "127.0.0.1:50051".
|
||||
pub bind: String,
|
||||
// Bearer token every RPC must present (`authorization: Bearer <token>`).
|
||||
pub token: String,
|
||||
// Optional server-side TLS (no client cert required, unlike gossip's mTLS —
|
||||
// a subscriber is a website backend, not a federation peer).
|
||||
#[serde(default)]
|
||||
pub tls: Option<ServerTls>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct ServerTls {
|
||||
pub cert: String, // certificate chain (PEM)
|
||||
pub key: String, // private key (PEM)
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue