From f0b94a945d7363c8cdd8f1a59626b7b4e914e6e9 Mon Sep 17 00:00:00 2001 From: zhouyx Date: Wed, 13 May 2020 17:19:45 -0700 Subject: [PATCH 1/2] expand consent string size limit to 1024 --- extensions/amp-consent/0.1/consent-state-manager.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/extensions/amp-consent/0.1/consent-state-manager.js b/extensions/amp-consent/0.1/consent-state-manager.js index eebe6c7eaf92..ea7fe233fd99 100644 --- a/extensions/amp-consent/0.1/consent-state-manager.js +++ b/extensions/amp-consent/0.1/consent-state-manager.js @@ -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 { /** @@ -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. ' + From 46b4096b6cead8f457de441fd45c397e2f2241b0 Mon Sep 17 00:00:00 2001 From: zhouyx Date: Wed, 13 May 2020 17:23:14 -0700 Subject: [PATCH 2/2] update doc --- extensions/amp-consent/integrating-consent.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/amp-consent/integrating-consent.md b/extensions/amp-consent/integrating-consent.md index 388414bf8424..62b71b9f9b04 100644 --- a/extensions/amp-consent/integrating-consent.md +++ b/extensions/amp-consent/integrating-consent.md @@ -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 `` 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 `` 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.