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

examples of html, separation of transforming data, report rendering #24

Merged
merged 5 commits into from
Sep 9, 2020
Merged

Conversation

nichtsfrei
Copy link
Member

What:

  1. create templates for text/html and pdf nvt grouping rendering
  2. separated data transformation from report generation

Why:

  1. so far only host on application pdf was support. To have working examples for nvt as well as html host and nvt new templates were introduced
  2. since there is no way to embed the image data into an html document there needs to be an GET endpoint to show the html data instead of an post. Since this page will be used with a browser we need a way to transport the report data upfront.

How:

> curl -X POST 'http://localhost:8000/transform?grouping=nvt'\
    -H 'Content-Type: application/xml'\
    -H 'Accept: application/json'\
    -d @test_data/longer_report.xml
  
  "scanreport-nvt-9a233b0d-713c-4f22-9e15-f6e5090873e3"⏎
> curl -v 'http://localhost:8000/report/scanreport-nvt-9a233b0d-713c-4f22-9e15-f6e5090873e3' -H 'Accept: application/pdf'

Checklist:

@nichtsfrei nichtsfrei requested a review from a team as a code owner September 9, 2020 12:36
For HTML reports we need to have an GET endpoint instead of a post so
that a report can be shown via a browser without the need for the actual
report data.

To support that this commit separates the data transformation by adding
a post endpoint and storing the transformed json.
This endpoint returns an identifier which then can be used to generate
the actual report as an path parameter on `/report/$ID`.

To support visits of an link more than once a cache will be introduces to
prevent unnecessary generation of a report.
y0urself
y0urself previously approved these changes Sep 9, 2020
@nichtsfrei nichtsfrei merged commit 635346c into greenbone:master Sep 9, 2020
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.

None yet

2 participants