ATLAS-5363: Atlas Documentation UI: REST API documentation styling broken on atlas.apache.org due to CSP violation - #721
Open
Brijesh619 wants to merge 1 commit into
Open
Conversation
…oken on atlas.apache.org due to CSP violation
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.
What changes were proposed in this pull request?
This PR resolves ATLAS-5363 by fixing the broken styling on the Enunciate-generated REST API documentation caused by Content Security Policy (CSP) violations on
atlas.apache.org.Previously, the generated API docs loaded Bootstrap, jQuery, and prettify assets from external CDNs, which were blocked by the strict CSP rules on the Apache domain, resulting in unstyled pages.
This patch introduces the following changes:
bootstrap.min.css,bootstrap.min.js,jquery-1.12.2.min.js, andrun_prettify.js) intowebapp/src/main/enunciate-assets.webapp/pom.xmlto copy these local assets into the generated Enunciate documentation output directories (target/api/v2/andtarget/api/v2/apidocs/ui/) during the build.<replace>task in the build process to scan the generated Enunciate HTML files and swap out the external CDN URLs for local, relative paths pointing to the bundled CSS/JS files.How was this patch tested?
mvn clean packageand verified that theenunciate-assetsare correctly copied intowebapp/target/api/v2/and its subdirectories.index.htmland verified that the CDN links were successfully replaced with relative paths (e.g.,href="css/bootstrap.min.css"andsrc="js/jquery-1.12.2.min.js").webapp/target/api/v2/apidocs/directory locally and verified in the browser that the styling, layout, and JavaScript formatting (run_prettify) load properly without any CSP errors in the browser console.