-
Notifications
You must be signed in to change notification settings - Fork 60
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
Improve types #139
Improve types #139
Conversation
Add python type hints (https://docs.python.org/3/library/typing.html) and several enum (https://docs.python.org/3/library/enum.html) classes. At the end all type parameters will require an enum class instance.
Also add docstrings to all enum classes.
Codecov Report
@@ Coverage Diff @@
## master #139 +/- ##
==========================================
- Coverage 96.75% 95.14% -1.62%
==========================================
Files 10 10
Lines 2714 2821 +107
==========================================
+ Hits 2626 2684 +58
- Misses 88 137 +49
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #139 +/- ##
==========================================
- Coverage 96.75% 96.72% -0.04%
==========================================
Files 10 10
Lines 2714 3054 +340
==========================================
+ Hits 2626 2954 +328
- Misses 88 100 +12
Continue to review full report at Codecov.
|
Support original string values.
Use the type for create_port_range
Remove the type of the filter_type argument. The type will be derived from the type hint now.
Use the new enum in create_scanner and modify_scanner
Use the enum in create_schedule and modify_schedule
Use AliveTest in create_target and modify_target.
Use the enum in create_task and modify_task
Use the enum for get_asset and get_assets
Use this enum for getting a single credential in get_credential.
Use it for get_feed
* Drop credential_type arg. It is not possible to change the type of a credential. * Add type hints * Use SnmpAuthAlgorithm and SnmpPrivacyAlgorithm enums
It is not possible to change the credential type.
Use InfoType in get_info and get_info_list.
Add an enum class for all entity types. We are not very consistent where which type is allowed. Therefore list all "types" in this enum instead of mapping os, host to assets and cve, cpe, ... to info.
Only allow os and operating_system.
Checklist: