pub enum Recipient {
Apns {
device_token: String,
},
Fcm {
registration_token: String,
},
WebPush {
endpoint: String,
p256dh: String,
auth: String,
},
}Expand description
Where a notification is sent. One variant per push transport, because the three do not share a shape: APNs and FCM take an opaque token, Web Push takes a subscription of three parts (RFC 8291).
Every variant holds credential material. A device token and an FCM
registration token address one device; a Web Push endpoint is a bearer
capability URL (whoever holds it can push to that browser) and auth is
the RFC 8291 shared secret the payload is encrypted under. Hence the
hand-written Debug, which prints
fingerprints and never the values: core’s log redaction keys off the
field name (is_secret_field) and cannot see
inside a {:?} of this enum.
Serialize/Deserialize stay, because a subscription has to be
persisted and read back — but a serialised Recipient is the
credential: store it where secrets go, never in a log, an event payload,
or an error body.
Variants§
Apns
An APNs device token (hex, from application:didRegister...).
Fcm
An FCM registration token.
WebPush
A Web Push subscription: the push service URL plus the two RFC 8291 keys, both base64url as the browser hands them over.
Implementations§
Trait Implementations§
Source§impl Debug for Recipient
Prints the transport and a short fingerprint of each part, never the parts
themselves — the same rule Es256Signer, Rs256Signer and CachedToken
follow in cratefield-push-auth. The RFC 8291 auth secret is not even
fingerprinted: nothing about it is safe to correlate on.
impl Debug for Recipient
Prints the transport and a short fingerprint of each part, never the parts
themselves — the same rule Es256Signer, Rs256Signer and CachedToken
follow in cratefield-push-auth. The RFC 8291 auth secret is not even
fingerprinted: nothing about it is safe to correlate on.
Source§impl<'de> Deserialize<'de> for Recipient
impl<'de> Deserialize<'de> for Recipient
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Recipient
impl StructuralPartialEq for Recipient
Auto Trait Implementations§
impl Freeze for Recipient
impl RefUnwindSafe for Recipient
impl Send for Recipient
impl Sync for Recipient
impl Unpin for Recipient
impl UnsafeUnpin for Recipient
impl UnwindSafe for Recipient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.