Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit b97b5e8

Browse files
authored
Merge pull request #57 from sserrata/hotfix-1.2.3
Hotfix 1.2.3 #56
2 parents 9f3dce7 + b68fbde commit b97b5e8

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

HISTORY.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
History
33
=======
44

5+
1.2.3 (2018-06-21)
6+
------------------
7+
8+
* Reversed the `access_token` lookup order in get_credentials() method.
9+
* Added `_resolve_credential()` to `access_token()` property method to support token caching.
10+
* Now comparing passed `access_token` in `refresh()` method to value returned by property method.
11+
512
1.2.2 (2018-06-20)
613
------------------
714

pancloud/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
from .credentials import Credentials
1212

1313
__author__ = 'Palo Alto Networks'
14-
__version__ = '1.2.2'
14+
__version__ = '1.2.3'

pancloud/credentials.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ def __init__(self, auth_base_url=None, cache_token=True,
105105
@property
106106
def access_token(self):
107107
"""Get access_token"""
108+
if self.cache_token:
109+
return self.access_token_ or \
110+
self._resolve_credential('access_token')
108111
return self.access_token_
109112

110113
@property
@@ -255,8 +258,8 @@ def get_credentials(self):
255258
256259
"""
257260
if self.cache_token:
258-
access_token = self._resolve_credential(
259-
'access_token') or self.access_token_
261+
access_token = self.access_token_ or \
262+
self._resolve_credential('access_token')
260263
else:
261264
access_token = self.access_token_
262265
client_id = self.client_id_ or self._resolve_credential(
@@ -294,7 +297,7 @@ def refresh(self, timeout=None, access_token=None):
294297
"""
295298
if not self.token_lock.locked():
296299
with self.token_lock:
297-
if access_token == self.access_token_ or access_token is None:
300+
if access_token == self.access_token or access_token is None:
298301
c = self.get_credentials()
299302
if c.client_id and c.client_secret and c.refresh_token:
300303
r = self.session.post(

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.2.2
2+
current_version = 1.2.3
33
commit = True
44
tag = True
55

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
setup(
2626
name='pancloud',
27-
version='1.2.2',
27+
version='1.2.3',
2828
description="Python idiomatic SDK for the Palo Alto Networks Application Framework.",
2929
long_description=readme + '\n\n' + history,
3030
author="Steven Serrata",

0 commit comments

Comments
 (0)