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

Subsequent refresh() attempts fail when using developer_token #153

Closed
sserrata opened this issue Apr 13, 2020 · 0 comments · Fixed by #155
Closed

Subsequent refresh() attempts fail when using developer_token #153

sserrata opened this issue Apr 13, 2020 · 0 comments · Fixed by #155
Assignees
Labels
bug Something isn't working

Comments

@sserrata
Copy link
Member

A new bug was introduced in alpha9 (#150) to address issue #147. The new bug behavior occurs after performing the first refresh() with a developer_token. The refresh updates the self.access_token_ attribute which results in subsequent developer_token refresh attempts not matching the following if statement:

https://github.com/PaloAltoNetworks/pan-cortex-data-lake-python/blob/master/pan_cortex_data_lake/credentials.py#L480

Expected behavior

Refreshing with a developer_token should support more than a single refresh().

Current behavior

The refresh() method fails after the first refresh is performed with a developer_token.

Possible solution

Switch to evaluating whether self._credentials_found_in_instance is False instead of self.access_token_.

Steps to reproduce

  1. Export a developer_token envar.
  2. Import Credentials and assign to a variable.
  3. Perform <variable>.refresh() twice.

Screenshots

Context

Your Environment

  • Version used: alpha10
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3): python 3.7.7
  • Operating System and version (desktop or mobile): Mac OSX
  • Link to your project:
@sserrata sserrata added the bug Something isn't working label Apr 13, 2020
@sserrata sserrata self-assigned this Apr 13, 2020
sserrata added a commit to sserrata/pan-cortex-data-lake-python that referenced this issue Apr 13, 2020
@sserrata sserrata mentioned this issue Apr 13, 2020
4 tasks
sserrata added a commit that referenced this issue Apr 13, 2020
* Check for credentials in instance instead of self.access_token_, fixes #153

* Refrain from passing credentials kwarg to get_job_results() in iter_job_results(), fixes #154

* Bump version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant