GithubHelp home page GithubHelp logo

bhanditz / consent-string-sdk-java Goto Github PK

View Code? Open in Web Editor NEW

This project forked from interactiveadvertisingbureau/consent-string-sdk-java

0.0 1.0 0.0 156 KB

Transparency and Consent Framework Consent String SDK - Java

Home Page: https://iabtechlab.com/gdpr-tech

License: MIT License

Java 100.00%

consent-string-sdk-java's Introduction

GitHub release

Transparency and Consent Framework: Consent-String-SDK-Java

Encode and decode web-safe base64 consent information with the IAB EU's GDPR Transparency and Consent Framework.

This library is a Java reference implementation for dealing with consent strings in the IAB EU's GDPR Transparency and Consent Framework.
It should be used by anyone who receives or sends consent information like vendors that receive consent data from a partner, or consent management platforms that need to encode/decode the global cookie.

The IAB specification for the consent string format is available on the IAB Github (section "Vendor Consent Cookie Format").

This library supports the version v1.1 of the specification. It can encode and decode consent strings with version bit 1.

IAB Europe Transparency and Consent Framework

In November 2017, IAB Europe and a cross-section of the publishing and advertising industry, announced a new Transparency & Consent Framework to help publishers, advertisers and technology companies comply with key elements of GDPR. The Framework will give the publishing and advertising industries a common language with which to communicate consumer consent for the delivery of relevant online advertising and content.

Framework Technical specifications available at: https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework

Consent String SDK (Java)

Installation

Add dependency to you pom.xml

<dependency>
  <groupId>com.conversantmedia.gdpr</groupId>
  <artifactId>consent-string-sdk-java</artifactId>
  <version>3.0.2</version>
</dependency>

Usage

Decoding consent string

final VendorConsent vendorConsent = VendorConsentDecoder.fromBase64String(consentString);

if (vendorConsent.isVendorAllowed(vendorId) && vendorConsent.isPurposeAllowed(STORAGE_AND_ACCESS) {
   ...
} else {
   ...
}

Creating vendor consent

final VendorConsent vendorConsent = new VendorConsentBuilder()
        .withConsentRecordCreatedOn(now)
        .withConsentRecordLastUpdatedOn(now)
        .withCmpID(cmpId)
        .withCmpVersion(cmpVersion)
        .withConsentScreenID(consentScreenID)
        .withConsentLanguage(consentLanguage)
        .withVendorListVersion(vendorListVersion)
        .withAllowedPurposes(allowedPurposes)
        .withMaxVendorId(maxVendorId)
        .withVendorEncodingType(vendorEncodingType)
        .withDefaultConsent(false)
        .withRangeEntries(rangeEntries)
        .build();

Encoding vendor consent to string

final String base64String = VendorConsentEncoder.toBase64String(vendorConsent); 

Building

Use Gradle command to build the project

git clone https://github.com/InteractiveAdvertisingBureau/Consent-String-SDK-Java.git
cd  Consent-String-SDK-Java
./gradlew build

Contributing

Branching

We use following branching setup

  1. master branch is the current branch where active development is taking place and is associated with the latest release
  2. Previous releases are under branches release/x, where x is the major release version, for example release/1. Those branches are used for bug bixes in previous releases
  3. Each release version is associated with a git tag, for example tag v2.0.0

Pull request procedures

  1. Make sure there is a unit test for each added feature. If pull request is for bug fix, create a unit test that would trigger a bug
  2. Make sure all tests pass
  3. Update this document if usage is changing

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

About

About IAB Tech Lab

The IAB Technology Laboratory (Tech Lab) is a non-profit research and development consortium that produces and provides standards, software, and services to drive growth of an effective and sustainable global digital media ecosystem. Comprised of digital publishers and ad technology firms, as well as marketers, agencies, and other companies with interests in the interactive marketing arena, IAB Tech Lab aims to enable brand and media growth via a transparent, safe, effective supply chain, simpler and more consistent measurement, and better advertising experiences for consumers, with a focus on mobile and ?TV?/digital video channel enablement. The IAB Tech Lab portfolio includes the DigiTrust real-time standardized identity service designed to improve the digital experience for consumers, publishers, advertisers, and third-party platforms. Board members include AppNexus, ExtremeReach, Google, GroupM, Hearst Digital Media, Integral Ad Science, Index Exchange, LinkedIn, MediaMath, Microsoft, Moat, Pandora, PubMatic, Quantcast, Telaria, The Trade Desk, and Yahoo! Japan. Established in 2014, the IAB Tech Lab is headquartered in New York City with an office in San Francisco and representation in Seattle and London.

Learn more about IAB Tech Lab here: https://www.iabtechlab.com/

About IAB Europe

IAB Europe is the voice of digital business and the leading European-level industry association for the interactive advertising ecosystem. Its mission is to promote the development of this innovative sector by shaping the regulatory environment, investing in research and education, and developing and facilitating the uptake of business standards.

Learn more about IAB Europe here: https://www.iabeurope.eu/

Contributors and Technical Governance

GDPR Technical Working Group members provide contributions to this repository. Participants in the GDPR Technical Working group must be members of IAB Tech Lab. Technical Governance for the project is provided by the IAB Tech Lab GDPR Commit Group.

consent-string-sdk-java's People

Contributors

anupash avatar jenniferiab avatar jvdadda avatar kevin-p-kerr avatar ktrushin avatar lanusau avatar nylar avatar turu avatar twz123 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.