Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.6.18

* Added retry mechanism for the authentication flow.

## v0.6.17

* Removed unnecessary dependencies of the SDK, bumped Pyarrow to v10.
Expand Down
2 changes: 1 addition & 1 deletion railib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version_info__ = (0, 6, 17)
__version_info__ = (0, 6, 18)
__version__ = ".".join(map(str, __version_info__))
4 changes: 3 additions & 1 deletion railib/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,15 @@ def _request_access_token(ctx: Context, url: str) -> AccessToken:
data=data,
)
_print_request(req)
with urlopen(req) as rsp:
with _urlopen_with_retry(req, ctx.retries) as rsp:
result = json.loads(rsp.read())
token = result.get(ACCESS_KEY_TOKEN_KEY, None)

if token is not None:
expires_in = result.get(EXPIRES_IN_KEY, None)
scope = result.get(SCOPE, None)
return AccessToken(token, scope, expires_in)

raise Exception("failed to get the access token")


Expand Down