Skip to content

Conversation

@anthonywee
Copy link
Contributor

  • Add a TokenResponse object, which is a subclass of BaseAPIJSONObject.
  • OAuth2.downscope_token() now returns a TokenResponse object, which
    allows users to get other fields of the response, such as
    'expires_in'.

@boxcla
Copy link

boxcla commented Sep 16, 2017

Verified that @anthonywee has signed the CLA. Thanks for the pull request!

- Add a TokenResponse object, which is a subclass of BaseAPIJSONObject.
- OAuth2.downscope_token() now returns a TokenResponse object, which
  allows users to get other fields of the response, such as
  'expires_in'.

access_token, _ = self._send_token_request_without_storing_tokens(data, access_token, expect_refresh_token=False)
return access_token
token_response = self.execute_token_request(data, access_token, expect_refresh_token=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just return from here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

self._access_token, self._refresh_token = access_token, refresh_token

def _send_token_request_without_storing_tokens(self, data, access_token, expect_refresh_token=True):
def execute_token_request(self, data, access_token, expect_refresh_token=True):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should keep this private for now.

Not that I think it should never be public. But until we know that we definitely need this in the public API, I don't think we should clutter the API and add more backwards-compatibility restrictions for ourselves.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, done

Copy link
Contributor

@Jeff-Meadows Jeff-Meadows left a comment

Choose a reason for hiding this comment

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

don't forget to bump the version if you'd like this to be released

@jmoldow jmoldow merged commit b7f0bfd into box:master Sep 19, 2017
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.

4 participants