Skip to content
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

Content Security Policy #991

Open
atul-gawali opened this issue Sep 26, 2024 · 8 comments
Open

Content Security Policy #991

atul-gawali opened this issue Sep 26, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@atul-gawali
Copy link

I am looking for a sample code of springwolf-ui (without plugin) using asynapi file. I tried steps provided at https://www.springwolf.dev/docs/faq but couldn't get the springwolf UI generated from my asyncapi file placed in resources folder of my spring boot app

Copy link

Welcome to Springwolf. Thanks a lot for reporting your first issue. Please check out our contributors guide and feel free to join us on discord.

@sam0r040
Copy link
Collaborator

Hi @atul-gawali,
unfortunately there is no example project for using springwolf-ui as a standalone component. Can you provide more information on what is not working after following the documentation? For example:

  • Does your spring boot backend serve the async api file for the correct path?
  • Does your spring boot backend serve the springwolf ui?
  • Is there an error in the browser?

@sam0r040 sam0r040 added the waiting for feedback Waiting for user feedback/response label Sep 27, 2024
@abhishekanand1902
Copy link

Hi @sam0r040
I am also try to do similar thing in my spring boot project to render asyncapi json in springwolf-ui.
We have a asyncapi.json file and now based on this json file we want to generate the async-ui in our spring-boot application.

Q1. Does your spring boot backend serve the async api file for the correct path?

We put the asyncapi.json file in /resources/springwolf/docs as per the documentation. Btw we tried to put the file in /resources/static, /resources and /META-INF/resources/

Q2. Does your spring boot backend serve the springwolf ui?

We added below springwolf-ui dependency.

io.github.springwolf springwolf-ui 1.6.0

Q3. Is there an error in the browser?

No error is showing.

Do we need any properties in application.properties for the filepath of ayncapi.json file?

@github-actions github-actions bot removed the waiting for feedback Waiting for user feedback/response label Sep 30, 2024
@ajit2k21
Copy link

Hi @sam0r040

We wrote spring boot application by following the documentation https://www.springwolf.dev/docs/faq to display the UI for asyncapi file(asyncapi.json). But the application doesn't display the details as in asyncapi file. Here is a screenshot of the browser.
image

Here is the sample code springwolf-ui.zip. Can you please check the sample code?

@timonback
Copy link
Member

@ajit2k21 Have you checked the browsers network tab to see whether the GET request is successful?

Just to double check: The asyncapi file is located at springwolf/docs without any extension (docs is the file name)?

@ajit2k21
Copy link

@timonback Thanks for reply. Now I am able to display the asyncapi-ui.html in the sample application. We integrated the springwolf-ui dependency to our product but found some issues with ui like as below because our product follow the "Content Secure Policy"(Reference: https://cheatsheetseries.owasp.org/cheatsheets/Content_Security_Policy_Cheat_Sheet.html) so its block the inline the css and js. Here is the screenshot of asyncapi-ui.html and its contents. It has inline css codes.
image

As per the Content Secure Policy, all inline CSS and JS contents must be in external files and links in HTML files.

Can you please suggest to me how can we resolve the Content Secure Policy issue? Are you planning to work on this issue?

@timonback
Copy link
Member

Hi @ajit2k21 , great to hear.

You are welcome to contribute a Content Security Policy to make Springwolf better.

We use a default Angular application setup on the frontend, see springwolf-ui folder.
CSP sound like a common problem, there are probably helpful guides out there.

@timonback timonback changed the title looking for example of springwolf-ui using asynapi file Content Security Policy Oct 18, 2024
@timonback timonback added the enhancement New feature or request label Oct 18, 2024
@ajit2k21
Copy link

Hi @ajit2k21 , great to hear.

You are welcome to contribute a Content Security Policy to make Springwolf better.

We use a default Angular application setup on the frontend, see springwolf-ui folder. CSP sound like a common problem, there are probably helpful guides out there.

Is there any update on the "Content Security Policy" enhancement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants