Skip to content

Conversation

@akharit
Copy link
Member

@akharit akharit commented Oct 23, 2018


This checklist is used to make sure that common guidelines for a pull request are followed.

Description of the change

Add retry for auth method in lib.py that gets the token for the first time. Also moved check_token under the retry code block in call method so we don't fail a call because of transient issues in token refresh.

General Guidelines

  • The PR has modified HISTORY.rst with an appropriate description of the change and a version increment.
    Will be done when merge to master
  • The PR has supporting test coverage that confirm the expected behavior and protects against regressions, including necessary recordings.
  • [] Links to associated bugs, if any, are in the description.
    NA

@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 86.315% when pulling ac65195 on authentication-retry into dc7d053 on dev.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 86.315% when pulling ac65195 on authentication-retry into dc7d053 on dev.

@coveralls
Copy link

coveralls commented Oct 24, 2018

Coverage Status

Coverage increased (+0.5%) to 86.344% when pulling b8b6178 on authentication-retry into dc7d053 on dev.

Copy link

@lewu-msft lewu-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor comments for now

body=body_discovery,
status=200)

responses.add(responses.POST, mock_url, body=r'{"error":"' + error_string + r'","error_description":"0","error_codes":[0],"timestamp":"0","trace_id":"0","correlation_id":"0"}'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: refactor this format a little bit?

Response = namedtuple("Response", list(response.keys()) + ['status_code'])
values = list(response.values()) + [int(http_code.group(1))]
response = Response(
*values) # Construct response object with adal exception response and http code

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: refactor this format a little bit?

Copy link

@lewu-msft lewu-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
let Rahul to double check

@akharit akharit merged commit aff7d1a into dev Oct 29, 2018
akharit added a commit that referenced this pull request Oct 31, 2018
* Retry for authentication(getting tokens) (#251)

* Fix test environment variables

* Upgrade requests minimum version because of CVE 2018-18074

* Test recordings update (#250)

* Updated history.rst and version number
@akharit akharit deleted the authentication-retry branch November 6, 2018 00:47
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.

5 participants