Skip to content

Commit 6f5d7c5

Browse files
committed
Adjust the format
1 parent fa15558 commit 6f5d7c5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

flask_authz/utils/auth_decoder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def authorization_decoder(config, auth_str: str):
4040
elif type == "Bearer":
4141
"""return only the identity, depends on JWT 2.x"""
4242
decoded_jwt = jwt.decode(token, config.get("JWT_SECRET_KEY"),
43-
algorithms=config.get('JWT_HASH'))
44-
return decoded_jwt.get("identity", '')
43+
algorithms=config.get("JWT_HASH"))
44+
return decoded_jwt.get("identity", "")
4545
else:
4646
raise UnSupportedAuthType("%s Authorization is not supported" % type)

tests/test_casbin_enforcer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ def update_callback(self):
6464
("Authorization", "Basic Ym9iOnBhc3N3b3Jk", "GET", 200, "Authorization"),
6565
("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZGVudGl0eSI6ImJvYiJ9."
6666
"LM-CqxAM2MtT2uT3AO69rZ3WJ81nnyMQicizh4oqBwk", "GET", 200, None),
67-
("Authorization",
68-
"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MTUxMDg0OTIuNTY5MjksImlkZW50aXR5IjoiQm9iIn0."
69-
"CAeMpG-gKbucHU7-KMiqM7H_gTkHSRvXSjNtlvh5DlE", "GET", 401, None),
67+
("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9."
68+
"eyJleHAiOjE2MTUxMDg0OTIuNTY5MjksImlkZW50aXR5IjoiQm9iIn0."
69+
"CAeMpG-gKbucHU7-KMiqM7H_gTkHSRvXSjNtlvh5DlE", "GET", 401, None),
7070
("Authorization", "Unsupported Ym9iOnBhc3N3b3Jk", "GET", 401, None),
7171
("Authorization", "Unsupported Ym9iOnBhc3N3b3Jk", "GET", 401, None),
7272
],
@@ -117,7 +117,7 @@ def item():
117117
],
118118
)
119119
def test_enforcer_with_watcher(
120-
app_fixture, enforcer, header, user, method, status, watcher
120+
app_fixture, enforcer, header, user, method, status, watcher
121121
):
122122
enforcer.set_watcher(watcher())
123123

0 commit comments

Comments
 (0)