Skip to content

[PR#237] Properly populate urlobject with ORG KEY value in _count() function#247

Closed
abowersox-cb wants to merge 1 commit into
developfrom
pr237-urlobject
Closed

[PR#237] Properly populate urlobject with ORG KEY value in _count() function#247
abowersox-cb wants to merge 1 commit into
developfrom
pr237-urlobject

Conversation

@abowersox-cb
Copy link
Copy Markdown
Contributor

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Tests have been added that prove the fix is effective or that the feature works.
  • New and existing tests pass locally with the changes.
  • Code follows the style guidelines of this project (PEP8, clean code).
  • Linter has passed locally and any fixes were made for failures.
  • A self-review of the code has been done.

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes (not tied to bugs/features)
  • Other (please describe):

What is the ticket or issue number?

Pull Request Description

(From original pull request)

using .len() on ThreatHunter Event query objects throws a 403 error because the _count() function in cbapi/psc/threathunter/query.py does not populate self._doc_class.urlobject with an ORG KEY value (i.e. self._cb.credentials.org_key). This fix adds the required .format() function that inserts the ORG KEY into the urlobject.

A similar fix was added for the _perform_query() function where the url variable is assigned a properly populated urlobject value (which includes the ORG KEY value), but is then not used in the get_object() function that follows it.

Does this introduce a breaking change?

  • Yes
  • No

How Has This Been Tested?

Original test information in PR #237

Other information:

This had to be implemented as a new PR because the original PR bumped the CBAPI version number, a change we don't want to make until all PR changes are settled.

@abowersox-cb
Copy link
Copy Markdown
Contributor Author

Closing because PR #237 was merged in, rendering this one redundant.

@abowersox-cb abowersox-cb deleted the pr237-urlobject branch July 13, 2020 22:17
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.

2 participants