-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #384 from timopollmeier/next-gmp-version
Add protocol version "next" and GMP 21.04 doc
- Loading branch information
Showing
8 changed files
with
284 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
.. _gmpv214: | ||
|
||
GMP v21.4 | ||
^^^^^^^^^ | ||
|
||
.. automodule:: gvm.protocols.gmpv214 | ||
|
||
Enums | ||
----- | ||
|
||
.. autoclass:: AlertCondition | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: AlertEvent | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: AlertMethod | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: AliveTest | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: AssetType | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: CredentialFormat | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: CredentialType | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: EntityType | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: FeedType | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: FilterType | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: HostsOrdering | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: InfoType | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: PermissionSubjectType | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: ScannerType | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: PortRangeType | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: SeverityLevel | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: SnmpAuthAlgorithm | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: SnmpPrivacyAlgorithm | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: TicketStatus | ||
:members: | ||
:undoc-members: | ||
|
||
Protocol | ||
-------- | ||
|
||
.. autoclass:: Gmp | ||
:members: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2018 - 2021 Greenbone Networks GmbH | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
"""Latest supported protocols, including unstable ones. | ||
This module exposes the latest supported protocols of GVM including versions | ||
not yet released as stable. | ||
The provided Gmp class implements the latest `Greenbone Management | ||
Protocol`_. | ||
The provided Osp class implements the latest Open Scanner Protocol. | ||
For details about the possible supported protocol versions please take a look at | ||
:py:mod:`gvm.protocols`. | ||
Exports: | ||
- :py:class:`gvm.protocols.gmpv214.Gmp` | ||
- :py:class:`gvm.protocols.ospv1.Osp` | ||
.. _Greenbone Management Protocol: | ||
https://docs.greenbone.net/API/GMP/gmp.html | ||
""" | ||
|
||
from .gmpv214 import ( | ||
Gmp, | ||
AggregateStatistic, | ||
AlertCondition, | ||
AlertEvent, | ||
AlertMethod, | ||
AliveTest, | ||
AssetType, | ||
CredentialFormat, | ||
CredentialType, | ||
EntityType, | ||
FeedType, | ||
FilterType, | ||
HostsOrdering, | ||
InfoType, | ||
PermissionSubjectType, | ||
PortRangeType, | ||
ScannerType, | ||
SeverityLevel, | ||
SnmpAuthAlgorithm, | ||
SnmpPrivacyAlgorithm, | ||
SortOrder, | ||
TicketStatus, | ||
TimeUnit, | ||
UserAuthType, | ||
get_aggregate_statistic_from_string, | ||
get_alert_condition_from_string, | ||
get_alert_event_from_string, | ||
get_alert_method_from_string, | ||
get_alive_test_from_string, | ||
get_asset_type_from_string, | ||
get_credential_format_from_string, | ||
get_credential_type_from_string, | ||
get_entity_type_from_string, | ||
get_feed_type_from_string, | ||
get_filter_type_from_string, | ||
get_hosts_ordering_from_string, | ||
get_info_type_from_string, | ||
get_permission_subject_type_from_string, | ||
get_port_range_type_from_string, | ||
get_scanner_type_from_string, | ||
get_severity_level_from_string, | ||
get_snmp_auth_algorithm_from_string, | ||
get_snmp_privacy_algorithm_from_string, | ||
get_sort_order_from_string, | ||
get_ticket_status_from_string, | ||
get_time_unit_from_string, | ||
get_user_auth_type_from_string, | ||
) | ||
from .ospv1 import Osp | ||
|
||
__all__ = [ | ||
"Gmp", | ||
"Osp", | ||
"AggregateStatistic", | ||
"AlertCondition", | ||
"AlertEvent", | ||
"AlertMethod", | ||
"AliveTest", | ||
"AssetType", | ||
"CredentialType", | ||
"CredentialFormat", | ||
"EntityType", | ||
"FeedType", | ||
"FilterType", | ||
"HostsOrdering", | ||
"InfoType", | ||
"PermissionSubjectType", | ||
"PortRangeType", | ||
"ScannerType", | ||
"SeverityLevel", | ||
"SnmpAuthAlgorithm", | ||
"SnmpPrivacyAlgorithm", | ||
"SortOrder", | ||
"TicketStatus", | ||
"TimeUnit", | ||
"UserAuthType", | ||
"get_aggregate_statistic_from_string", | ||
"get_alert_condition_from_string", | ||
"get_alert_event_from_string", | ||
"get_alert_method_from_string", | ||
"get_alive_test_from_string", | ||
"get_asset_type_from_string", | ||
"get_credential_format_from_string", | ||
"get_credential_type_from_string", | ||
"get_entity_type_from_string", | ||
"get_feed_type_from_string", | ||
"get_filter_type_from_string", | ||
"get_hosts_ordering_from_string", | ||
"get_info_type_from_string", | ||
"get_permission_subject_type_from_string", | ||
"get_port_range_type_from_string", | ||
"get_scanner_type_from_string", | ||
"get_severity_level_from_string", | ||
"get_snmp_auth_algorithm_from_string", | ||
"get_snmp_privacy_algorithm_from_string", | ||
"get_sort_order_from_string", | ||
"get_ticket_status_from_string", | ||
"get_time_unit_from_string", | ||
"get_user_auth_type_from_string", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2018 Greenbone Networks GmbH | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import unittest | ||
|
||
from gvm.protocols.next import Gmp, Osp | ||
|
||
|
||
class LatestProtocolsTestCase(unittest.TestCase): | ||
def test_gmp_version(self): | ||
self.assertEqual(Gmp.get_protocol_version(), (21, 4)) | ||
|
||
def test_osp_version(self): | ||
self.assertEqual(Osp.get_protocol_version(), (1, 2)) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |