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

Improve types #139

Merged
merged 31 commits into from
Jul 15, 2019
Merged

Improve types #139

merged 31 commits into from
Jul 15, 2019

Conversation

bjoernricks
Copy link
Member

@bjoernricks bjoernricks commented Jul 10, 2019

  • Add python type hints
  • Start to use enum classes for gmp protocol types

Checklist:

@codecov
Copy link

codecov bot commented Jul 10, 2019

Codecov Report

Merging #139 into master will decrease coverage by 1.61%.
The diff coverage is 81.02%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
gvm/transforms.py 100% <100%> (ø) ⬆️
gvm/xml.py 77.77% <100%> (+0.5%) ⬆️
gvm/protocols/base.py 90.47% <100%> (+0.47%) ⬆️
gvm/connections.py 56.2% <100%> (+0.28%) ⬆️
gvm/utils.py 100% <100%> (ø) ⬆️
gvm/errors.py 100% <100%> (ø) ⬆️
gvm/protocols/gmpv8.py 100% <100%> (ø) ⬆️
gvm/protocols/gmpv7.py 97.38% <78.18%> (-2.36%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28754c1...8c58432. Read the comment docs.

@codecov
Copy link

codecov bot commented Jul 10, 2019

Codecov Report

Merging #139 into master will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
gvm/protocols/gmpv7.py 99.25% <ø> (-0.49%) ⬇️
gvm/xml.py 77.77% <100%> (+0.5%) ⬆️
gvm/protocols/base.py 90.47% <100%> (+0.47%) ⬆️
gvm/connections.py 56.2% <100%> (+0.28%) ⬆️
gvm/protocols/gmpv8.py 100% <100%> (ø) ⬆️
gvm/utils.py 100% <100%> (ø) ⬆️
gvm/errors.py 100% <100%> (ø) ⬆️
gvm/transforms.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28754c1...1469830. Read the comment docs.

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.
@bjoernricks bjoernricks merged commit 01e4473 into greenbone:master Jul 15, 2019
@bjoernricks bjoernricks deleted the improve-types branch July 15, 2019 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants