Skip to content

Commit

Permalink
Merge pull request #54 from dolevf/add-phone-number-paste
Browse files Browse the repository at this point in the history
fix: ci step, import cleanup, jwt verification disable
  • Loading branch information
nicholasaleks authored Jul 6, 2022
2 parents 7eb17a0 + 39ae232 commit 06666ba
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ on:
pull_request:
branches:
- master
- blackhatgraphql

push:
branches:
- master
- blackhatgraphql

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion core/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def decode_base64(text):
return base64.b64decode(text).decode('utf-8')

def get_identity(token):
return decode(token, options={"verify_signature":False}).get('identity')
return decode(token, options={"verify_signature":False, "verify_exp":False}).get('identity')

def save_file(filename, text):
try:
Expand Down
8 changes: 2 additions & 6 deletions core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
helpers,
middleware
)
from graphql.error import GraphQLError

from core.directives import *
from core.models import (
Owner,
Expand All @@ -23,17 +23,14 @@
from flask import (
request,
render_template,
make_response,
session
make_response
)

from flask_graphql_auth import (
get_jwt_identity,
create_access_token,
create_refresh_token,
)

from flask_graphql_auth.decorators import verify_jwt_in_argument
from flask_sockets import Sockets
from graphql.backend import GraphQLCoreBackend
from sqlalchemy import event, text
Expand Down Expand Up @@ -285,7 +282,6 @@ def resolve_me(self, info, token):
Audit.create_audit_entry(info)

identity = get_identity(token)

info.context.json['identity'] = identity

query = UserObject.get_query(info)
Expand Down
10 changes: 10 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ def pump_db():
paste.user_agent = 'User-Agent not set'
db.session.add(paste)

paste = Paste()
paste.title = '555-555-1337'
paste.content = "My Phone Number"
paste.public = False
paste.owner_id = owner.id
paste.owner = owner
paste.ip_addr = '127.0.0.1'
paste.user_agent = 'User-Agent not set'
db.session.add(paste)

db.session.commit()

for _ in range(0, 10):
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '2.1.0'
VERSION = '2.1.1'

0 comments on commit 06666ba

Please sign in to comment.