-
Notifications
You must be signed in to change notification settings - Fork 0
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
add missing scan target kinds #121
add missing scan target kinds #121
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactor and clean up!
from enum import Enum | ||
|
||
|
||
class AlertState(str, Enum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that in many of our Enums we are extending both str
and Enum
. What is the gain of extending str
and how do we make use of that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extending both adds the possibility of use methods from a string while they're a unique member of the Enum.
zanshinsdk/common/targets.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible nitpick:
I see in this module that all classes extend dict
. These classes are models for the supported scan targets. I see that scan target speciffic values are being set in the dict, for some targets. Why do we need the dict behaviour?
If the purpose of this classes is to transport scan target data, what about implementing this using dataclasses?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice questions!
I think the decision to use the classes like that is to make it easier to parse the data to what our API is expecting without breaking the snake_case pattern from Python.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great Job Eduardo! I've left a couple of comments and questions (mostly for my learning), I don't see any blockers.
Adding missing scan targets creation, and adding a single function to retrieve the OAuth link from enabled kinds.
Doing some folder updates too to make the code more lean.
✅ All tests running.
Ran 190 tests in 2.912s OK (skipped=1)