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

Refactor for IO independent protocol implementation #1127

Merged
merged 105 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
329b503
Add: Add lxml-stubs as dev dependency for code completion
bjoernricks Mar 6, 2024
fff3d91
Fix: Fix type hints for pretty_print function
bjoernricks Mar 6, 2024
103af86
Fix: Fix type of lxml Element
bjoernricks Mar 6, 2024
809eb98
Add: Add a new function to parse XML data into an Element tree
bjoernricks Mar 6, 2024
60a04a4
Add: Add a specific exception for XML related errors
bjoernricks Mar 6, 2024
0cf0f03
Change: Improve type hints for XmlCommand and XmlCommandElement
bjoernricks Mar 6, 2024
8f7c2eb
Add: Allow to convert an XmlCommandElement into bytes
bjoernricks Mar 6, 2024
df79943
Add: Add an add_filter method to XmlCommand
bjoernricks Mar 6, 2024
04f0b62
Add: Specify the API for gvm.xml by defining an __all__ object
bjoernricks Mar 6, 2024
6237118
Add: Fix type hints for to_bool utils function
bjoernricks Mar 6, 2024
13b54c6
Change: Update check_command_status utils function to use parse_xml
bjoernricks Mar 6, 2024
192cbfa
Add: Add a decorator for marking code as deprecated
bjoernricks Mar 6, 2024
26f1925
Change: Mark add_filter utils functions as deprecated
bjoernricks Mar 6, 2024
4421bb2
Add: Allow to create gvm Enums from all kind of objects
bjoernricks Mar 6, 2024
16b37bd
Change: Update error message if Enum can't be created
bjoernricks Mar 6, 2024
876b623
Change: Update type hint for GvmError class
bjoernricks Mar 6, 2024
6405b15
Add: Add first draft of a core GMP protocol implementation
bjoernricks Mar 6, 2024
78868f4
Remove: Remove unnecessary print statement in check_command_status ut…
bjoernricks Mar 6, 2024
98eb998
Update parse_xml to catch lxml errors
bjoernricks Mar 6, 2024
d1bed65
Add: Add types for paramiko
bjoernricks Mar 7, 2024
4216f6e
Change: Use valid PEP 8 function names
bjoernricks Mar 7, 2024
785f32e
Change: Rework and improve GvmConnection classes
bjoernricks Mar 7, 2024
237bf13
Add: Add a new GvmProtocol class that will replace the one in gvm.base
bjoernricks Mar 7, 2024
896b04f
Add: Draft new implementation for GMP protocol classes base on the co…
bjoernricks Mar 7, 2024
8d388c9
Add: Tests for protocol states and xml reader
bjoernricks Mar 11, 2024
393b0f3
Add: Add docstrings and tests for Response class
bjoernricks Mar 11, 2024
66538bc
Modify Request to just contain bytes without string
bjoernricks Mar 11, 2024
9a79d8a
Add: Finalize GMP Connection class and add a test case
bjoernricks Mar 11, 2024
7beef24
Change: Refactor module layout
bjoernricks Mar 11, 2024
cf67239
Add: Add get_protocol_version static methods for backwards compatibility
bjoernricks Mar 11, 2024
7a8fec8
Add: Add basic test for own internal Enum class
bjoernricks Mar 11, 2024
5e9e5d7
Add: Add tests for current requests implementations
bjoernricks Mar 11, 2024
652d017
Canonicalize and improve GMP docstrings
bjoernricks Mar 12, 2024
fdab36e
Change: Fix constructor signature of InvalidArgumentType exception
bjoernricks Mar 12, 2024
ccde929
Add: Implement Aggregates command
bjoernricks Mar 12, 2024
8ac8675
Add: Implement Feed command
bjoernricks Mar 12, 2024
4a50b71
Add: Implement Help command
bjoernricks Mar 12, 2024
5da6bed
Update GMP context manager test for new GMP classes
bjoernricks Mar 12, 2024
d205fc3
Fix support for Python 3.9
bjoernricks Mar 12, 2024
e8e70eb
Change: Return a string from to_base64 function
bjoernricks Mar 21, 2024
e60c33b
Add: Add system report, trash can and user setting requests
bjoernricks Mar 22, 2024
b32ad19
Remove: Drop usage of defusedxml
bjoernricks Mar 22, 2024
34a5755
Change: Allow passing an UUID to XmlCommand.add_filter as filter_id
bjoernricks Mar 22, 2024
34a2454
Remove: Replace validate_xml_string with parse_xml
bjoernricks Mar 22, 2024
e9c87d6
Add __init__.py files to allow vscode test runner detecting the test …
bjoernricks Mar 22, 2024
15336ee
Change: Support passing UUIDs for GMP protocol requests
bjoernricks Mar 22, 2024
3ca0fca
Allow to use a UUID instance as filter_id
bjoernricks Mar 22, 2024
8b0e7fb
Add: Introduce a new type for representing an Entity ID
bjoernricks Mar 22, 2024
40d3268
Change: Allow to pass a UUID instance as id for various methods
bjoernricks Mar 22, 2024
86f4930
Add: Add scan config handling for the new protocol implementation
bjoernricks Mar 22, 2024
70f216e
Add scanner methods for new protocol implementation
bjoernricks Mar 25, 2024
de96505
Implement Users methods for new protocol
bjoernricks Mar 25, 2024
c2446ac
Implement notes methods for new protocol
bjoernricks Mar 25, 2024
e4413e0
Implement overrides methods for new protocol
bjoernricks Mar 25, 2024
4f28258
Implement targets methods for new protocol
bjoernricks Mar 26, 2024
81a44ce
Implement alerts methods for new protocol
bjoernricks Mar 26, 2024
a51321c
Change: Improve to_comma_list function signature
bjoernricks Mar 26, 2024
b8b5bb0
Implement audits methods for new protocol
bjoernricks Mar 26, 2024
1609009
Implement credentials for new protocol
bjoernricks May 21, 2024
6419e97
Implement filters for new protocol
bjoernricks May 21, 2024
1963c96
Implement groups for new protocol
bjoernricks May 21, 2024
2841ef6
Implement hosts for new protocol
bjoernricks May 22, 2024
617ccf5
Implement operating systems for new protocol
bjoernricks May 22, 2024
5546d77
Implement permissions for new protocol
bjoernricks May 22, 2024
d1bc678
Implement policies for new protocol
bjoernricks May 22, 2024
00fdf9f
Use consistent naming for Port Lists class and module
bjoernricks May 22, 2024
f05960c
Implement reports for new protocol
bjoernricks May 22, 2024
d8e6538
Implement results for new protocol
bjoernricks May 22, 2024
7b421f1
Implement roles for new protocol
bjoernricks May 23, 2024
3bef496
Implement schedules for new protocol
bjoernricks May 23, 2024
467f99b
Implement nvts for new protocol
bjoernricks May 23, 2024
b7e189a
Implement SecInfo command for new protocol
bjoernricks May 23, 2024
9d66bee
Implement cves for new protocol
bjoernricks May 23, 2024
52e2fc7
Implement cpes for new protocol
bjoernricks May 23, 2024
365ee65
Implement dfn cert advisories for new protocol
bjoernricks May 23, 2024
c88cd68
Implement cert bund advisories for new protocol
bjoernricks May 23, 2024
51b2484
Implement tags for new protocol
bjoernricks May 23, 2024
f9981a8
Implement tasks for new protocol
bjoernricks May 28, 2024
d086555
Implement tickets for new protocol
bjoernricks May 28, 2024
610bf5e
Implement TLS certificates for new protocol
bjoernricks May 28, 2024
759628d
Implement vulnerabilities for new protocol
bjoernricks May 29, 2024
0e6c343
Add additional tests for converting empty values to an Enum
bjoernricks May 29, 2024
9f7cde0
Remove accidentally added file of a merge conflict
bjoernricks May 29, 2024
d89d4c8
Implement report formats for new protocol
bjoernricks May 29, 2024
11a2850
Fix importing xml entities for old protocol implementation
bjoernricks May 29, 2024
b5858fe
Fix typing of error classes
bjoernricks May 30, 2024
db8ac03
Export GMPv224 and GMPv225 from gvm.protocols.gmp
bjoernricks May 30, 2024
bc56a71
Extend enum class to be created from other enums
bjoernricks May 30, 2024
96adaad
Update GMPv224 and GMPv225 tests for using the new protocol internally
bjoernricks May 30, 2024
53d8c15
Add missing forwarding of mode argument for get_aggregates
bjoernricks May 31, 2024
9b561f2
Use old names for system reports and trashcan methods
bjoernricks May 31, 2024
d914e62
Export types as before from GMP classes
bjoernricks May 31, 2024
190e0e8
Remove code for the old GMP protocol implementations
bjoernricks May 31, 2024
3fac4bd
Refactor all GMP tests
bjoernricks May 31, 2024
a272d07
Update OSP to use new GVM protocol base class
bjoernricks May 31, 2024
3a8db58
Fix raising error on Python 3.9
bjoernricks May 31, 2024
dc1d11a
Fix and improve docs for new protocol implementation
bjoernricks May 31, 2024
356fb89
Create GMP 22.4 and GMP 22.5 specific request modules
bjoernricks Jun 5, 2024
5f4f660
Cleanup tests to remove leftovers from GMP 20.8 and 21.4
bjoernricks Jun 5, 2024
80ae7e8
Support interface used by gvm-cli
bjoernricks Jun 5, 2024
c0f574a
Remove: Don't export enums from gvm.protocols latest and next modules
bjoernricks Jun 5, 2024
bfd968e
Remove superfluous comment
bjoernricks Jun 5, 2024
b4b0007
Add typing checks with mypy
bjoernricks Jun 5, 2024
b897f6c
Fix some typing issues
bjoernricks Jun 5, 2024
a771cbd
Fix docs for enums after creating versioned requests modules
bjoernricks Jun 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,23 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

mypy:
name: Check type hints
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v4
- name: Run mypy
uses: greenbone/actions/mypy-python@v3
with:
python-version: ${{ matrix.python-version }}

codecov:
name: Upload coverage to codecov.io
needs: test
Expand Down
3 changes: 0 additions & 3 deletions docs/api/connections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@ Connections

.. autoclass:: SSHConnection
:members:
:inherited-members:

.. autoclass:: TLSConnection
:members:
:inherited-members:

.. autoclass:: UnixSocketConnection
:members:
:inherited-members:

.. autoclass:: DebugConnection
:members:
14 changes: 7 additions & 7 deletions docs/api/gmp.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.. _gmp:

.. avoid TOCtree warning by marking this file as orphan

:orphan:

GMP
^^^
.. automodule:: gvm.protocols.gmp

Protocol
--------

.. autoclass:: Gmp
.. autoclass:: GMP
:members:

.. toctree::
:maxdepth: 1

gmpv224
gmpv225
116 changes: 0 additions & 116 deletions docs/api/gmpv208.rst

This file was deleted.

116 changes: 0 additions & 116 deletions docs/api/gmpv214.rst

This file was deleted.

Loading
Loading