Skip to content

Commit

Permalink
Update changelog, bump version, run black
Browse files Browse the repository at this point in the history
  • Loading branch information
ahopkins committed Mar 14, 2019
1 parent 7bbc54c commit 5294d0d
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 13 additions & 0 deletions docs/source/pages/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ Changelog

The format is based on `Keep a Changelog <http://keepachangelog.com/en/1.0.0/>`_ and this project adheres to `Semantic Versioning <http://semver.org/spec/v2.0.0.html>`_.

++++++++++++++++++++++++++
Version 1.2.2 - 2019-03-14
++++++++++++++++++++++++++

| **Changed**
| - `#148 <https://github.com/ahopkins/sanic-jwt/issues/148>`_. Exception message on refresh token intialization
|
| **Fixed**
| - `#147 <https://github.com/ahopkins/sanic-jwt/issues/147>`_. ``protected`` decorator properly applied to built in views when initialized on a blueprint
|

++++++++++++++++++++++++++
Version 1.2.1 - 2018-12-04
++++++++++++++++++++++++++
Expand Down
2 changes: 1 addition & 1 deletion sanic_jwt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.2.1"
__version__ = "1.2.2"
__author__ = "Adam Hopkins"
__credits__ = "Richard Kuesters"

Expand Down
11 changes: 8 additions & 3 deletions sanic_jwt/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -43,7 +45,8 @@ def initialize(*args, **kwargs):
_EndpointMapping(
endpoints.RefreshEndpoint,
"refresh",
["auth_mode", "refresh_token_enabled"], False,
["auth_mode", "refresh_token_enabled"],
False,
),
)

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 5 additions & 2 deletions tests/test_endpoints_init_on_bp_retrieve_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions tests/test_initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5294d0d

Please sign in to comment.