Skip to content

Commit 310d51f

Browse files
committed
rename expiration
1 parent a3dcf5a commit 310d51f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

bandwidth/configuration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def __init__(
267267
self.temp_access_token = None
268268
"""Temporary access token for OAuth2
269269
"""
270-
self.temp_access_token_expires_at = 0
270+
self.temp_access_token_expiration = 0
271271
"""Expiration time of the temporary access token
272272
"""
273273
self.logger = {}
@@ -532,7 +532,7 @@ def get_access_token(self) -> str:
532532
:return: The token for bearer HTTP authentication.
533533
"""
534534
now = int(time.time())
535-
if self.temp_access_token and self.temp_access_token_expires_at > now + 60:
535+
if self.temp_access_token and self.temp_access_token_expiration > now + 60:
536536
return self.temp_access_token
537537
else:
538538
print("Fetching new access token")
@@ -550,7 +550,7 @@ def get_access_token(self) -> str:
550550
)
551551
body = resp.json()
552552
self.temp_access_token = body['access_token']
553-
self.temp_access_token_expires_at = now + body['expires_in']
553+
self.temp_access_token_expiration = now + body['expires_in']
554554
return self.temp_access_token
555555

556556
def auth_settings(self)-> AuthSettings:

custom_templates/configuration.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ conf = {{{packageName}}}.Configuration(
357357
self.temp_access_token = None
358358
"""Temporary access token for OAuth2
359359
"""
360-
self.temp_access_token_expires_at = 0
360+
self.temp_access_token_expiration = 0
361361
"""Expiration time of the temporary access token
362362
"""
363363
{{#hasHttpSignatureMethods}}
@@ -643,7 +643,7 @@ conf = {{{packageName}}}.Configuration(
643643
:return: The token for bearer HTTP authentication.
644644
"""
645645
now = int(time.time())
646-
if self.temp_access_token and self.temp_access_token_expires_at > now + 60:
646+
if self.temp_access_token and self.temp_access_token_expiration > now + 60:
647647
return self.temp_access_token
648648
else:
649649
print("Fetching new access token")
@@ -661,7 +661,7 @@ conf = {{{packageName}}}.Configuration(
661661
)
662662
body = resp.json()
663663
self.temp_access_token = body['access_token']
664-
self.temp_access_token_expires_at = now + body['expires_in']
664+
self.temp_access_token_expiration = now + body['expires_in']
665665
return self.temp_access_token
666666

667667
def auth_settings(self)-> AuthSettings:

0 commit comments

Comments
 (0)