Skip to content

Implement Consent Module and Consent State#180

Merged
addb merged 5 commits intoadobe:consentfrom
addb:consentImplementation
Aug 12, 2024
Merged

Implement Consent Module and Consent State#180
addb merged 5 commits intoadobe:consentfrom
addb:consentImplementation

Conversation

@addb
Copy link
Copy Markdown
Contributor

@addb addb commented Jul 31, 2024

Consent Behavior 📔

  • SDK will not read or validate setConsent API payload.
  • SDK will maintain consent (collect) based on Konductor responses
  • SDK(EdgeModule) will interpret the consent from consentState and drop, queue or send request based consent values.
  • Consent request will be sent irrespective of collect consent value.

Description

  • Added ConsentState which handles setting and getting consent from cache, persistence or configuration.
  • ConsentState will be passed to all the extension that depend on Consent status
  • ConsentModule is the primary module which will handle and update consentState other modules are just expected to read from the consentState and not manipulate it
  • Added tests
  • For pending, ConsentModule needs to intervene and not queue the consent requests, for all the other cases, setConsent API would queue the request with edge and consent state would be updated based on edge response handle

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

addb added 3 commits July 30, 2024 17:55
… the dependent modules. ConsentModule will be the primary class that would manipulate consentState, others modules are expected to just read from consentState but not modify it.
@addb addb linked an issue Jul 31, 2024 that may be closed by this pull request
Copy link
Copy Markdown

@kevinlind kevinlind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a few comments. My main concern is the Consent module only handles the "collect" Consent, and not all possible Consents. I'm wondering why restrict Roku to just the collect Consent value?

@addb addb requested a review from kevinlind August 9, 2024 00:48
Copy link
Copy Markdown

@kevinlind kevinlind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. I've added comments on a few minor issues.

_getCollectConsentFromPersistence: function() as string
''' Get the collect consent from persistence
''' y|p|n
collectConsentValue = consent.value.collect.val
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: with the collect consent value found, you could break out of the for each loop here.

@addb addb requested a review from kevinlind August 12, 2024 02:58
Copy link
Copy Markdown

@kevinlind kevinlind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@addb addb merged commit 2519dae into adobe:consent Aug 12, 2024
@addb addb deleted the consentImplementation branch September 5, 2024 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement setConsent API

2 participants