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

add missing scan target kinds #121

Merged
merged 3 commits into from
May 31, 2024

Conversation

epalhares-tenchi
Copy link
Contributor

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)

@epalhares-tenchi epalhares-tenchi linked an issue May 27, 2024 that may be closed by this pull request
8 tasks
edpin
edpin previously approved these changes May 28, 2024
Copy link
Contributor

@edpin edpin left a 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!

zanshinsdk/client.py Outdated Show resolved Hide resolved
from enum import Enum


class AlertState(str, Enum):

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?

Copy link
Contributor Author

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.

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?

Copy link
Contributor Author

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.

tenchinage
tenchinage previously approved these changes May 28, 2024
Copy link

@tenchinage tenchinage left a 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.

@epalhares-tenchi epalhares-tenchi dismissed stale reviews from tenchinage and edpin via 597fb43 May 29, 2024 20:39
@epalhares-tenchi epalhares-tenchi merged commit 6409f4c into main May 31, 2024
15 checks passed
@epalhares-tenchi epalhares-tenchi deleted the 119-add-missing-scan-target-kinds-to-sdk branch May 31, 2024 16:22
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.

Add missing scan target kinds to SDK
3 participants