Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.13 #682

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading