Sanitizer stripping amp-subscriptions encrypted ciphertext
-
We are attempting to implement encrypted paywall content as per the amp.dev guide here. I’ve been successful in getting an encrypted example working on a static page.
When an encrypted subscriptions section is passed through the AMP sanitizer, it seems to strip the script element containing the encrypted cipher text for the article.
Looking at the SubscriptionsSectionContentSwgAmpCacheNonce TagSpec, it looks like the section needed a mandatory Attribute::SWG_AMP_CACHE_NONCE which resolves to ‘swg-amp-cache-nonce’ which is also stripped from the section (Curiously ‘swg_amp_cache_nonce’ is not).
Essentially;<section subscriptions-section="content" encrypted swg_amp_cache_nonce="asd"
<script type="application/octet-stream" ciphertext=""><![CDATA[Valid Cipher]]></script>
</section>Is being sanitized to
<section subscriptions-section="content" encrypted swg_amp_cache_nonce="asd"></section>
I have tried all combinations of the above such as;
- adding =”” to both encrypted/ciphertext attributes
- With/Without CDATA
- swg_amp_cache_nonce vs swg-amp-cache-nonce
All of these combinations result in the script tag being stripped each time. When amp is disabled, the tag combination displays as expected.
- You must be logged in to reply to this topic.