Rust implementation of the IAB Global Privacy Platform (GPP) consent string specification.
- Eager or lazy decoding of GPP sections
- Owning type (GPPString)
- Read support for all current GPP sections
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: {:?}", §ion);
}
}
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 | π§ͺ | β |
The current plan:
- complete reader implementation for version 0.1
- read + write support in version 0.2