Skip to content

Commit

Permalink
Merge pull request #21 from splunk-soar-connectors/next
Browse files Browse the repository at this point in the history
Merging next to main for release 2.5.3
  • Loading branch information
joshquerinphantom authored Apr 29, 2022
2 parents d0a359d + e4e2071 commit e8919f2
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/phantomcyber/dev-cicd-tools
rev: v1.12
rev: v1.13
hooks:
- id: org-hook
- id: package-app-dependencies
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# MS Graph for Office 365

Publisher: Splunk
Connector Version: 2\.5\.0
Connector Version: 2\.5\.3
Product Vendor: Microsoft
Product Name: Office 365 \(MS Graph\)
Product Version Supported (regex): "\.\*"
Expand Down Expand Up @@ -296,7 +296,7 @@ VARIABLE | REQUIRED | TYPE | DESCRIPTION
**extract\_domains** | optional | boolean | Extract Domain Names
**extract\_hashes** | optional | boolean | Extract Hashes
**ph\_4** | optional | ph |
**ingest\_manner** | required | string | How to Ingest \(during ingestion, should the app get the latest emails or the oldest\)
**ingest\_manner** | optional | string | How to Ingest \(during ingestion, should the app get the latest emails or the oldest\)

### Supported Actions
[test connectivity](#action-test-connectivity) - Use supplied credentials to generate a token with MS Graph
Expand Down
3 changes: 1 addition & 2 deletions office365.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"product_version_regex": ".*",
"publisher": "Splunk",
"license": "Copyright (c) 2017-2022 Splunk Inc.",
"app_version": "2.5.0",
"app_version": "2.5.3",
"utctime_updated": "2022-02-04T01:20:46.000000Z",
"package_name": "phantom_msgraphoffice365",
"main_module": "office365_connector.py",
Expand Down Expand Up @@ -136,7 +136,6 @@
"ingest_manner": {
"data_type": "string",
"description": "How to Ingest (during ingestion, should the app get the latest emails or the oldest)",
"required": true,
"order": 20,
"value_list": [
"oldest first",
Expand Down
8 changes: 6 additions & 2 deletions office365_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1577,6 +1577,7 @@ def _handle_on_poll(self, param):
action_result = self.add_action_result(ActionResult(dict(param)))

config = self.get_config()
ingest_manner = config.get('ingest_manner', 'oldest first')

start_time = ''
if self.is_poll_now():
Expand Down Expand Up @@ -1620,7 +1621,7 @@ def _handle_on_poll(self, param):
endpoint += '/mailFolders/{0}'.format(folder)

endpoint += '/messages'
order = 'asc' if config['ingest_manner'] == 'oldest first' else 'desc'
order = 'asc' if ingest_manner == 'oldest first' else 'desc'

params = {
'$orderBy': 'lastModifiedDateTime {}'.format(order)
Expand All @@ -1635,7 +1636,7 @@ def _handle_on_poll(self, param):
# If the ingestion manner is set for the latest emails, then the 0th index email is the latest
# in the list returned, else the last email is the latest. This will be used to store the
# last modified time in the state file
email_index = 0 if config['ingest_manner'] == "latest first" else -1
email_index = 0 if ingest_manner == "latest first" else -1

while True:
self._duplicate_count = 0
Expand Down Expand Up @@ -2216,6 +2217,9 @@ def _get_token(self, action_result):
return action_result.get_status()
# Save the response on the basis of admin_acess
if self._admin_access:
# if admin consent already provided, save to state
if self._admin_consent:
self._state['admin_consent'] = True
self._state['admin_auth'] = resp_json
else:
self._state['non_admin_auth'] = resp_json
Expand Down
2 changes: 2 additions & 0 deletions release_notes/2.5.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Fixed authentication bug with Admin Consent where actions would still fail even after successful Test Connectivity [PAPP-25448]
* ingest_manner is no longer a required asset parameter to fix a bug with validation where all actions would fail after upgrading to v2.5.0 [PAPP-25731]
7 changes: 6 additions & 1 deletion release_notes/release_notes.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<b>MS Graph for Office 365 Release Notes - Published by Splunk April 19, 2022</b>
<b>MS Graph for Office 365 Release Notes - Published by Splunk April 29, 2022</b>
<br><br>
<b>Version 2.5.3 - Released April 29, 2022</b>
<ul>
<li>Fixed authentication bug with Admin Consent where actions would still fail even after successful Test Connectivity [PAPP-25448]</li>
<li>ingest_manner is no longer a required asset parameter to fix a bug with validation where all actions would fail after upgrading to v2.5.0 [PAPP-25731]</li>
</ul>
<b>Version 2.5.0 - Released April 19, 2022</b>
<ul>
<li>Added paginator in On Poll Action [PAPP-24562]</li>
Expand Down

0 comments on commit e8919f2

Please sign in to comment.