Skip to content

Rust implementation of the IAB Global Privacy Platform (GPP) consent string

License

Notifications You must be signed in to change notification settings

noirotm/iabgpp-rs

Repository files navigation

iabgpp-rs

Rust implementation of the IAB Global Privacy Platform (GPP) consent string specification.

⚠️ This is work in progress.

Features

  • Eager or lazy decoding of GPP sections
  • Owning type (GPPString)
  • Read support for all current GPP sections

Usage example

Cargo.toml:

[dependencies]
iab-gpp = "0.1"

main.rs:

use std::error::Error;
use std::str::FromStr;
use iab_gpp::v1::GPPString;

fn main() {
    let s = "DBABM~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA";
    let gpp_str = GPPString::from_str(s).expect("a valid GPP string");

    for &id in gpp_str.section_ids() {
        println!("Section id: {:?}", id);

        let section = gpp_str.decode_section(id).expect("a valid section");
        println!("Section: {:?}", &section);
    }
}

GPP Standard support

This crate intends to be in sync with the GPP specification, meaning that it should be able to read payloads with the versions specified here.

If the standard gets updated with new versions, this page should keep track of incompatibilities.

Legend:

  • βœ… complete support
  • πŸ§ͺ experimental or partial support
  • ❌ no support
Section Reading Writing
GPP string v1 βœ… ❌
US Privacy v1 (deprecated) βœ… ❌
EU TCF v2.2 βœ… ❌
EU TCF v1 (deprecated) βœ… ❌
Canadian TCF v1 (deprecated) βœ… ❌
Canadian TCF v1.1 βœ… ❌
US - National v1 βœ… ❌
US - National v2 πŸ§ͺ ❌
US - California βœ… ❌
US - Virginia βœ… ❌
US - Colorado βœ… ❌
US - Utah βœ… ❌
US - Connecticut βœ… ❌
US - Florida πŸ§ͺ ❌
US - Montana πŸ§ͺ ❌
US - Oregon πŸ§ͺ ❌
US - Texas πŸ§ͺ ❌
US - Delaware πŸ§ͺ ❌
US - Iowa πŸ§ͺ ❌
US - Nebraska πŸ§ͺ ❌
US - New Hampshire πŸ§ͺ ❌
US - New Jersey πŸ§ͺ ❌
US - Tennessee πŸ§ͺ ❌

Development status

The current plan:

  • complete reader implementation for version 0.1
  • read + write support in version 0.2

About

Rust implementation of the IAB Global Privacy Platform (GPP) consent string

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages