Skip to content

Commit

Permalink
Merge pull request #682 from V02460/py313
Browse files Browse the repository at this point in the history
Support Python 3.13
  • Loading branch information
azmeuk authored Oct 21, 2024
2 parents 904d66b + d282c1a commit 64c3eed
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ jobs:
max-parallel: 3
matrix:
python:
- version: "3.8"
- version: "3.9"
- version: "3.10"
- version: "3.11"
- version: "3.12"
- version: "pypy3.8"
- version: "3.13"
- version: "pypy3.9"
- version: "pypy3.10"

Expand Down
30 changes: 25 additions & 5 deletions tests/flask/test_oauth2/test_jwt_access_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,51 @@ def create_resource_protector(app, validator):
@require_oauth()
def protected():
user = db.session.get(User, current_token['sub'])
return jsonify(id=user.id, username=user.username, token=current_token)
return jsonify(
id=user.id,
username=user.username,
token=current_token._get_current_object(),
)

@app.route('/protected-by-scope')
@require_oauth('profile')
def protected_by_scope():
user = db.session.get(User, current_token['sub'])
return jsonify(id=user.id, username=user.username, token=current_token)
return jsonify(
id=user.id,
username=user.username,
token=current_token._get_current_object(),
)

@app.route('/protected-by-groups')
@require_oauth(groups=['admins'])
def protected_by_groups():
user = db.session.get(User, current_token['sub'])
return jsonify(id=user.id, username=user.username, token=current_token)
return jsonify(
id=user.id,
username=user.username,
token=current_token._get_current_object(),
)

@app.route('/protected-by-roles')
@require_oauth(roles=['student'])
def protected_by_roles():
user = db.session.get(User, current_token['sub'])
return jsonify(id=user.id, username=user.username, token=current_token)
return jsonify(
id=user.id,
username=user.username,
token=current_token._get_current_object(),
)

@app.route('/protected-by-entitlements')
@require_oauth(entitlements=['captain'])
def protected_by_entitlements():
user = db.session.get(User, current_token['sub'])
return jsonify(id=user.id, username=user.username, token=current_token)
return jsonify(
id=user.id,
username=user.username,
token=current_token._get_current_object(),
)

return require_oauth

Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
isolated_build = True
envlist =
py{38,39,310,311,312,py38,py39,py310}
py{38,39,310,311,312,py38,py39,py310}-{clients,flask,django,jose}
py{39,310,311,312,313,py39,py310}
py{39,310,311,312,313,py39,py310}-{clients,flask,django,jose}
coverage

[testenv]
Expand Down

0 comments on commit 64c3eed

Please sign in to comment.