Skip to content

Commit

Permalink
Merge branch 'release/0.100'
Browse files Browse the repository at this point in the history
  • Loading branch information
peczenyj committed Dec 15, 2023
2 parents 4847709 + 8d0fbcd commit 9058e3d
Show file tree
Hide file tree
Showing 16 changed files with 1,210 additions and 296 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: macos

on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:
- push

jobs:
perl:
runs-on: macOS-latest
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/perltidy.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: perltidy

on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:
- push

jobs:
perltidy:
runs-on: ubuntu-latest
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: windows

on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:
- push

jobs:
perl:
runs-on: windows-latest
Expand Down
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.100
- parse publisher tc section if available
- add strict mode (disabled by default) to validate the consent string version

0.084
- fix a bug while parsing valid consent strings range-based, see https://github.com/peczenyj/GDPR-IAB-TCFv2/issues/20

Expand Down
2 changes: 2 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ lib/GDPR/IAB/TCFv2/BitUtils.pm
lib/GDPR/IAB/TCFv2/Constants/Purpose.pm
lib/GDPR/IAB/TCFv2/Constants/RestrictionType.pm
lib/GDPR/IAB/TCFv2/Constants/SpecialFeature.pm
lib/GDPR/IAB/TCFv2/Publisher.pm
lib/GDPR/IAB/TCFv2/PublisherRestrictions.pm
lib/GDPR/IAB/TCFv2/PublisherTC.pm
lib/GDPR/IAB/TCFv2/RangeSection.pm
LICENSE
Makefile.PL
Expand Down
36 changes: 33 additions & 3 deletions README.pod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ GDPR::IAB::TCFv2 - Transparency & Consent String version 2 parser

=head1 VERSION

Version 0.084
Version 0.100

=head1 SYNOPSIS

Expand Down Expand Up @@ -113,9 +113,10 @@ or
boolean_values => [ 0, 1 ],
date_format => '%Y%m%d', # yyymmdd
},
strict => 1,
);

Parse may receive an optional hash parameter C<json> with the following properties:
Parse may receive an optional hash of parameters: C<strict> (boolean) and C<json> (hashref with the following properties):

=over

Expand Down Expand Up @@ -149,6 +150,10 @@ except if the option C<use_epoch> is true.

=back

On C<strict> mode we will validate if the version of the consent string is the version 2 (or die with an exception).

The C<strict> mode is disabled by default.

=head1 METHODS

=head2 tc_string
Expand Down Expand Up @@ -335,6 +340,12 @@ For the avoidance of doubt:

In case a vendor has declared flexibility for a purpose and there is no legal basis restriction signal it must always apply the default legal basis under which the purpose was registered aside from being registered as flexible. That means if a vendor declared a purpose as legitimate interest and also declared that purpose as flexible it may not apply a "consent" signal without a legal basis restriction signal to require consent.

=head2 publisher_tc

If the consent string has a C<Publisher TC> section, we will decode this section as an instance of L<GDPR::IAB::TCFv2::PublisherTC>.

Will return undefined if there is no C<Publisher TC> section.

=head2 TO_JSON

Will serialize the consent object into a hash reference. The objective is to be used by L<JSON> package.
Expand All @@ -351,7 +362,7 @@ With option C<convert_blessed>, the encoder will call this method.
use GDPR::IAB::TCFv2;

my $consent = GDPR::IAB::TCFv2->Parse(
'COyiILmOyiILmADACHENAPCAAAAAAAAAAAAAE5QBgALgAqgD8AQACSwEygJyAAAAAA',
'COyiILmOyiILmADACHENAPCAAAAAAAAAAAAAE5QBgALgAqgD8AQACSwEygJyAAAAAA.argAC0gAAAAAAAAAAAA',
json => {
compact => 1,
date_format => sub { # can be omitted, with DateTimeX::TO_JSON
Expand Down Expand Up @@ -380,6 +391,25 @@ Outputs:
"cmp_id" : 3,
"purpose_one_treatment" : false,
"publisher" : {
"consents" : [
2,
4,
6,
8,
9,
10
],
"legitimate_interests" : [
2,
4,
5,
7,
10
],
"custom_purpose" : {
"consents" : [],
"legitimate_interests" : []
},
"restrictions" : {}
},
"special_features_opt_in" : [],
Expand Down
Loading

0 comments on commit 9058e3d

Please sign in to comment.