Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand consent string size limit to 1024 #28400

Merged
merged 2 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions extensions/amp-consent/0.1/consent-state-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const TAG = 'CONSENT-STATE-MANAGER';
const CID_SCOPE = 'AMP-CONSENT';

/** @visibleForTesting */
export const CONSENT_STRING_MAX_LENGTH = 200;
export const CONSENT_STRING_MAX_LENGTH = 1024;

export class ConsentStateManager {
/**
Expand Down Expand Up @@ -377,8 +377,7 @@ export class ConsentInstance {
const consentStr = consentInfo['consentString'];
if (consentStr && consentStr.length > CONSENT_STRING_MAX_LENGTH) {
// Verify the length of consentString.
// 200 * 2 (utf8Encode) * 4/3 (base64) = 533 bytes.
// TODO: Need utf8Encode if necessary.
// 1024 * 4/3 (base64) = 1336 bytes.
user().error(
TAG,
'Cannot store consentString which length exceeds %s. ' +
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-consent/integrating-consent.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To add your consent management service to AMP runtime, it is expected that you:
- Meet the restrictions that the AMP runtime applies to ensure a good user experience. These includes
- Enforce the size of the consent prompt. The only two allowed sizes are the initial size (`width: 100vw`, `height: 30vh`), and the full screen size (`width: 100vw`, `height: 100%`) after user interactions.
- A default placeholder will be displayed before the consent prompt iframe is ready.
- Enforce the size of the stored consent information. 200 character length is the current limit. Please [file an issue](https://github.com/ampproject/amphtml/issues/new) if you find that not sufficient.
- Enforce the size of the stored consent information. 1024 character length is the limit. Please [file an issue](https://github.com/ampproject/amphtml/issues/new) if you find that not sufficient.
- Understand that including `<amp-consent type='yourName'></amp-consent>` on the page won't block any components by default. **Please make sure to inform your service users to block AMP components either by the `<meta name="amp-consent-blocking">` metaTag, or the `data-block-on-consent` attribute.**
- Understand that AMP Consent doesn't attempt to interpret the consent info string from the CMP. Vendors can access the consent info string from CMPs via [provided APIs](https://github.com/ampproject/amphtml/blob/master/ads/README.md#amp-consent-integration). It's up to the CMP and service provider vendors to agree on the format of the consent info string.
- Create an [Intent-To-Implement issue](../../CONTRIBUTING.md#contributing-features) stating that you'll be adding support to your CMP service to AMP. A great start point is to follow the `_ping_` CMP service implementation that the AMP team creates for testing purpose.
Expand Down