diff options
author | Frederick Muriuki Muriithi | 2023-08-07 07:58:09 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-08-07 09:26:12 +0300 |
commit | 6d9c61dc0072b96b12153e64940b465306f25bfb (patch) | |
tree | a4957c7967e56b4527c1e926744a65a3326935ce /gn_auth/auth/authentication/oauth2 | |
parent | 6ab6d46ab4b1611ed72bdbce85cf9324ce69b305 (diff) | |
download | gn-auth-6d9c61dc0072b96b12153e64940b465306f25bfb.tar.gz |
Change imports to new unified db module.
Diffstat (limited to 'gn_auth/auth/authentication/oauth2')
10 files changed, 12 insertions, 12 deletions
diff --git a/gn_auth/auth/authentication/oauth2/endpoints/revocation.py b/gn_auth/auth/authentication/oauth2/endpoints/revocation.py index ad9e67c..240ca30 100644 --- a/gn_auth/auth/authentication/oauth2/endpoints/revocation.py +++ b/gn_auth/auth/authentication/oauth2/endpoints/revocation.py @@ -3,7 +3,7 @@ from flask import current_app from authlib.oauth2.rfc7009 import RevocationEndpoint as _RevocationEndpoint -from gn_auth.auth import db +from gn_auth.auth.db import sqlite3 as db from gn_auth.auth.authentication.oauth2.models.oauth2token import ( save_token, OAuth2Token, revoke_token) diff --git a/gn_auth/auth/authentication/oauth2/endpoints/utilities.py b/gn_auth/auth/authentication/oauth2/endpoints/utilities.py index d32f9b3..29ace7c 100644 --- a/gn_auth/auth/authentication/oauth2/endpoints/utilities.py +++ b/gn_auth/auth/authentication/oauth2/endpoints/utilities.py @@ -4,7 +4,7 @@ from typing import Any, Optional from flask import current_app from pymonad.maybe import Nothing -from gn_auth.auth import db +from gn_auth.auth.db import sqlite3 as db from gn_auth.auth.authentication.oauth2.models.oauth2token import ( OAuth2Token, token_by_access_token, token_by_refresh_token) diff --git a/gn_auth/auth/authentication/oauth2/grants/authorisation_code_grant.py b/gn_auth/auth/authentication/oauth2/grants/authorisation_code_grant.py index 6d8112e..e866c41 100644 --- a/gn_auth/auth/authentication/oauth2/grants/authorisation_code_grant.py +++ b/gn_auth/auth/authentication/oauth2/grants/authorisation_code_grant.py @@ -9,8 +9,8 @@ from flask import current_app as app from authlib.oauth2.rfc6749 import grants from authlib.oauth2.rfc7636 import create_s256_code_challenge -from gn_auth.auth import db -from gn_auth.auth.db_utils import with_db_connection +from gn_auth.auth.db import sqlite3 as db +from gn_auth.auth.db.sqlite3 import with_db_connection from gn_auth.auth.authentication.users import User from ..models.oauth2client import OAuth2Client diff --git a/gn_auth/auth/authentication/oauth2/grants/password_grant.py b/gn_auth/auth/authentication/oauth2/grants/password_grant.py index 75fc122..79382fd 100644 --- a/gn_auth/auth/authentication/oauth2/grants/password_grant.py +++ b/gn_auth/auth/authentication/oauth2/grants/password_grant.py @@ -3,7 +3,7 @@ from flask import current_app as app from authlib.oauth2.rfc6749 import grants -from gn_auth.auth import db +from gn_auth.auth.db import sqlite3 as db from gn_auth.auth.authentication.users import valid_login, user_by_email from gn_auth.auth.authorisation.errors import NotFoundError diff --git a/gn_auth/auth/authentication/oauth2/models/authorization_code.py b/gn_auth/auth/authentication/oauth2/models/authorization_code.py index 98b5d0f..6c586f3 100644 --- a/gn_auth/auth/authentication/oauth2/models/authorization_code.py +++ b/gn_auth/auth/authentication/oauth2/models/authorization_code.py @@ -5,7 +5,7 @@ from typing import NamedTuple from pymonad.maybe import Just, Maybe, Nothing -from gn_auth.auth import db +from gn_auth.auth.db import sqlite3 as db from .oauth2client import OAuth2Client diff --git a/gn_auth/auth/authentication/oauth2/models/oauth2client.py b/gn_auth/auth/authentication/oauth2/models/oauth2client.py index 07618dd..ea86772 100644 --- a/gn_auth/auth/authentication/oauth2/models/oauth2client.py +++ b/gn_auth/auth/authentication/oauth2/models/oauth2client.py @@ -6,7 +6,7 @@ from typing import Sequence, Optional, NamedTuple from pymonad.maybe import Just, Maybe, Nothing -from gn_auth.auth import db +from gn_auth.auth.db import sqlite3 as db from gn_auth.auth.authentication.users import User, users, user_by_id, same_password from gn_auth.auth.authorisation.errors import NotFoundError diff --git a/gn_auth/auth/authentication/oauth2/models/oauth2token.py b/gn_auth/auth/authentication/oauth2/models/oauth2token.py index 725c096..6f9dc12 100644 --- a/gn_auth/auth/authentication/oauth2/models/oauth2token.py +++ b/gn_auth/auth/authentication/oauth2/models/oauth2token.py @@ -5,7 +5,7 @@ from typing import NamedTuple, Optional from pymonad.maybe import Just, Maybe, Nothing -from gn_auth.auth import db +from gn_auth.auth.db import sqlite3 as db from gn_auth.auth.authentication.users import User, user_by_id from gn_auth.auth.authorisation.errors import NotFoundError diff --git a/gn_auth/auth/authentication/oauth2/resource_server.py b/gn_auth/auth/authentication/oauth2/resource_server.py index 32c463f..c062b28 100644 --- a/gn_auth/auth/authentication/oauth2/resource_server.py +++ b/gn_auth/auth/authentication/oauth2/resource_server.py @@ -4,7 +4,7 @@ from flask import current_app as app from authlib.oauth2.rfc6750 import BearerTokenValidator as _BearerTokenValidator from authlib.integrations.flask_oauth2 import ResourceProtector -from gn_auth.auth import db +from gn_auth.auth.db import sqlite3 as db from gn_auth.auth.authentication.oauth2.models.oauth2token import token_by_access_token class BearerTokenValidator(_BearerTokenValidator): diff --git a/gn_auth/auth/authentication/oauth2/server.py b/gn_auth/auth/authentication/oauth2/server.py index b085219..12366a6 100644 --- a/gn_auth/auth/authentication/oauth2/server.py +++ b/gn_auth/auth/authentication/oauth2/server.py @@ -8,7 +8,7 @@ from authlib.oauth2.rfc6749.errors import InvalidClientError from authlib.integrations.flask_oauth2 import AuthorizationServer # from authlib.oauth2.rfc7636 import CodeChallenge -from gn_auth.auth import db +from gn_auth.auth.db import sqlite3 as db from .models.oauth2client import client from .models.oauth2token import OAuth2Token, save_token diff --git a/gn_auth/auth/authentication/oauth2/views.py b/gn_auth/auth/authentication/oauth2/views.py index 43d9e49..ac74739 100644 --- a/gn_auth/auth/authentication/oauth2/views.py +++ b/gn_auth/auth/authentication/oauth2/views.py @@ -14,8 +14,8 @@ from flask import ( render_template, current_app as app) -from gn_auth.auth import db -from gn_auth.auth.db_utils import with_db_connection +from gn_auth.auth.db import sqlite3 as db +from gn_auth.auth.db.sqlite3 import with_db_connection from gn_auth.auth.authorisation.errors import ForbiddenAccess from .resource_server import require_oauth |