Skip to content

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
apache:masterfrom
Brijesh619:ATLAS-5363
Open

ATLAS-5363: Atlas Documentation UI: REST API documentation styling broken on atlas.apache.org due to CSP violation#721
Brijesh619 wants to merge 1 commit into
apache:masterfrom
Brijesh619:ATLAS-5363

Conversation

@Brijesh619

Copy link
Copy Markdown
Contributor

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:

  • Adds local, static copies of the required frontend assets (bootstrap.min.css, bootstrap.min.js, jquery-1.12.2.min.js, and run_prettify.js) into webapp/src/main/enunciate-assets.
  • Updates webapp/pom.xml to copy these local assets into the generated Enunciate documentation output directories (target/api/v2/ and target/api/v2/apidocs/ui/) during the build.
  • Adds an Ant <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?

  • Manual Build Testing: Ran mvn clean package and verified that the enunciate-assets are correctly copied into webapp/target/api/v2/ and its subdirectories.
  • HTML Verification: Inspected the generated index.html and verified that the CDN links were successfully replaced with relative paths (e.g., href="css/bootstrap.min.css" and src="js/jquery-1.12.2.min.js").
  • Local Browser Testing: Served the generated 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.

…oken on atlas.apache.org due to CSP violation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant