Skip to main content

bind_channel_identity_into

Function bind_channel_identity_into 

pub fn bind_channel_identity_into(
    config: &mut Config,
    channel_type: &str,
    alias: &str,
    identity: &str,
) -> Result<Option<String>>
Expand description

Add identity to the peer group bound to <type>.<alias> in-place.

Returns Ok(Some(key)) naming the peer_groups key actually written when the identity was newly added, Ok(None) when it was already present, and Err when an ignore entry denies the identity, because neither of those answers would leave it admissible. Callers that report where the identity landed must use the returned key: the writer selects its target by the group’s channel field, so a custom key such as [peer_groups.ops] is a legitimate destination and the conventional <type>_<alias> name may not exist at all. Pure config mutation — no disk write, no daemon restart — so it is the single core shared by the CLI (bind_telegram_identity) and the gateway bind endpoint. The channel field is the dotted <type>.<alias> ref so authorization stays scoped to the bound alias; a bare type would broaden the peer across every alias of that type.