From 0360166db2c01672426213fb0f7f991126adb742 Mon Sep 17 00:00:00 2001 From: dolevf Date: Tue, 5 Jul 2022 21:10:55 -0400 Subject: [PATCH 1/3] feat/add-phone-num-paste --- setup.py | 10 ++++++++++ version.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5a1954c..8cda516 100644 --- a/setup.py +++ b/setup.py @@ -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): diff --git a/version.py b/version.py index 43082d4..5f42f88 100644 --- a/version.py +++ b/version.py @@ -1 +1 @@ -VERSION = '2.1.0' +VERSION = '2.1.1' From a178ee3c29d748fb68eef499e69bb0dc93a3eb12 Mon Sep 17 00:00:00 2001 From: dolevf Date: Tue, 5 Jul 2022 21:25:12 -0400 Subject: [PATCH 2/3] fix-jwt-expiry-and-add-phone-no-paste --- core/helpers.py | 2 +- core/views.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/core/helpers.py b/core/helpers.py index ba7b911..c03cc87 100644 --- a/core/helpers.py +++ b/core/helpers.py @@ -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: diff --git a/core/views.py b/core/views.py index fed089f..3dad4ce 100644 --- a/core/views.py +++ b/core/views.py @@ -285,7 +285,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) From 39ae232e8eae4a71a74dd9fbb7b5bf2ebbf7a072 Mon Sep 17 00:00:00 2001 From: dolevf Date: Tue, 5 Jul 2022 21:27:35 -0400 Subject: [PATCH 3/3] remove unused imports, add step to github --- .github/workflows/test.yaml | 2 ++ core/views.py | 7 ++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ba1f508..7a7d1d5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,10 +4,12 @@ on: pull_request: branches: - master + - blackhatgraphql push: branches: - master + - blackhatgraphql jobs: test: diff --git a/core/views.py b/core/views.py index 3dad4ce..f393b9d 100644 --- a/core/views.py +++ b/core/views.py @@ -5,7 +5,7 @@ helpers, middleware ) -from graphql.error import GraphQLError + from core.directives import * from core.models import ( Owner, @@ -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