Skip to content

Commit

Permalink
Merge branch 'release/0.201'
Browse files Browse the repository at this point in the history
  • Loading branch information
peczenyj committed Dec 20, 2023
2 parents 3dc9877 + 36309f8 commit c7db369
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 45 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.201
- change subroutine redefinition from INIT to BEGIN to avoid warnings (Tiago)

0.200
- refactor constants, stop use dualvars
- validate parameters on method check_publisher_restriction
Expand Down
4 changes: 0 additions & 4 deletions README.pod
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@

GDPR::IAB::TCFv2 - Transparency & Consent String version 2 parser

=head1 VERSION

Version 0.200

=head1 SYNOPSIS

The purpose of this package is to parse Transparency & Consent String (TC String) as defined by IAB version 2.
Expand Down
57 changes: 27 additions & 30 deletions lib/GDPR/IAB/TCFv2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use GDPR::IAB::TCFv2::BitUtils qw<is_set
use GDPR::IAB::TCFv2::Publisher;
use GDPR::IAB::TCFv2::RangeSection;

our $VERSION = "0.200";
our $VERSION = "0.201";

use constant {
CONSENT_STRING_TCF_V2 => {
Expand Down Expand Up @@ -62,31 +62,6 @@ use constant {

use overload q<""> => \&tc_string;

INIT {
if ( my $native_decode_base64url = MIME::Base64->can("decode_base64url") )
{
no warnings q<redefine>;

*_decode_base64url = $native_decode_base64url;
}

eval {
require JSON;

if ( my $native_json_true = JSON->can("true") ) {
no warnings q<redefine>;

*_json_true = $native_json_true;
}

if ( my $native_json_false = JSON->can("false") ) {
no warnings q<redefine>;

*_json_false = $native_json_false;
}
};
}

# ABSTRACT: gdpr iab tcf v2 consent string parser

sub Parse {
Expand Down Expand Up @@ -647,6 +622,32 @@ sub looksLikeIsConsentVersion2 {
rindex( $gdpr_consent_string, CONSENT_STRING_TCF_V2->{PREFIX}, 0 ) == 0;
}

BEGIN {
if ( my $native_decode_base64url = MIME::Base64->can("decode_base64url") )
{
no warnings q<redefine>;

*_decode_base64url = $native_decode_base64url;
}

eval {
require JSON;

if ( my $native_json_true = JSON->can("true") ) {
no warnings q<redefine>;

*_json_true = $native_json_true;
}

if ( my $native_json_false = JSON->can("false") ) {
no warnings q<redefine>;

*_json_false = $native_json_false;
}
};
}


1;
__END__
Expand Down Expand Up @@ -676,10 +677,6 @@ __END__
GDPR::IAB::TCFv2 - Transparency & Consent String version 2 parser
=head1 VERSION
Version 0.200
=head1 SYNOPSIS
The purpose of this package is to parse Transparency & Consent String (TC String) as defined by IAB version 2.
Expand Down
7 changes: 6 additions & 1 deletion lib/GDPR/IAB/TCFv2/Constants/RestrictionType.pm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ Returns a hashref with a mapping between all restriction types and their descrip
=head1 NOTE
Vendors must always respect a 0 (Not Allowed) regardless of whether or not they have not declared that Purpose to be "flexible". Values 1 and 2 are in accordance with a vendor's declared flexibility. Eg. if a vendor has Purpose 2 declared as Legitimate Interest but also declares that Purpose as flexible and this field is set to 1, they must then check for the "consent" signal in the VendorConsents section to make a determination on whether they have the legal basis for processing user personal data under that Purpose.
Vendors must always respect a 0 (Not Allowed) regardless of whether or not they have not declared that Purpose to be "flexible".
Values 1 and 2 are in accordance with a vendor's declared flexibility.
Eg. if a vendor has Purpose 2 declared as Legitimate Interest but also declares that Purpose as flexible and this field is set to 1,
they must then check for the "consent" signal in the VendorConsents section to make a determination on whether they have the legal basis
or processing user personal data under that Purpose.
When a vendor's Purpose registration is not flexible they should interpret this value in the following ways:
Expand Down
6 changes: 1 addition & 5 deletions lib/GDPR/IAB/TCFv2/PublisherRestrictions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ use warnings;

use Carp qw<croak>;

use GDPR::IAB::TCFv2::BitUtils qw<is_set
use GDPR::IAB::TCFv2::BitUtils qw<
get_uint2
get_uint3
get_uint6
get_uint12
get_uint16
get_uint36
get_char6_pair
>;

use constant ASSUMED_MAX_VENDOR_ID => 0x7FFF; # 32767 or (1 << 15) -1
Expand Down
5 changes: 0 additions & 5 deletions lib/GDPR/IAB/TCFv2/PublisherTC.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@ use warnings;
use Carp qw<croak>;

use GDPR::IAB::TCFv2::BitUtils qw<is_set
get_uint2
get_uint3
get_uint6
get_uint12
get_uint16
get_uint36
get_char6_pair
>;

use constant {
Expand Down

0 comments on commit c7db369

Please sign in to comment.