diff --git a/docs/source/conf.py b/docs/source/conf.py index 281f62f..1af3f25 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -56,7 +56,7 @@ # The short X.Y version. version = u"1.2" # The full version, including alpha/beta/rc tags. -release = u"1.2.1" +release = u"1.2.2" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/pages/changelog.rst b/docs/source/pages/changelog.rst index 01a6ed2..ba57772 100644 --- a/docs/source/pages/changelog.rst +++ b/docs/source/pages/changelog.rst @@ -4,6 +4,19 @@ Changelog The format is based on `Keep a Changelog `_ and this project adheres to `Semantic Versioning `_. +++++++++++++++++++++++++++ +Version 1.2.2 - 2019-03-14 +++++++++++++++++++++++++++ + +| **Changed** +| - `#148 `_. Exception message on refresh token intialization +| + +| **Fixed** +| - `#147 `_. ``protected`` decorator properly applied to built in views when initialized on a blueprint +| + + ++++++++++++++++++++++++++ Version 1.2.1 - 2018-12-04 ++++++++++++++++++++++++++ diff --git a/sanic_jwt/__init__.py b/sanic_jwt/__init__.py index 7c5cea6..f4b4c08 100644 --- a/sanic_jwt/__init__.py +++ b/sanic_jwt/__init__.py @@ -1,4 +1,4 @@ -__version__ = "1.2.1" +__version__ = "1.2.2" __author__ = "Adam Hopkins" __credits__ = "Richard Kuesters" diff --git a/sanic_jwt/initialization.py b/sanic_jwt/initialization.py index 6395d39..872d80b 100644 --- a/sanic_jwt/initialization.py +++ b/sanic_jwt/initialization.py @@ -17,7 +17,9 @@ _Handler = namedtuple( "_Handler", ["name", "keys", "exception", "outside_auth_mode"] ) -_EndpointMapping = namedtuple("_EndpointMapping", ["cls", "endpoint", "keys", "is_protected"]) +_EndpointMapping = namedtuple( + "_EndpointMapping", ["cls", "endpoint", "keys", "is_protected"] +) def initialize(*args, **kwargs): @@ -43,7 +45,8 @@ def initialize(*args, **kwargs): _EndpointMapping( endpoints.RefreshEndpoint, "refresh", - ["auth_mode", "refresh_token_enabled"], False, + ["auth_mode", "refresh_token_enabled"], + False, ), ) @@ -148,7 +151,9 @@ def __add_endpoints(self): """ for mapping in endpoint_mappings: if all(map(self.config.get, mapping.keys)): - self.__add_single_endpoint(mapping.cls, mapping.endpoint, mapping.is_protected) + self.__add_single_endpoint( + mapping.cls, mapping.endpoint, mapping.is_protected + ) self.bp.exception(exceptions.SanicJWTException)( self.responses.exception_response diff --git a/setup.py b/setup.py index 26eb72b..c415fcd 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ setup( name="sanic-jwt", - version="1.2.1", + version="1.2.2", description="JWT oauth flow for Sanic", url="https://github.com/ahopkins/sanic-jwt", download_url="https://github.com/ahopkins/sanic-jwt/archive/master.zip", diff --git a/tests/test_endpoints_init_on_bp_retrieve_user.py b/tests/test_endpoints_init_on_bp_retrieve_user.py index 90d5434..3481500 100644 --- a/tests/test_endpoints_init_on_bp_retrieve_user.py +++ b/tests/test_endpoints_init_on_bp_retrieve_user.py @@ -8,8 +8,11 @@ def app_with_retrieve_user_on_bp( ): app, bp = app_with_bp_setup_without_init sanicjwt = Initialize( - bp, app=app, authenticate=authenticate, retrieve_user=retrieve_user, - debug=True + bp, + app=app, + authenticate=authenticate, + retrieve_user=retrieve_user, + debug=True, ) app.blueprint(bp) return app, sanicjwt, bp diff --git a/tests/test_initialize.py b/tests/test_initialize.py index 8102341..e2d9f32 100644 --- a/tests/test_initialize.py +++ b/tests/test_initialize.py @@ -233,8 +233,10 @@ def test_initialize_app_and_bp(): Initialize(instance=bp, app=app, authenticate=lambda: True) app.blueprint(bp) - # print("app", app.router.routes_all.keys()) - # print("bp", [x.uri for x in bp.routes]) + + +# print("app", app.router.routes_all.keys()) +# print("bp", [x.uri for x in bp.routes]) # Result: