-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Refactor API parsers #7002
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
Refactor API parsers #7002
Conversation
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Bumps [packageurl-python](https://github.com/package-url/packageurl-python) from 0.10.3 to 0.10.4. - [Release notes](https://github.com/package-url/packageurl-python/releases) - [Changelog](https://github.com/package-url/packageurl-python/blob/main/CHANGELOG.rst) - [Commits](package-url/packageurl-python@v0.10.3...v0.10.4) --- updated-dependencies: - dependency-name: packageurl-python dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [sqlalchemy](https://github.com/sqlalchemy/sqlalchemy) from 1.4.41 to 1.4.42. - [Release notes](https://github.com/sqlalchemy/sqlalchemy/releases) - [Changelog](https://github.com/sqlalchemy/sqlalchemy/blob/main/CHANGES.rst) - [Commits](https://github.com/sqlalchemy/sqlalchemy/commits) --- updated-dependencies: - dependency-name: sqlalchemy dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ine (docker-compose.yml) (DefectDojo#6993) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
… (.github/workflows/release-drafter.yml) (DefectDojo#7000) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…Dojo#6998) Bumps python from 3.8.14-slim-bullseye to 3.8.15-slim-bullseye. --- updated-dependencies: - dependency-name: python dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#7005) Update the Cobalt API parser's `CobaltAPI` client to fetch the maximum allowed number of findings and assets.
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
…lows/submodule-update.yml) (DefectDojo#7014) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
DefectDojo#7008) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…tDojo#6066) * [FIX] Issues on disconnection and connection using OAuth Fix two issues: - When disconnecting using OAuth and "SHOW_LOGIN_FORM = False", as return URL is not /login and does not contains next parameter, an error 500 is trigerred. - When connecing using OAuth and "SHOW_LOGIN_FORM = False", message "You have logged out" is displayed after logging in. * Fixing Flake8 issues * Update package.json * Update __init__.py * Update views.py * Update pipeline.py * Update Chart.yaml * Update __init__.py * Update views.py * Update pipeline.py * Update pipeline.py * Update pipeline.py
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
1368f28
to
d548a75
Compare
d548a75
to
6cd86d8
Compare
Hi, I would like to ask about your opinion about this PR (and testing if it is possible).
Thanks in advance. |
This is good. @kiblik |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good and works correctly from Cobalt's side, thanks @kiblik
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work as always 🤙🏼
PR is based on my question in Slack: https://owasp.slack.com/archives/C014H3ZV9U6/p1661299601825669
Summary
The number of tools/parsers which do not only parse uploaded files but communicate with API is increasing. This PR does some small clean-up and defines a set of rules to keep it maintainable and improve UX for using API parsers (simplified way to add
Tool Type
,Tool Config
andApiScanConfig
).dojo/tools/api_<tool>
- yes, this means renames likesonarqube_api
toapi_sonarqube
api_scan_configuration_hint
which returnsstring
with a hint, whichservice_key
and how should be set upapi_scan_configuration_hint
and print it inadd
andedit
viewRequired parts: api_client, importer, parser
Write tests
Optional but recommened functions for api_client: test_connection, test_product_connection
Tool_Type.objects.get_or_create(name='XYZ')
. Parsers should be stateless (they shouldn't create these entries).ToolType
,ToolConfig
andApiScanConfig
Example of UI changes
Tool Type
forBlackDuck
,Cobalt.io
andVulners
exist. There is noToll Type
forBugcrowd
,Edgescan
andSonarQube
- I removed them only because of this test. They are by default there with a new or upgraded instance.<a>
, it is referencing to page where the user can create missingTool Type
Tool Type
. The link is now pointing to the page for theTool Config
creationTool Type
is automatically fieldedTool Config
is ready. The description is updated to hint fromapi_scan_configuration_hint