-
Notifications
You must be signed in to change notification settings - Fork 2
feat!: imap sdkified #49
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
base: main
Are you sure you want to change the base?
Conversation
183ce35 to
ae06f51
Compare
84cfc40 to
e6e92fb
Compare
ff940f6 to
59d56ee
Compare
1a2c738 to
b18ad75
Compare
b18ad75 to
3b9a8b7
Compare
bb6b27f to
f053287
Compare
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.
Is there a reason this hoisting of app is needed? Just curious
| helper = ImapHelper(soar, asset) | ||
| helper._connect_to_server() | ||
|
|
||
| state = app.actions_manager.ingestion_state |
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.
CC @sodle-splunk does this actually work, and/or are we in the process of moving this?
| first_run_max_emails: float = AssetField( | ||
| required=True, | ||
| description="Maximum emails to poll first time for schedule and interval polling", | ||
| default=2000.0, | ||
| ) | ||
| max_emails: float = AssetField( | ||
| required=True, description="Maximum emails to poll", default=100.0 | ||
| ) |
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.
These can only be whole numbers, right? So why are they floats instead of ints?
| f"Error occurred while deleting state file: {ex!s}" | ||
| ) | ||
|
|
||
| def encrypt_state(self, state, connector=None): |
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.
SDK now handles state encryption and decryption
| isinstance(asset_id, str) and asset_id.isalnum() and len(asset_id) <= 128 | ||
| ) | ||
|
|
||
| def delete_state(self, connector): |
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.
This function is going to be incompatible with SOAR in the near future, as state is coming off the filesystem
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 think this script is effectively duplicated across the major email apps. I think we need a ticket to reimplement this functionality inside the SDK, under something like a utils namespace
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.
It would actually probably be best if it was an optional component of the SDK package, since it seems it will bring with it some other dependencies
PAPP-36909