Repository navigation
Load the AWS WAF SDK from the page head - #4841
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member
Author
|
Replaced by #4842. Loading |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r review by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eview by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4841/ Sample changed pages: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
waf.tsadded the SDK script and checked forwindow.AwsWafIntegrationon itsloadevent.jsapi.jsis a loader forchallenge.js, and the global only exists afterchallenge.jsruns, so the check failed. Page feedback had the same failure on first load, hidden by its retry on submit.waf_integration_urlis set, so a JS loader adds nothing. AWS documents a plain script tag in<head>.Part of elastic/docs-eng-team#1192
What
_Head.cshtmlrenders<script src="{waf_integration_url}" async>when the effective frontend config has the URL: assembler builds, not air-gapped. The token fetch starts while the HTML parses, and a slow WAF endpoint can't delayDOMContentLoaded.waf.tsno longer injects scripts.waitForWafSdkwaits up to 5 seconds forAwsWafIntegration. Page feedback and telemetry use it, and the page feedback warm-up effect is gone.docs/development/page-feedback.mddescribes the head tag and why the URL is the CAPTCHAjsapi.js.Notes
Keep
jsapi.js, the documented route for our web ACLs. The console's Intelligent threat integration tab, which gives a per-web-ACLchallenge.js, only lists web ACLs with the ACFP or ATP rule groups or targeted Bot Control. Ours use common Bot Control. The account-levelchallenge.jsalso works, but AWS doesn't document that URL (Load the AWS WAF challenge.js directly on edge and demo #4842, closed).Seen on edge in a clean browser context with the old loader:
jsapi.jsappendedjsapi.jsload, global missing (old loader fails here)AwsWafIntegrationsetmp_verifydone/o/lexport, cookie present by luckhtmx keeps the identical head tag across navigations, as with
elastic-nav.js, so the SDK isn't loaded again.🤖 Generated with Claude Code