Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

Simplify start_scan() #275

Merged
merged 5 commits into from
May 20, 2020
Merged

Simplify start_scan() #275

merged 5 commits into from
May 20, 2020

Conversation

jjnicola
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented May 19, 2020

Codecov Report

Merging #275 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #275      +/-   ##
==========================================
+ Coverage   74.56%   74.57%   +0.01%     
==========================================
  Files          21       21              
  Lines        2335     2332       -3     
==========================================
- Hits         1741     1739       -2     
+ Misses        594      593       -1     
Impacted Files Coverage Δ
ospd/protocol.py 94.56% <ø> (ø)
ospd/ospd.py 77.20% <100.00%> (+0.05%) ⬆️
ospd/scan.py 92.13% <100.00%> (ø)

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 46baa94...894fd1a. Read the comment docs.

ospd/scan.py Outdated
@@ -378,6 +378,10 @@ def get_target_options(self, scan_id: str):
"""
return self.scans_table[scan_id]['target'].get('options')

def get_target(self, scan_id: str) -> Dict:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to add the concrete Dict type here like Dict[str, str]. Not sure what key and value types are used here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw. same for the other methods like get_vts below

@jjnicola jjnicola force-pushed the scan-collection branch 2 times, most recently from 674bc2c to 4eb3089 Compare May 19, 2020 14:18
Also, improve typing
bjoernricks
bjoernricks previously approved these changes May 19, 2020
Copy link
Contributor

@bjoernricks bjoernricks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

ospd/scan.py Outdated
def get_vts(self, scan_id: str) -> Dict:
def get_target(
self, scan_id: str
) -> Dict[str, Union[str, Dict[str, Union[str, Dict[str, str]]]]]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Holy crap 😳

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All target information is there. Credentials (for different services), target options (alive tests method and reverse_lookup options), port list, hosts (to be scanned, finished and excluded).

I removed this method, because is not necessary anymore. I have just simplified the start_scan() method.

@jjnicola jjnicola changed the title Dont access scan info directly Simplify start_scan() May 19, 2020
@jjnicola jjnicola requested a review from bjoernricks May 19, 2020 15:25
ospd/ospd.py Outdated Show resolved Hide resolved
@jjnicola jjnicola merged commit f16cc7e into greenbone:master May 20, 2020
@jjnicola jjnicola deleted the scan-collection branch May 27, 2020 08:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants