pub struct MutationAuthorizationContext {
pub source_mac: MacAddr,
pub source_network: Option<NpduAddress>,
pub provenance: TransportProvenance,
pub trust: MutationTrust,
pub invoke_id: Option<u8>,
pub service_choice: MutationService,
pub target: MutationTarget,
}Expand description
Claimed source identity, verified ingress scope, and decoded target supplied to mutation policy.
Neither address nor a subscription’s process ID authenticates an operator.
source_mac identifies the immediate peer (often a router); source_network
is the peer-claimed routed origin, not a verified identity.
SC mTLS authenticates the channel/peer, not service authorization; neither
address is a certificate principal. principal is, and
only for a verified direct SC connection.
provenance is the reassembled ingress snapshot threaded from dispatch
(segmentation mismatches already fail closed at reassembly, so every
element of one request — including each WPM element — observes the same
snapshot). trust is the channel/relay scope derived from it, never leaf
identity. Debug is redacted by construction: address lengths, whether a
principal is present and the target kind only, never MAC bytes, the
fingerprint, property values, file payloads, or other decoded inputs.
Fields§
§source_mac: MacAddrImmediate data-link peer address.
source_network: Option<NpduAddress>Claimed originating NPDU address, when present.
provenance: TransportProvenanceHonest transport + origin provenance for this ingress snapshot.
trust: MutationTrustChannel/relay scope derived from provenance; never leaf identity.
invoke_id: Option<u8>A confirmed request’s invoke identifier; None for an unconfirmed
request, which carries none.
service_choice: MutationServiceThe service that asks for the mutation.
target: MutationTargetDecoded target and parameters; current element for WPM, current Channel for WriteGroup.
Implementations§
Source§impl MutationAuthorizationContext
impl MutationAuthorizationContext
Sourcepub fn principal(&self) -> Option<ScPrincipal>
pub fn principal(&self) -> Option<ScPrincipal>
The principal of the peer that originated the request: the verified
leaf certificate of a direct BACnet/SC connection, when the request
carries no routed source. None for other ingress, hub-relayed and
routed requests included (see crate::policy).
Sourcepub fn forwarding_peer_principal(&self) -> Option<ScPrincipal>
pub fn forwarding_peer_principal(&self) -> Option<ScPrincipal>
The principal of the direct BACnet/SC peer that handed this request
over, a router included when the request was routed; None off a
verified direct SC connection. Trusting it trusts everything that
peer forwards.
Sourcepub fn certificate(&self) -> Option<&ScPeerCertificate>
Available on crate feature sc-tls only.
pub fn certificate(&self) -> Option<&ScPeerCertificate>
sc-tls only.The verified leaf certificate of the peer that originated the
request: the one principal fingerprints, for
rules by subject, Subject Alternative Name or issuer, which
survive certificate renewal. None exactly when principal()
is: other ingress, hub-relayed and routed requests (see
crate::policy). Its contents are the peer’s: don’t log them.
Sourcepub fn forwarding_peer_certificate(&self) -> Option<&ScPeerCertificate>
Available on crate feature sc-tls only.
pub fn forwarding_peer_certificate(&self) -> Option<&ScPeerCertificate>
sc-tls only.The verified leaf certificate of the direct BACnet/SC peer that
handed this request over, a router included when the request
was routed: the one
forwarding_peer_principal
fingerprints. None off a verified direct SC connection.
Sourcepub fn direct_sc_identity(&self) -> Option<DirectScIdentity>
pub fn direct_sc_identity(&self) -> Option<DirectScIdentity>
The immediate direct-SC hop’s verified leaf and connection incarnation: for a routed request, the router that forwarded it. Absent off a verified direct SC connection. Separate from claimed addresses.