Skip to content

Commit

Permalink
Merge pull request #18 from dsietz/development
Browse files Browse the repository at this point in the history
Issue #17
  • Loading branch information
dsietz committed Jan 6, 2020
2 parents a4b3e82 + 15b7ceb commit cf98d9c
Show file tree
Hide file tree
Showing 6 changed files with 455 additions and 9 deletions.
11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pbd"
version = "0.0.7"
version = "0.0.8"
authors = ["dsietz <davidsietz@yahoo.com>"]
edition = "2018"
readme = "README.md"
Expand All @@ -25,10 +25,12 @@ path = "src/lib.rs"
maintenance = {status = "actively-developed"}

[features]
default = ["dua"]
dua = ["actix-web","actix-service","futures", "rayon", "reqwest"] # Data Usae Agreement funcitonality
default = ["dua", "dtc"]
dua = ["actix-web","actix-service","futures", "rayon", "reqwest"] # Data Usage Agreement funcitonality
dtc =["pow_sha256"] # Data Tracker Chain functionality

[dependencies]
env_logger = "0.6"
log = "0.4"
serde ="1.0"
serde_derive = "1.0"
Expand All @@ -39,4 +41,5 @@ reqwest = { version = "0.9", optional = true }
actix-web = { version = "1.0.9", optional = true }
actix-service = { version = "0.4.2", optional = true }
futures = { version = "0.1", optional = true }
rayon = { version = "1.2.1", optional = true }
rayon = { version = "1.2.1", optional = true }
pow_sha256 = { version = "0.2", optional = true }
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ For software development teams who implement Privacy by Design practices, this P

## What's New

Here's whats new in 0.0.6:
Here's whats new in 0.0.7:

This project and codebase for this crate has change
1. Updated Data Usage Agreement feature
- actix-web middleware now checks the uri of the DUA to ensure they are valid (issue #14)
1. Introduced the concept of Data Tracker Chains
- MarkerChain traits (issue #17)

## Features

- Data Usage Agreements
- Data Tracker Chain

## About

Expand Down
37 changes: 37 additions & 0 deletions src/dtc/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//! Data Tracker Chain specific Errors

use std::error;
use derive_more::Display;
use actix_web::ResponseError;

#[derive(Debug, Clone, Display)]
pub enum Error {
/// Bad Data Uasage Agreement
#[display(fmt = "Invalid or Currupt Marker")]
BadMarker,
/// Bad format of Data Uasage Agreement
#[display(fmt = "Invalid Marker Chain")]
BadChain,
}

impl error::Error for Error{}

impl ResponseError for Error{}


#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_error_marker_bad() {
let err = Error::BadMarker;
assert_eq!(format!("{}", err), "Invalid or Currupt Marker");
}

#[test]
fn test_error_chain_bad() {
let err = Error::BadChain;
assert_eq!(format!("{}", err), "Invalid Marker Chain");
}
}
Loading

0 comments on commit cf98d9c

Please sign in to comment.