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

bumped up for py 3.9 #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 4 additions & 3 deletions examples/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
mutation_jwt_refresh_token_required,
mutation_jwt_required,
)
from flask_graphql import GraphQLView
from graphql_server.flask.graphqlview import GraphQLView

app = Flask(__name__)
auth = GraphQLAuth(app)

app.config["JWT_SECRET_KEY"] = "something" # change this!
app.config["JWT_ACCESS_TOKEN_EXPIRES"] = 10 # 10 minutes
app.config["JWT_REFRESH_TOKEN_EXPIRES"] = 30 # 30 days

auth = GraphQLAuth(app)


class MessageField(graphene.ObjectType):
message = graphene.String()
Expand Down Expand Up @@ -86,7 +87,7 @@ class Mutation(graphene.ObjectType):


class Query(graphene.ObjectType):
protected = graphene.Field(type=ProtectedUnion, token=graphene.String())
protected = graphene.Field(type_=ProtectedUnion, token=graphene.String())

@query_jwt_required
def resolve_protected(self, info):
Expand Down
2 changes: 1 addition & 1 deletion examples/jwt_in_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
mutation_header_jwt_refresh_token_required,
mutation_header_jwt_required,
)
from flask_graphql import GraphQLView
from graphql_server.flask.graphqlview import GraphQLView

app = Flask(__name__)
auth = GraphQLAuth(app)
Expand Down
2 changes: 1 addition & 1 deletion examples/user_claims.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
mutation_jwt_required,
mutation_jwt_refresh_token_required,
)
from flask_graphql import GraphQLView
from graphql_server.flask.graphqlview import GraphQLView

app = Flask(__name__)
auth = GraphQLAuth(app)
Expand Down
17 changes: 0 additions & 17 deletions requirements.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements_test.txt

This file was deleted.

23 changes: 22 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@
except IndexError:
raise RuntimeError("Unable to determine version.")

install_requires = [
"flask",
"graphene",
"PyJWT==2.4.0"
]

tests_requires = [
"pytest==4.4.2",
"pytest-cov==2.7.1",
"coverage==4.5.3",
"pytest",
"graphql_server==3.0.0b5"
]

dev_requires = [] + tests_requires


setup(
name="Flask-GraphQL-Auth",
Expand All @@ -25,7 +41,12 @@
long_description=long_description,
long_description_content_type="text/markdown",
packages=["flask_graphql_auth"],
install_requires=["PyJWT==2.0.1", "Flask-GraphQL", "graphene", "flask"],
install_requires=install_requires,
tests_requires=tests_requires,
extras_require={
'test': tests_requires,
'dev': dev_requires,
},
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
Expand Down
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
from flask import Flask
import graphene
from flask_graphql_auth import GraphQLAuth
from flask_graphql import GraphQLView
from graphql_server.flask.graphqlview import GraphQLView

from examples.basic import Mutation, Query


@pytest.fixture(scope="function")
def flask_app():
app = Flask(__name__)
auth = GraphQLAuth(app)

app.config["JWT_SECRET_KEY"] = "something"
app.config["JWT_ACCESS_TOKEN_EXPIRES"] = 10
app.config["JWT_REFRESH_TOKEN_EXPIRES"] = 30

auth = GraphQLAuth(app)

schema = graphene.Schema(query=Query, mutation=Mutation)

app.add_url_rule(
Expand Down