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

Update opensight from main #4159

Merged
merged 151 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 150 commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
254d64c
Add: Add a react hook for storing instance variables
bjoernricks Jun 6, 2024
23bb596
Add a test for useInstanceVariable hook
bjoernricks Jun 6, 2024
ce1c182
CI: Allow the dependency review workflow to write a message to the PR
bjoernricks Jun 6, 2024
a6d9b92
Add: Add a useShallowEqualSelector hook
bjoernricks Jun 6, 2024
b94db25
Add: Add a usePageFilter hook to get the applied filter of a page
bjoernricks Jun 6, 2024
fb4e6cd
Allow to change, reset and remove a page filter
bjoernricks Jun 6, 2024
b9e2cf5
Use useShallowEqualSelector in usePageFilter
bjoernricks Jun 6, 2024
2ee883c
Add tests for usePageFilter hook
bjoernricks Jun 6, 2024
3786b01
Refactor FilterProvider to use usePageFilter internally
bjoernricks Jun 6, 2024
5f0acf8
Reorder variable and hook definitions
bjoernricks Jun 7, 2024
3371ec5
Add: CVSS 4.0 Calculator (#4036)
daniele-mng Jun 7, 2024
3c1d85e
Add: Add a usePreviousValue hook
bjoernricks Jun 7, 2024
827340e
Add: Eslint rules
daniele-mng Jun 7, 2024
78f5da0
fix header
daniele-mng Jun 7, 2024
eb39e0c
fix header in jsx files
daniele-mng Jun 7, 2024
566b43f
fix gpl 2
daniele-mng Jun 7, 2024
dcaabbf
ignore specific year in header
daniele-mng Jun 7, 2024
d3e9a3e
adjust rule for files
daniele-mng Jun 7, 2024
126712d
Add: Support CVSS 4.0 fields in CVEs.
a-h-abdelsalam Jun 7, 2024
2cab2ab
Add more tests.
a-h-abdelsalam Jun 7, 2024
90d9dc9
Capitalize first letter in metric values instead of all caps
a-h-abdelsalam Jun 10, 2024
43053c5
Merge pull request #4059 from greenbone/handle-cvss4-for-cves
a-h-abdelsalam Jun 12, 2024
a5a0c42
Add: Implement a useTiming hook
bjoernricks Jun 7, 2024
7e8e2fa
Change: withIconSize HOC to hook (#4060)
daniele-mng Jun 12, 2024
ea02ad7
Bump braces from 3.0.2 to 3.0.3
dependabot[bot] Jun 12, 2024
4ef0714
Merge pull request #4061 from greenbone/dependabot/npm_and_yarn/brace…
a-h-abdelsalam Jun 12, 2024
2bf49dc
Add: Add a useReload hook to make the Reload component obsolete
bjoernricks Jun 13, 2024
3af32a4
Add: Add a useFilterSortBy hook
bjoernricks Jun 13, 2024
5a78a99
Add: Add a usePagination hook
bjoernricks Jun 13, 2024
2528ea5
Add: Add a useSelection hook
bjoernricks Jun 13, 2024
9ddb2d6
Add: eslint rule camelCase
daniele-mng Jun 12, 2024
12f9e5c
create exeptions
daniele-mng Jun 14, 2024
7213041
Add: Add new hook to determine the loading interval for entities pages
bjoernricks Jun 13, 2024
c125bc9
Add: Add a BulkTags component for handling tagging of entities
bjoernricks Jun 17, 2024
5c7b19c
Fix: Don't pass gmp object to TagDialog onSave handle
bjoernricks Jun 17, 2024
0ed5685
Change: Allow to show errors in the TagsDialog
bjoernricks Jun 17, 2024
24871a0
Add: Add a useDownload hook
bjoernricks Apr 16, 2024
97fcfeb
Add a simple test for useDownload hook
bjoernricks Jun 17, 2024
791f36d
Bump ws from 8.16.0 to 8.17.1
dependabot[bot] Jun 18, 2024
e9a1b84
Merge pull request #4072 from greenbone/dependabot/npm_and_yarn/ws-8.…
a-h-abdelsalam Jun 18, 2024
a0042e4
Add: Toggle to enable EPSS fields
timopollmeier Jun 5, 2024
d79623d
Clean up EPSS on CVE and NVT pages
timopollmeier Jun 11, 2024
655a2a4
Remove .jsx suffix from useGmp and cvelink imports
timopollmeier Jun 11, 2024
d87d2a5
Add enableEPSS to readme
timopollmeier Jun 11, 2024
f955c28
Use camelCase for EPSS local variables
timopollmeier Jun 18, 2024
51d0337
Change: Use `.js` as file suffix for hooks
bjoernricks Jun 18, 2024
9dbee64
Change: Extract ErrorMarker from useFormValidation hook module
bjoernricks Jun 18, 2024
0347710
Simplify ErrorMarker component
bjoernricks Jun 18, 2024
5d09434
Change: Refactor PortLists page to a HOC less entities page
bjoernricks Jun 18, 2024
ec97f7a
Add: EPSS scoring info to results
timopollmeier Jun 20, 2024
a017000
Change: Move useCapabilities hook to hooks directory
bjoernricks Jun 19, 2024
e72ec05
Remove: Remove unused useUserIsLoggedIn hook
bjoernricks Jun 19, 2024
b6d140d
Change: Move useUserName hook to hooks directory
bjoernricks Jun 19, 2024
ec2b6b9
Change: Move useUserSessionTimeout hook to hooks directory
bjoernricks Jun 19, 2024
68b3486
Change: Move useUserTimezone hook to hooks directory
bjoernricks Jun 19, 2024
25af2e2
Change: Move useLicense hook to hooks directory
bjoernricks Jun 19, 2024
c4542fd
Change: Move useGmp hook to hooks directory
bjoernricks Jun 19, 2024
97516f4
fix: dates inconsistencies in new task wizard and schedules
daniele-mng Jun 24, 2024
4253bc4
Automatic release to 23.1.0
greenbonebot Jun 25, 2024
b6d060c
Automatic adjustments after release [skip ci]
greenbonebot Jun 25, 2024
90ead61
Fix: Allow applying report configs to delta reports.
a-h-abdelsalam Jun 27, 2024
cd39ab5
Merge pull request #4082 from greenbone/fix-report-configs-for-delta-…
a-h-abdelsalam Jun 28, 2024
f7ef597
Automatic release to 23.1.1
greenbonebot Jun 28, 2024
27b5a40
Automatic adjustments after release [skip ci]
greenbonebot Jun 28, 2024
d6f5a75
Change: Update node version for build in release-pontos
a-h-abdelsalam Jun 28, 2024
096dbd6
Automatic release to 23.1.1
greenbonebot Jun 28, 2024
39b96ab
Automatic adjustments after release [skip ci]
greenbonebot Jun 28, 2024
01d6975
Deps: Bump docker/build-push-action from 5 to 6
dependabot[bot] Jun 28, 2024
1053a7d
Merge pull request #4078 from greenbone/dependabot/github_actions/doc…
a-h-abdelsalam Jun 28, 2024
639ce97
Add: Push workflow for greenbone registry #4075
pascalholthaus Jul 3, 2024
4ea4d3b
Merge branch 'main' into add-epss-to-results
timopollmeier Jul 3, 2024
653acd3
Remove debug statement
timopollmeier Jun 21, 2024
821926d
Update useGmp import in results table and row
timopollmeier Jul 3, 2024
6751192
Merge pull request #4077 from greenbone/add-epss-to-results
a-h-abdelsalam Jul 3, 2024
c055f65
Add: Available optional features in Capabilities
timopollmeier Jul 1, 2024
3835769
Use camelCase for capabilities, update exceptions
timopollmeier Jul 1, 2024
ba2df9c
Merge pull request #4094 from greenbone/add-features-to-capabilities
a-h-abdelsalam Jul 3, 2024
065b112
Add: conditional route component for feature flag
daniele-mng Jul 9, 2024
18a2ac2
add test
daniele-mng Jul 9, 2024
fc4198a
Update ConditionalRoute.jsx
daniele-mng Jul 9, 2024
3471fbf
Merge pull request #4095 from greenbone/add-conditional-route-for-fea…
a-h-abdelsalam Jul 9, 2024
952ec5f
Deps: Bump @testing-library/react from 15.0.6 to 16.0.0 (#4091)
dependabot[bot] Jul 11, 2024
fa3e091
Deps: Bump uuid from 9.0.1 to 10.0.0 (#4086)
dependabot[bot] Jul 11, 2024
67c7213
Deps: Bump @sentry/react from 8.7.0 to 8.13.0 (#4089)
dependabot[bot] Jul 11, 2024
7cd3ef9
Deps: Bump prettier from 3.2.5 to 3.3.2 (#4090)
dependabot[bot] Jul 11, 2024
e9bad1b
Deps: Bump the patch-updates group across 1 directory with 7 updates …
dependabot[bot] Jul 11, 2024
09a8627
Deps: Bump vite from 5.2.12 to 5.3.3 (#4100)
dependabot[bot] Jul 11, 2024
9065424
Deps: Bump typescript from 5.4.5 to 5.5.3 (#4101)
dependabot[bot] Jul 11, 2024
2be70b6
Deps: Bump @typescript-eslint/eslint-plugin from 7.12.0 to 7.16.0 (#4…
dependabot[bot] Jul 11, 2024
2596273
Deps: Bump @typescript-eslint/parser from 7.12.0 to 7.16.0 (#4097)
dependabot[bot] Jul 11, 2024
a11f731
Fix: bug loading status button in download report dialog
daniele-mng Jul 16, 2024
158aaf7
Fix: Make report configs optional in alerts and reports
timopollmeier Jul 16, 2024
8ad3e57
Use withCapabilities in alert method parts
timopollmeier Jul 22, 2024
a9f6185
Use useCapabilities hook in alert method parts
timopollmeier Jul 22, 2024
a9b91c2
Merge pull request #4104 from greenbone/make-report-configs-optional
a-h-abdelsalam Jul 22, 2024
6fc8b0a
Automatic release to 23.2.0
greenbonebot Jul 23, 2024
8195cd6
Automatic adjustments after release [skip ci]
greenbonebot Jul 23, 2024
daa8910
Fix: Disable mangling in production build minify
timopollmeier Jul 25, 2024
6f39103
Automatic release to 23.2.1
greenbonebot Jul 25, 2024
1a00dbd
Automatic adjustments after release [skip ci]
greenbonebot Jul 25, 2024
cf4f4eb
Bump fast-xml-parser from 4.3.6 to 4.4.1
dependabot[bot] Jul 29, 2024
a95e44c
add: cvss 4 calculator missing de translation
daniele-mng Jul 24, 2024
f0d4a54
Merge branch 'main' into dependabot/npm_and_yarn/fast-xml-parser-4.4.1
a-h-abdelsalam Jul 30, 2024
36885c6
Merge pull request #4111 from greenbone/dependabot/npm_and_yarn/fast-…
a-h-abdelsalam Jul 30, 2024
d2c8555
Deps: Bump eslint-plugin-react from 7.34.3 to 7.35.0 (#4118)
dependabot[bot] Aug 5, 2024
a167ad6
Deps: Bump @typescript-eslint/parser from 7.16.0 to 7.18.0 (#4114)
dependabot[bot] Aug 5, 2024
43cc2ca
Deps: Bump i18next from 23.11.5 to 23.12.2 (#4117)
dependabot[bot] Aug 5, 2024
8922d0d
Deps: Bump @typescript-eslint/eslint-plugin from 7.16.0 to 8.0.0 (#4113)
dependabot[bot] Aug 5, 2024
ffaf5d2
Deps: Bump @sentry/react from 8.13.0 to 8.22.0 (#4119)
dependabot[bot] Aug 5, 2024
e6e3d82
Deps: Bump the patch-updates group with 9 updates (#4112)
dependabot[bot] Aug 5, 2024
c551962
Deps: Bump @vitest/ui from 1.6.0 to 2.0.5 (#4116)
dependabot[bot] Aug 6, 2024
0828a10
Fix: date locale (#4122)
daniele-mng Aug 14, 2024
92bf33b
Fix: Fixed the saving of the SSH port in the advanced task wizard.
jhelmold Aug 21, 2024
c2b78e8
Merge branch 'main' into GEA-668_Advanced_Task_Wizard_custom_SSH_port
jhelmold Aug 21, 2024
efe5cd9
Merge pull request #4127 from greenbone/GEA-668_Advanced_Task_Wizard_…
jhelmold Aug 21, 2024
ecb2636
add: vitest eslint rules
daniele-mng Aug 23, 2024
600951b
Merge pull request #4129 from greenbone/add-vitest-eslint-rules
a-h-abdelsalam Aug 23, 2024
52940b5
Add: Added a dedicated view for compliance audit reports (#3952)
a-h-abdelsalam Aug 23, 2024
6d19ae0
Automatic release to 23.3.0
greenbonebot Aug 29, 2024
02697fb
Automatic adjustments after release [skip ci]
greenbonebot Aug 29, 2024
e810585
Deps: Bump vite from 5.3.5 to 5.4.2 (#4139)
dependabot[bot] Sep 4, 2024
7171dd8
Deps: Bump qs from 6.12.3 to 6.13.0 (#4140)
dependabot[bot] Sep 4, 2024
8abeb1b
fix: default filter in details page
daniele-mng Sep 4, 2024
76013fc
Deps: Bump @babel/cli from 7.24.8 to 7.25.6 (#4138)
dependabot[bot] Sep 5, 2024
a36274c
Deps: Bump jsdom from 24.1.1 to 25.0.0 (#4143)
dependabot[bot] Sep 5, 2024
03cbde7
Deps: Bump @testing-library/jest-dom from 6.4.8 to 6.5.0 (#4137)
dependabot[bot] Sep 5, 2024
b1db5c9
Deps: Bump @typescript-eslint/eslint-plugin from 8.0.0 to 8.4.0 (#4146)
dependabot[bot] Sep 5, 2024
77b7a7a
Deps: Bump @sentry/react from 8.22.0 to 8.28.0 (#4145)
dependabot[bot] Sep 5, 2024
c5e9ad2
Deps: Bump i18next from 23.12.2 to 23.14.0 (#4135)
dependabot[bot] Sep 6, 2024
7cfb524
Deps: Bump i18next-http-backend from 2.5.2 to 2.6.1 (#4136)
dependabot[bot] Sep 6, 2024
e12c5c7
Deps: Bump the patch-updates group across 1 directory with 8 updates …
dependabot[bot] Sep 6, 2024
01d912d
fix-CI-step--upload-coverage
daniele-mng Sep 6, 2024
0c4c5a5
Merge pull request #4155 from greenbone/fix-CI-step--upload-coverage
a-h-abdelsalam Sep 10, 2024
1bec250
Update src/web/hooks/usePageFilter.js
daniele-mng Sep 10, 2024
1bf3c04
Merge branch 'main' into fix-power-filter-default-user-setting
daniele-mng Sep 10, 2024
39e821a
Merge pull request #4151 from greenbone/fix-power-filter-default-user…
a-h-abdelsalam Sep 10, 2024
a983590
Bump path-to-regexp and react-router-dom
dependabot[bot] Sep 10, 2024
ec0f668
change: update files for react-router v6
daniele-mng Sep 11, 2024
47e9047
fix: location.query
daniele-mng Sep 13, 2024
02bcad6
Update usePageFilter.jsx
daniele-mng Sep 13, 2024
b935439
fix: /omp page
daniele-mng Sep 13, 2024
4910407
Merge pull request #4156 from greenbone/dependabot/npm_and_yarn/multi…
a-h-abdelsalam Sep 13, 2024
b10b525
Bump vite from 5.4.3 to 5.4.6
dependabot[bot] Sep 17, 2024
b63396f
Merge pull request #4163 from greenbone/dependabot/npm_and_yarn/vite-…
a-h-abdelsalam Sep 18, 2024
28cac79
change: update from main
daniele-mng Sep 9, 2024
60f2739
update test
daniele-mng Sep 10, 2024
82e0a08
Merge branch 'main' into update-from-main
daniele-mng Sep 23, 2024
956c893
fixes router v6
daniele-mng Sep 24, 2024
a6b9506
fix tests
daniele-mng Sep 24, 2024
89efc29
fix audit components and tests
daniele-mng Sep 24, 2024
3e4c81e
address comments
daniele-mng Sep 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions allowedSnakeCase.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
'_asset_id',
'asset_id',
'assigned_to',
'audit_report',
'audit_reports',

Check warning on line 33 in allowedSnakeCase.cjs

View check run for this annotation

Codecov / codecov/patch

allowedSnakeCase.cjs#L32-L33

Added lines #L32 - L33 were not covered by tests
'auth_algorithm',
'auth_conf_setting',
'auth_method',
Expand Down Expand Up @@ -248,6 +250,7 @@
'highest_severity',
'high_per_host',
'host_allow',
'host_compliance',

Check warning on line 253 in allowedSnakeCase.cjs

View check run for this annotation

Codecov / codecov/patch

allowedSnakeCase.cjs#L253

Added line #L253 was not covered by tests
'host_cves',
'hostnames_by_ip',
'hosts_allow',
Expand Down
1,834 changes: 981 additions & 853 deletions package-lock.json

Large diffs are not rendered by default.

37 changes: 17 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gsa",
"version": "23.2.2-dev1",
"version": "23.3.1-dev1",
"description": "Greenbone Security Assistant",
"keywords": [
"openvas",
Expand Down Expand Up @@ -35,7 +35,7 @@
"@greenbone/opensight-ui-components": "^0.3.0",
"@mantine/core": "^6.0.0",
"@reduxjs/toolkit": "^2.2.7",
"@sentry/react": "^8.22.0",
"@sentry/react": "^8.28.0",
"@visx/axis": "^3.10.1",
"@visx/gradient": "^3.3.0",
"@visx/shape": "^3.5.0",
Expand All @@ -49,64 +49,61 @@
"d3-interpolate": "^3.0.1",
"d3-scale": "^4.0.2",
"d3-shape": "^3.2.0",
"downshift": "^9.0.7",
"downshift": "^9.0.8",
"fast-deep-equal": "^3.1.3",
"fast-xml-parser": "^4.4.1",
"history": "^4.10.1",
"hoist-non-react-statics": "^3.3.2",
"i18next": "^23.12.2",
"i18next-http-backend": "^2.5.2",
"i18next": "^23.14.0",
"i18next-http-backend": "^2.6.1",
"ical.js": "^2.0.0",
"lucide-react": "^0.439.0",
"memoize-one": "^6.0.0",
"moment": "^2.30.1",
"moment-timezone": "^0.5.45",
"prop-types": "^15.8.1",
"qhistory": "^1.1.0",
"qs": "^6.12.3",
"react": "^18.3.1",
"react-beautiful-dnd": "^13.1.1",
"react-dom": "^18.3.1",
"react-i18next": "^14.1.1",
"react-redux": "^9.1.2",
"react-router-dom": "^5.2.0",
"react-router-dom": "^6.26.2",
"redux": "^5.0.1",
"redux-logger": "^3.0.6",
"resize-observer-polyfill": "^1.5.1",
"styled-components": "^6.1.12",
"styled-components": "^6.1.13",
"uuid": "^10.0.0",
"whatwg-fetch": "^3.6.20"
},
"devDependencies": {
"@babel/cli": "^7.24.8",
"@babel/cli": "^7.25.6",
"@pandatix/js-cvss": "^0.4.4",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^16.0.0",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/react": "^18.3.3",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/eslint-plugin": "^8.4.0",
"@typescript-eslint/parser": "^8.0.0",
"@vitejs/plugin-legacy": "^5.4.1",
"@vitejs/plugin-legacy": "^5.4.2",
"@vitejs/plugin-react": "^4.3.1",
"@vitest/coverage-v8": "^2.0.5",
"@vitest/ui": "^2.0.5",
"babel-plugin-i18next-extract": "^0.10.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react": "^7.35.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.9",
"eslint-plugin-react-refresh": "^0.4.11",
"eslint-plugin-vitest": "^0.5.4",
"eslint-plugin-vitest-globals": "^1.5.0",
"husky": "^2.7.0",
"jest-styled-components": "^7.2.0",
"jsdom": "^24.1.1",
"jsdom": "^25.0.0",
"lint-staged": "^13.1.0",
"prettier": "^3.3.3",
"typescript": "^5.5.4",
"vite": "^5.3.5",
"vite": "^5.4.6",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-eslint2": "^4.4.0",
"vite-plugin-svgr": "^4.2.0",
Expand Down
9 changes: 9 additions & 0 deletions public/locales/gsa-de.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
"Audit made visible for:\n{{user}}\n{{role}}\n{{group}}": "Audit sichtbar gemacht für:\n{{user}}\n{{role}}\n{{group}}",
"Audit: {{name}}": "Audit: {{name}}",
"Audits": "Audits",
"Audit Reports by Compliance (Total: {{count}})": "Audit-Berichte nach Compliance (Gesamt: {{count}})",
"Audit Reports": "Audit-Berichte",
"Audit Report": "Audit-Bericht",
"Audits using this Policy": "Audits, die diese Richtlinie verwenden",
"Auth": "Auth.",
"Auth Algorithm": "Auth-Algorithmus",
Expand Down Expand Up @@ -245,6 +248,7 @@
"Certificate in use will expire at {{date}}": "Aktuelles Zertifikat wird am {{date}} ablaufen",
"Change Password": "Passwort ändern",
"Changed": "Verändert",
"Chart: Audit Reports by Compliance": "Diagramm: Audit-Berichte nach Compliance",
"Chart: CERT-Bund Advisories by CVSS": "Diagramm: CERT-Bund-Advisories nach CVSS",
"Chart: CERT-Bund Advisories by Creation Time": "Diagramm: CERT-Bund-Advisories nach Erstellungszeit",
"Chart: CERT-Bund Advisories by Severity Class": "Diagramm: CERT-Bund-Advisories nach Schweregradklasse",
Expand Down Expand Up @@ -325,6 +329,8 @@
"Complete": "Vollständig",
"Complexity": "Komplexität",
"Compliance Audits": "Compliance Audits",
"Compliance Audit Reports": "Compliance-Audit-Berichte",
"Compliance Percent": "Compliance-Prozent",
"Compliance Policies": "Compliance Richtlinien",
"Compliance Status": "Compliance Status",
"Compose": "Zusammenstellen",
Expand Down Expand Up @@ -849,6 +855,7 @@
"Include log messages in your filter settings.": "Log-Nachrichten in die Filtereinstellungen einbeziehen.",
"Include report": "Bericht einfügen",
"Included": "Beinhaltet",
"Incomplete": "Unvollständig",
"Info": "Info",
"Information": "Informationen",
"Inheriting user": "Erbender Benutzer",
Expand Down Expand Up @@ -1554,6 +1561,7 @@
"TLS Certificates by Modification Time (Total: {{count}})": "TLS-Zertifikate nach Änderungszeit (Gesamt: {{count}})",
"TLS Certificates by Status (Total: {{count}})": "TLS-Zertifikate nach Status (Gesamt: {{count}})",
"TLS Certificates for this Host": "TLS-Zertifikate für diesen Host",
"Table: Audit Reports by Compliance": "Tabelle: Audit-Berichte nach Compliance",
"Table: CERT-Bund Advisories by CVSS": "Tabelle: CERT-Bund-Advisories nach CVSS",
"Table: CERT-Bund Advisories by Creation Time": "Tabelle: CERT-Bund-Advisories nach Erstellungszeit",
"Table: CERT-Bund Advisories by Severity Class": "Tabelle: CERT-Bund-Advisories nach Schweregradklasse",
Expand Down Expand Up @@ -1920,6 +1928,7 @@
"task": "Aufgabe",
"to": "für",
"undefined": "undefiniert",
"Undefined": "Undefiniert",
"until {{- enddate}}": "bis {{- enddate}}",
"verinice Connector": "verinice-Konnektor",
"verinice.PRO Connector": "verinice.PRO-Konnektor",
Expand Down
15 changes: 11 additions & 4 deletions src/gmp/capabilities/capabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {pluralizeType} from 'gmp/utils/entitytype';
import {parseBoolean} from 'gmp/parser';

const types = {
audit: 'task',
audits: 'task',
auditreport: 'audit_report',
auditreports: 'audit_reports',
host: 'asset',
hosts: 'asset',
os: 'asset',
Expand Down Expand Up @@ -42,12 +42,19 @@ const types = {
tlscertificates: 'tls_certificate',
};

const subtypes = {
audit: 'task',
audits: 'task',
audit_report: 'report',
audit_reports: 'reports',
};

const convertType = type => {
const ctype = types[type];
if (isDefined(ctype)) {
return ctype;
type = ctype;
}
return type;
return subtypes[type] || type;
};

class Capabilities {
Expand Down
33 changes: 33 additions & 0 deletions src/gmp/commands/__tests__/auditreport.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import {describe, test, expect} from '@gsa/testing';
import {createHttp, createEntityResponse} from 'gmp/commands/testing';
import {AuditReportCommand} from 'gmp/commands/auditreports';

describe('AuditReportCommand tests', () => {
test('should request single audit report', () => {
const response = createEntityResponse('report', {_id: 'foo'});
const fakeHttp = createHttp(response);

expect.hasAssertions();

const cmd = new AuditReportCommand(fakeHttp);
return cmd.get({id: 'foo'}).then(resp => {
expect(fakeHttp.request).toHaveBeenCalledWith('get', {
args: {
cmd: 'get_report',
report_id: 'foo',
ignore_pagination: 1,
details: 1,
lean: 1,
},
});

const {data} = resp;
expect(data.id).toEqual('foo');
});
});
});
92 changes: 92 additions & 0 deletions src/gmp/commands/__tests__/auditreports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import {describe, test, expect} from '@gsa/testing';
import {ALL_FILTER} from 'gmp/models/filter';

import {
createHttp,
createEntitiesResponse,
createAggregatesResponse,
} from '../testing';
import {AuditReportsCommand} from 'gmp/commands/auditreports';

describe('AuditReportsCommand tests', () => {
test('should return all audit reports', () => {
const response = createEntitiesResponse('report', [
{
_id: '1',
},
{
_id: '2',
},
]);

const fakeHttp = createHttp(response);

expect.hasAssertions();

const cmd = new AuditReportsCommand(fakeHttp);
return cmd.getAll().then(resp => {
expect(fakeHttp.request).toHaveBeenCalledWith('get', {
args: {
cmd: 'get_reports',
details: 0,
filter: ALL_FILTER.toFilterString(),
usage_type: 'audit',
},
});
const {data} = resp;
expect(data.length).toEqual(2);
});
});

test('should return results', () => {
const response = createEntitiesResponse('report', [
{
_id: '1',
},
{
_id: '2',
},
]);

const fakeHttp = createHttp(response);

expect.hasAssertions();

const cmd = new AuditReportsCommand(fakeHttp);
return cmd.get().then(resp => {
expect(fakeHttp.request).toHaveBeenCalledWith('get', {
args: {
cmd: 'get_reports',
details: 0,
usage_type: 'audit',
},
});
const {data} = resp;
expect(data.length).toEqual(2);
});
});

test('should aggregate compliance counts', () => {
const response = createAggregatesResponse();
const fakeHttp = createHttp(response);

expect.hasAssertions();

const cmd = new AuditReportsCommand(fakeHttp);
return cmd.getComplianceAggregates().then(resp => {
expect(fakeHttp.request).toHaveBeenCalledWith('get', {
args: {
cmd: 'get_aggregate',
aggregate_type: 'report',
group_column: 'compliant',
usage_type: 'audit',
},
});
});
});
});
2 changes: 2 additions & 0 deletions src/gmp/commands/__tests__/reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe('ReportsCommand tests', () => {
cmd: 'get_reports',
details: 0,
filter: ALL_FILTER.toFilterString(),
usage_type: 'scan',
},
});
const {data} = resp;
Expand Down Expand Up @@ -59,6 +60,7 @@ describe('ReportsCommand tests', () => {
args: {
cmd: 'get_reports',
details: 0,
usage_type: 'scan',
},
});
const {data} = resp;
Expand Down
Loading