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
data-credentials support for amp-story bookend #21679
data-credentials support for amp-story bookend #21679
Conversation
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
6b12cb4
to
8cd4c15
Compare
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
/cc @calebcordry @newmuis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing. Just a small nit.
credentials = bookendEl.getAttribute( | ||
BOOKEND_CREDENTIALS_ATTRIBUTE_NAME | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be shortened to const credentials = bookendEl.getAttribute(BOOKEND_CREDENTIALS_ATTRIBUTE_NAME);
as it will be null if nonexistent. You may have to change the type below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks again!
@calebcordry thanks for your input! It appears that one test on saucelabs has failed, and I believe it is unrelated. Could it be flakey tests? Is there any way for me to re-run those tests to see if that is the case? |
Sauce labs is non blocking, and probably was a flake. I restarted it just in case. I will merged when it finishes. |
According to https://www.ampproject.org/docs/fundamentals/amp-cors-requests#utilizing-cookies-for-cors-requests, most components that allow CORS requests allow the developer to optionally set the credentials mode through a 'credentials' or 'data-credentials' attribute. This does not work for amp-story bookend.
Fixes #21598