Skip to content

Commit

Permalink
release version 0.051
Browse files Browse the repository at this point in the history
  • Loading branch information
peczenyj committed Dec 5, 2023
1 parent 61d8e9c commit 0fc9d49
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 19 deletions.
6 changes: 5 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
v0.05
v0.051
- remove dependency List::MoreUtils
- make sure the code will work on perl 5.8
- make sure the code will work on 32 bits
- make sure the code will work on newer versions of perl where MIME::Base64 supports base64 url format
- change version schema
- some small refactors
- doc fixes

v0.05
- almost the same as v0.051

v0.0.4
- fix issue with pack Q on 32 bits environment
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Changes
CONTRIBUTING.md
CONTRIBUTING.pod
lib/GDPR/IAB/TCFv2.pm
lib/GDPR/IAB/TCFv2/BitField.pm
lib/GDPR/IAB/TCFv2/BitUtils.pm
Expand Down
3 changes: 1 addition & 2 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use ExtUtils::MakeMaker;

WriteMakefile(
NAME => 'GDPR::IAB::TCFv2',
AUTHOR => 'Tiago Peczenyj <tiago.peczenyj@gmail.com>',
AUTHOR => 'Tiago Peczenyj <tiago.peczenyj+gdpr-iab-tcfv2@gmail.com>',
LICENSE => "perl_5",
ABSTRACT_FROM => 'lib/GDPR/IAB/TCFv2.pm',
VERSION_FROM => 'lib/GDPR/IAB/TCFv2.pm',
Expand All @@ -11,7 +11,6 @@ WriteMakefile(
'Test::Exception' => 0.43,
'Test::More' => 0.94,
},
SKIP => [qw<.github>],
( eval { ExtUtils::MakeMaker->VERSION(6.46) }
? ( META_MERGE => {
'meta-spec' => { version => 2 },
Expand Down
36 changes: 21 additions & 15 deletions lib/GDPR/IAB/TCFv2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use warnings;
use integer;
use bytes;

our $VERSION = "0.05";
our $VERSION = "0.051";

use GDPR::IAB::TCFv2::BitUtils
qw<get_char6_pair get_uint6 get_uint12 get_uint16 get_uint36 is_set>;
Expand Down Expand Up @@ -299,50 +299,56 @@ GDPR::IAB::TCFv2 - Transparency & Consent String version 2 parser
=head1 VERSION
Version 0.05
Version 0.051
=head1 SYNOPSIS
The purpose of this package is to parse Transparency & Consent String (TC String) as defined by IAB version 2.
use strict;
use warnings;
use feature 'say';
use GDPR::IAB::TCFv2;
my $consent = GDPR::IAB::TCFv2->Parse(
'CLcVDxRMWfGmWAVAHCENAXCkAKDAADnAABRgA5mdfCKZuYJez-NQm0TBMYA4oCAAGQYIAAAAAAEAIAEgAA.argAC0gAAAAAAAAAAAA'
);
use feature qw<say>;
say $consent->version; # 2
say $consent->created; # epoch 1228644257
say $consent->last_updated; # epoch 1326215413
say $consent->cmp_id; # 21
say $consent->created; # epoch 1228644257 or 07/12/2008
say $consent->last_updated; # epoch 1326215413 or 10/01/2012
say $consent->cmp_id; # 21 - Traffective GmbH
say $consent->cmp_version; # 7
say $consent->consent_screen; # 2
say $consent->consent_language; # "EN"
say $consent->vendor_list_version; # 23
use List::Util qw(all);
use List::MoreUtils qw<all>;
say "consent ok for purpose ids 1, 3, 9 and 10" if all {
say "find consent for purpose ids 1, 3, 9 and 10" if all {
$consent->is_purpose_consent_allowed($_)
} (1, 3, 9, 10);
say "weborama (vendor id 284) has consent" if $consent->vendor_consent(284);
say "find consent for vendor id 284 (Weborama)" if $consent->vendor_consent(284);
=head1 ACRONYMS
GDPR: General Data Protection Regulation L<https://iabeurope.eu/about-us/>
IAB: Interactive Advertising Bureau L<About IAB|https://iabeurope.eu/about-us/>
TCF: The Transparency & Consent Framework L<TCF v2.2|https://iabeurope.eu/transparency-consent-framework/>
L<GDPR|https://gdpr-info.eu/>: General Data Protection Regulation
L<IAB|https://iabeurope.eu/about-us/>: Interactive Advertising Bureau
L<TCF|https://iabeurope.eu/transparency-consent-framework/>: The Transparency & Consent Framework
=head1 CONSTRUCTOR
=head2 Parse
The Parse method will decode and validate a base64 encoded version of the tcf v2 string.
Will return a C<GDPR::IAB::TCFv2> immutable object that allow easy access to different properties.
Will die if can't decode the string.
use GDPR::IAB::TCFv2;
Expand Down Expand Up @@ -438,15 +444,15 @@ The legitimate interest value for each Vendor ID
=head2 looksLikeIsConsentVersion2
Will check if a given tc string starts with a literal "C".
Will check if a given tc string starts with a literal C<C>.
=head1 SEE ALSO
You can find the original documentation of the TCF v2 from IAB documentation L<here|https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20Consent%20string%20and%20vendor%20list%20formats%20v2.md>.
The original documentation of the L<TCF v2 from IAB documentation|https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20Consent%20string%20and%20vendor%20list%20formats%20v2.md>.
=head1 AUTHOR
Tiago Peczenyj (tiago dot peczentj at gmail dot com)
Tiago Peczenyj L<mailto:tiago.peczenyj+gdpr-iab-tcfv2@gmail.com>
=head1 BUGS
Expand Down

0 comments on commit 0fc9d49

Please sign in to comment.