Skip to content

Commit

Permalink
Temporarily disable amp-script until interaction of amp-script… (#23147)
Browse files Browse the repository at this point in the history
* Temporarily disable amp-script until interaction of amp-script and signed exchanges has
been security reviewed.

* Update tests.
  • Loading branch information
Greg Grothaus authored Jul 2, 2019
1 parent 9fe8664 commit b8e19c1
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ FAIL
| <amp-script layout=container src="https://example.com/foo.js"><div class="root"><p>Some text to hydrate.</p></div></amp-script>
| </body>
>> ^~~~~~~~~
amp-script/0.1/test/validator-amp-script-not-origin-trial.html:34:6 The tag 'amp-experiment-token' is missing or incorrect, but required by 'amp-script'. (see https://amp.dev/documentation/components/amp-script) [AMP_TAG_PROBLEM]
amp-script/0.1/test/validator-amp-script-not-origin-trial.html:34:6 The tag 'amp-experiment-token' is missing or incorrect, but required by 'amp-script'. (see https://amp.dev/documentation/components/amp-script) [AMP_TAG_PROBLEM]
8 changes: 5 additions & 3 deletions extensions/amp-script/0.1/test/validator-amp-script.out
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ FAIL
| <!-- Valid: With 'script' attribute. -->
| <amp-script layout=container script=hello></amp-script>
| <script type=text/plain target=amp-script id=hello>
>> ^~~~~~~~~
amp-script/0.1/test/validator-amp-script.html:34:2 Custom JavaScript is not allowed. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml#html-tags) [CUSTOM_JAVASCRIPT_DISALLOWED]
| document.body.textContent = "Hello world!";
| </script>
|
Expand Down Expand Up @@ -68,7 +70,7 @@ amp-script/0.1/test/validator-amp-script.html:55:2 Custom JavaScript is not allo
| <!-- Invalid: Local script with invalid 'type'. -->
| <script type=text/amp-script target=amp-script id=hello>
>> ^~~~~~~~~
amp-script/0.1/test/validator-amp-script.html:60:2 The attribute 'type' in tag 'amp-script extension local script' is set to the invalid value 'text/amp-script'. (see https://amp.dev/documentation/components/amp-script) [DISALLOWED_HTML]
amp-script/0.1/test/validator-amp-script.html:60:2 Custom JavaScript is not allowed. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml#html-tags) [CUSTOM_JAVASCRIPT_DISALLOWED]
| document.body.textContent = "Hello World!";
| </script>
|
Expand All @@ -89,7 +91,7 @@ amp-script/0.1/test/validator-amp-script.html:70:2 Custom JavaScript is not allo
| <!-- Invalid: Local script without 'id' attribute. -->
| <script type=text/plain target=amp-script>
>> ^~~~~~~~~
amp-script/0.1/test/validator-amp-script.html:75:2 The mandatory attribute 'id' is missing in tag 'amp-script extension local script'. (see https://amp.dev/documentation/components/amp-script) [AMP_TAG_PROBLEM]
amp-script/0.1/test/validator-amp-script.html:75:2 Custom JavaScript is not allowed. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml#html-tags) [CUSTOM_JAVASCRIPT_DISALLOWED]
| document.body.textContent = "Hello World!";
| </script>
| </body>
| </body>
58 changes: 30 additions & 28 deletions extensions/amp-script/validator-amp-script.protoascii
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,36 @@ tags: {
}
attr_lists: "common-extension-attrs"
}
tags: { # <amp-script> (local script)
html_format: AMP
tag_name: "SCRIPT"
spec_name: "amp-script extension local script"
requires_extension: "amp-script"
attrs: {
name: "target"
mandatory: true
value: "amp-script"
dispatch_key: NAME_VALUE_DISPATCH
}
attrs: {
name: "type"
mandatory: true
value_casei: "text/plain"
}
attr_lists: "mandatory-id-attr"
attr_lists: "nonce-attr"
cdata: {
max_bytes: 10000
max_bytes_spec_url: "https://amp.dev/documentation/components/amp-script#faq"
blacklisted_cdata_regex: {
regex: "<!--"
error_message: "html comments"
}
}
spec_url: "https://amp.dev/documentation/components/amp-script"
}
# Temporarily disable until interaction of amp-script and signed exchanges has
# been security reviewed.
#tags: { # <amp-script> (local script)
# html_format: AMP
# tag_name: "SCRIPT"
# spec_name: "amp-script extension local script"
# requires_extension: "amp-script"
# attrs: {
# name: "target"
# mandatory: true
# value: "amp-script"
# dispatch_key: NAME_VALUE_DISPATCH
# }
# attrs: {
# name: "type"
# mandatory: true
# value_casei: "text/plain"
# }
# attr_lists: "mandatory-id-attr"
# attr_lists: "nonce-attr"
# cdata: {
# max_bytes: 10000
# max_bytes_spec_url: "https://amp.dev/documentation/components/amp-script#faq"
# blacklisted_cdata_regex: {
# regex: "<!--"
# error_message: "html comments"
# }
# }
# spec_url: "https://amp.dev/documentation/components/amp-script"
#}
tags: { # <amp-script>
html_format: AMP
tag_name: "AMP-SCRIPT"
Expand Down

0 comments on commit b8e19c1

Please sign in to comment.