diff --git a/Cargo.toml b/Cargo.toml index 4ed3f9a..563a72d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,7 +53,7 @@ url = "2.5.8" aes-gcm = "0.10" hex = "0.4" hmac = "0.12" -md-5 = "0.10" +md5 = { package = "md-5", version = "0.10" } jsonwebtoken = { version = "10", features = ["rust_crypto"] } [dev-dependencies] diff --git a/src/services/patreon/webhook_types.rs b/src/services/patreon/webhook_types.rs index fa5306c..970d6db 100644 --- a/src/services/patreon/webhook_types.rs +++ b/src/services/patreon/webhook_types.rs @@ -1,5 +1,3 @@ -#![allow(dead_code)] - use serde::Deserialize; /// Patreon webhook event types parsed from the `X-Patreon-Event` header. @@ -33,14 +31,11 @@ impl PatreonWebhookEvent { #[derive(Debug, Deserialize)] pub(crate) struct WebhookPayload { pub(crate) data: WebhookMemberData, - #[serde(default)] - pub(crate) included: Vec, } /// Member resource in the webhook payload (the primary `data` object). #[derive(Debug, Deserialize)] pub(crate) struct WebhookMemberData { - pub(crate) id: String, pub(crate) attributes: WebhookMemberAttributes, #[serde(default)] pub(crate) relationships: WebhookMemberRelationships, @@ -88,37 +83,6 @@ pub(crate) struct WebhookCampaignRelationship { #[derive(Debug, Deserialize)] pub(crate) struct WebhookResourceRef { pub(crate) id: String, - #[serde(rename = "type")] - pub(crate) resource_type: String, -} - -/// Included resources in the webhook payload. -#[derive(Debug, Deserialize)] -#[serde(tag = "type")] -pub(crate) enum WebhookIncludedResource { - #[serde(rename = "user")] - User(WebhookIncludedUser), - #[serde(rename = "tier")] - Tier(WebhookIncludedTier), - #[serde(rename = "campaign")] - Campaign(WebhookIncludedCampaign), - #[serde(other)] - Other, -} - -#[derive(Debug, Deserialize)] -pub(crate) struct WebhookIncludedUser { - pub(crate) id: String, -} - -#[derive(Debug, Deserialize)] -pub(crate) struct WebhookIncludedTier { - pub(crate) id: String, -} - -#[derive(Debug, Deserialize)] -pub(crate) struct WebhookIncludedCampaign { - pub(crate) id: String, } #[cfg(test)]