Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Reject malformed subscriber data
Browse files Browse the repository at this point in the history
  • Loading branch information
0rzech committed Feb 25, 2024
1 parent 2f5e060 commit 8e0b6b8
Show file tree
Hide file tree
Showing 9 changed files with 473 additions and 11 deletions.
134 changes: 133 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ tracing = "0.1.40"
tracing-bunyan-formatter = "0.3.9"
tracing-log = "0.2.0"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
unicode-segmentation = "1.11.0"
uuid = { version = "1.7.0", features = ["v4"] }
validator = "0.16.1"

[dev-dependencies]
claims = "0.7.1"
fake = "2.9.2"
proptest = "1.4.0"
reqwest = "0.11.24"
7 changes: 7 additions & 0 deletions src/domain/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mod new_subscriber;
mod subscriber_email;
mod subscriber_name;

pub use new_subscriber::NewSubscriber;
pub use subscriber_email::SubscriberEmail;
pub use subscriber_name::SubscriberName;
8 changes: 8 additions & 0 deletions src/domain/new_subscriber.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use super::{SubscriberEmail, SubscriberName};
use serde::Deserialize;

#[derive(Deserialize)]
pub struct NewSubscriber {
pub email: SubscriberEmail,
pub name: SubscriberName,
}
Loading

0 comments on commit 8e0b6b8

Please sign in to comment.