Tags: copyleftdev/box-python-sdk
Tags
Change downscope_token() to return a TokenResponse object (box#237) 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'. Bump version to 2.0.0a9.
Add functionality for auto-revoking auth tokens (box#224) Auth objects can now be closed, which prevents them from being used to request new tokens. This will also revoke any existing tokens. Also introduces a `closing()` context manager method, which will auto-close the auth object on exit. Clients can use this to make sure that their tokens don't live longer than they need them for.
Merge pull request box#217 from box/1.5_jwt_token_refresh_fix Fix JWT Token Refresh and bump version to 1.5.4 Fixes box#197 in v1.5. Pull in repo config changes from master branch. Add testing support for Python 3.6, and upgrade PyPy tests to use PyPy2.7 5.8.0. Lock sphinx to a version that still supports Python 2.6. (In the future, on the master branch, we should exclude the sphinx install from CI jobs that don't use it, and use Python 3.6 for the job that does require sphinx.) Add new pattern to .gitignore, update configs in .pylintrc, add isort config. Add versioning note to README. Cherry pick Python3.6 support from master branch. Bump version to 1.5.4
Prepare for next 2.0.0 alpha release (box#183) Bump version to 2.0.0a3. Add new release notes. Start running tests against the development build of Python 3.6 (which is currently in a feature-freeze beta). gitignore more patterns for Python virtualenv directories. `six.with_metaclass()` doesn't work with `enum.EnumMeta` in Python 3.6, because of logic that was added to `EnumMeta.__prepare__()`. The six bug actually applies to all versions of Python 3, but I guess it was never noticed until now. This adds our own `with_metaclass()` helper function, with the fix applied to it. Later I'll submit the same patch to six. Explanation of the bug and the fix are in the docstring. jsonpatch is not currently compatible with Python 3.6. If we can't load it during functional testing, then `@chaos_utils.patch()` will be a no-op.
Refactor Translator to use less global state (box#165) In the past, there was one `Translator`, which was a global singleton, and would be permanently modified any time a new object class with an `_item_type` was created. Recently, in v2.0.0a1, we tried out a change where the global translator would be modified any time a new object class with an `_item_type` OR with a baseclass with an `_item_type` was created. This means that every subclass operation mutated global state. We thought this would make it easier for developers to add their own classes to the SDK. In retrospect, it makes it much harder to write tests (because any temporary subclasses created, including by a mock library, will modify global state for the rest of the test run), and makes it impossible to intentionally create a subclass that shouldn't be registered in the translator. So we are reverting this behavior for v2.0.0a2. Furthermore, this adds the ability to create non-global translators (which are, by default, used on `BoxSession` objects), and the ability to add non-global registrations to these non-global translators. This is now the publicly recommended way for developers to register types, outside of the SDK itself. For now, the old mechanism of implicitly registering the official SDK classes with `_item_type` is retained. But we can experiment with the new system, and see if we prefer to switch to the explicit registration, and delete the implicit registration system, in v2.0.0a3. Also fix a bug that I discovered in `ExtendableEnumMeta`.
PreviousNext