about summary refs log tree commit diff
path: root/gn_auth/auth
diff options
context:
space:
mode:
Diffstat (limited to 'gn_auth/auth')
-rw-r--r--gn_auth/auth/authentication/oauth2/endpoints/introspection.py2
-rw-r--r--gn_auth/auth/authentication/oauth2/endpoints/revocation.py4
-rw-r--r--gn_auth/auth/authentication/oauth2/endpoints/utilities.py4
-rw-r--r--gn_auth/auth/authentication/oauth2/grants/authorisation_code_grant.py6
-rw-r--r--gn_auth/auth/authentication/oauth2/grants/password_grant.py6
-rw-r--r--gn_auth/auth/authentication/oauth2/models/authorization_code.py2
-rw-r--r--gn_auth/auth/authentication/oauth2/models/oauth2client.py6
-rw-r--r--gn_auth/auth/authentication/oauth2/models/oauth2token.py6
-rw-r--r--gn_auth/auth/authentication/oauth2/resource_server.py4
-rw-r--r--gn_auth/auth/authentication/oauth2/server.py2
-rw-r--r--gn_auth/auth/authentication/oauth2/views.py6
-rw-r--r--gn_auth/auth/authorisation/data/genotypes.py10
-rw-r--r--gn_auth/auth/authorisation/data/mrna.py10
-rw-r--r--gn_auth/auth/authorisation/data/phenotypes.py10
-rw-r--r--gn_auth/auth/authorisation/data/views.py34
-rw-r--r--gn_auth/auth/authorisation/groups/data.py10
-rw-r--r--gn_auth/auth/authorisation/groups/models.py6
-rw-r--r--gn_auth/auth/authorisation/groups/views.py8
-rw-r--r--gn_auth/auth/authorisation/resources/checks.py4
-rw-r--r--gn_auth/auth/authorisation/resources/models.py8
-rw-r--r--gn_auth/auth/authorisation/resources/views.py2
-rw-r--r--gn_auth/auth/authorisation/roles/models.py8
-rw-r--r--gn_auth/auth/authorisation/roles/views.py4
-rw-r--r--gn_auth/auth/authorisation/users/admin/ui.py8
-rw-r--r--gn_auth/auth/authorisation/users/admin/views.py10
-rw-r--r--gn_auth/auth/authorisation/users/collections/models.py2
-rw-r--r--gn_auth/auth/authorisation/users/collections/views.py12
-rw-r--r--gn_auth/auth/authorisation/users/masquerade/models.py10
-rw-r--r--gn_auth/auth/authorisation/users/masquerade/views.py10
-rw-r--r--gn_auth/auth/authorisation/users/models.py10
-rw-r--r--gn_auth/auth/authorisation/users/views.py6
31 files changed, 115 insertions, 115 deletions
diff --git a/gn_auth/auth/authentication/oauth2/endpoints/introspection.py b/gn_auth/auth/authentication/oauth2/endpoints/introspection.py
index a567363..222ddcb 100644
--- a/gn_auth/auth/authentication/oauth2/endpoints/introspection.py
+++ b/gn_auth/auth/authentication/oauth2/endpoints/introspection.py
@@ -6,7 +6,7 @@ from flask import request as flask_request
 from authlib.oauth2.rfc7662 import (
     IntrospectionEndpoint as _IntrospectionEndpoint)
 
-from gn3.auth.authentication.oauth2.models.oauth2token import OAuth2Token
+from gn_auth.auth.authentication.oauth2.models.oauth2token import OAuth2Token
 
 from .utilities import query_token as _query_token
 
diff --git a/gn_auth/auth/authentication/oauth2/endpoints/revocation.py b/gn_auth/auth/authentication/oauth2/endpoints/revocation.py
index b8517b6..ad9e67c 100644
--- a/gn_auth/auth/authentication/oauth2/endpoints/revocation.py
+++ b/gn_auth/auth/authentication/oauth2/endpoints/revocation.py
@@ -3,8 +3,8 @@
 from flask import current_app
 from authlib.oauth2.rfc7009 import RevocationEndpoint as _RevocationEndpoint
 
-from gn3.auth import db
-from gn3.auth.authentication.oauth2.models.oauth2token import (
+from gn_auth.auth import db
+from gn_auth.auth.authentication.oauth2.models.oauth2token import (
     save_token, OAuth2Token, revoke_token)
 
 from .utilities import query_token as _query_token
diff --git a/gn_auth/auth/authentication/oauth2/endpoints/utilities.py b/gn_auth/auth/authentication/oauth2/endpoints/utilities.py
index 299f151..d32f9b3 100644
--- a/gn_auth/auth/authentication/oauth2/endpoints/utilities.py
+++ b/gn_auth/auth/authentication/oauth2/endpoints/utilities.py
@@ -4,8 +4,8 @@ from typing import Any, Optional
 from flask import current_app
 from pymonad.maybe import Nothing
 
-from gn3.auth import db
-from gn3.auth.authentication.oauth2.models.oauth2token import (
+from gn_auth.auth import db
+from gn_auth.auth.authentication.oauth2.models.oauth2token import (
     OAuth2Token, token_by_access_token, token_by_refresh_token)
 
 def query_token(# pylint: disable=[unused-argument]
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 f80d02e..6d8112e 100644
--- a/gn_auth/auth/authentication/oauth2/grants/authorisation_code_grant.py
+++ b/gn_auth/auth/authentication/oauth2/grants/authorisation_code_grant.py
@@ -9,9 +9,9 @@ from flask import current_app as app
 from authlib.oauth2.rfc6749 import grants
 from authlib.oauth2.rfc7636 import create_s256_code_challenge
 
-from gn3.auth import db
-from gn3.auth.db_utils import with_db_connection
-from gn3.auth.authentication.users import User
+from gn_auth.auth import db
+from gn_auth.auth.db_utils import with_db_connection
+from gn_auth.auth.authentication.users import User
 
 from ..models.oauth2client import OAuth2Client
 from ..models.authorization_code import (
diff --git a/gn_auth/auth/authentication/oauth2/grants/password_grant.py b/gn_auth/auth/authentication/oauth2/grants/password_grant.py
index 3233877..75fc122 100644
--- a/gn_auth/auth/authentication/oauth2/grants/password_grant.py
+++ b/gn_auth/auth/authentication/oauth2/grants/password_grant.py
@@ -3,10 +3,10 @@
 from flask import current_app as app
 from authlib.oauth2.rfc6749 import grants
 
-from gn3.auth import db
-from gn3.auth.authentication.users import valid_login, user_by_email
+from gn_auth.auth import db
+from gn_auth.auth.authentication.users import valid_login, user_by_email
 
-from gn3.auth.authorisation.errors import NotFoundError
+from gn_auth.auth.authorisation.errors import NotFoundError
 
 class PasswordGrant(grants.ResourceOwnerPasswordCredentialsGrant):
     """Implement the 'Password' grant."""
diff --git a/gn_auth/auth/authentication/oauth2/models/authorization_code.py b/gn_auth/auth/authentication/oauth2/models/authorization_code.py
index f282814..98b5d0f 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 gn3.auth import db
+from gn_auth.auth import 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 2a307e3..07618dd 100644
--- a/gn_auth/auth/authentication/oauth2/models/oauth2client.py
+++ b/gn_auth/auth/authentication/oauth2/models/oauth2client.py
@@ -6,10 +6,10 @@ from typing import Sequence, Optional, NamedTuple
 
 from pymonad.maybe import Just, Maybe, Nothing
 
-from gn3.auth import db
-from gn3.auth.authentication.users import User, users, user_by_id, same_password
+from gn_auth.auth import db
+from gn_auth.auth.authentication.users import User, users, user_by_id, same_password
 
-from gn3.auth.authorisation.errors import NotFoundError
+from gn_auth.auth.authorisation.errors import NotFoundError
 
 class OAuth2Client(NamedTuple):
     """
diff --git a/gn_auth/auth/authentication/oauth2/models/oauth2token.py b/gn_auth/auth/authentication/oauth2/models/oauth2token.py
index 72e20cc..725c096 100644
--- a/gn_auth/auth/authentication/oauth2/models/oauth2token.py
+++ b/gn_auth/auth/authentication/oauth2/models/oauth2token.py
@@ -5,10 +5,10 @@ from typing import NamedTuple, Optional
 
 from pymonad.maybe import Just, Maybe, Nothing
 
-from gn3.auth import db
-from gn3.auth.authentication.users import User, user_by_id
+from gn_auth.auth import db
+from gn_auth.auth.authentication.users import User, user_by_id
 
-from gn3.auth.authorisation.errors import NotFoundError
+from gn_auth.auth.authorisation.errors import NotFoundError
 
 from .oauth2client import client, OAuth2Client
 
diff --git a/gn_auth/auth/authentication/oauth2/resource_server.py b/gn_auth/auth/authentication/oauth2/resource_server.py
index 223e811..32c463f 100644
--- a/gn_auth/auth/authentication/oauth2/resource_server.py
+++ b/gn_auth/auth/authentication/oauth2/resource_server.py
@@ -4,8 +4,8 @@ from flask import current_app as app
 from authlib.oauth2.rfc6750 import BearerTokenValidator as _BearerTokenValidator
 from authlib.integrations.flask_oauth2 import ResourceProtector
 
-from gn3.auth import db
-from gn3.auth.authentication.oauth2.models.oauth2token import token_by_access_token
+from gn_auth.auth import db
+from gn_auth.auth.authentication.oauth2.models.oauth2token import token_by_access_token
 
 class BearerTokenValidator(_BearerTokenValidator):
     """Extends `authlib.oauth2.rfc6750.BearerTokenValidator`"""
diff --git a/gn_auth/auth/authentication/oauth2/server.py b/gn_auth/auth/authentication/oauth2/server.py
index 7d7113a..b085219 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 gn3.auth import db
+from gn_auth.auth import 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 2bd3865..43d9e49 100644
--- a/gn_auth/auth/authentication/oauth2/views.py
+++ b/gn_auth/auth/authentication/oauth2/views.py
@@ -14,9 +14,9 @@ from flask import (
     render_template,
     current_app as app)
 
-from gn3.auth import db
-from gn3.auth.db_utils import with_db_connection
-from gn3.auth.authorisation.errors import ForbiddenAccess
+from gn_auth.auth import db
+from gn_auth.auth.db_utils import with_db_connection
+from gn_auth.auth.authorisation.errors import ForbiddenAccess
 
 from .resource_server import require_oauth
 from .endpoints.revocation import RevocationEndpoint
diff --git a/gn_auth/auth/authorisation/data/genotypes.py b/gn_auth/auth/authorisation/data/genotypes.py
index 8f901a5..41822a1 100644
--- a/gn_auth/auth/authorisation/data/genotypes.py
+++ b/gn_auth/auth/authorisation/data/genotypes.py
@@ -4,11 +4,11 @@ from typing import Iterable
 
 from MySQLdb.cursors import DictCursor
 
-import gn3.auth.db as authdb
-import gn3.db_utils as gn3db
-from gn3.auth.dictify import dictify
-from gn3.auth.authorisation.checks import authorised_p
-from gn3.auth.authorisation.groups.models import Group
+import gn_auth.auth.db as authdb
+import gn_auth.db_utils as gn3db
+from gn_auth.auth.dictify import dictify
+from gn_auth.auth.authorisation.checks import authorised_p
+from gn_auth.auth.authorisation.groups.models import Group
 
 def linked_genotype_data(conn: authdb.DbConnection) -> Iterable[dict]:
     """Retrive genotype data that is linked to user groups."""
diff --git a/gn_auth/auth/authorisation/data/mrna.py b/gn_auth/auth/authorisation/data/mrna.py
index bdfc5c1..0b08571 100644
--- a/gn_auth/auth/authorisation/data/mrna.py
+++ b/gn_auth/auth/authorisation/data/mrna.py
@@ -3,11 +3,11 @@ import uuid
 from typing import Iterable
 from MySQLdb.cursors import DictCursor
 
-import gn3.auth.db as authdb
-import gn3.db_utils as gn3db
-from gn3.auth.dictify import dictify
-from gn3.auth.authorisation.checks import authorised_p
-from gn3.auth.authorisation.groups.models import Group
+import gn_auth.auth.db as authdb
+import gn_auth.db_utils as gn3db
+from gn_auth.auth.dictify import dictify
+from gn_auth.auth.authorisation.checks import authorised_p
+from gn_auth.auth.authorisation.groups.models import Group
 
 def linked_mrna_data(conn: authdb.DbConnection) -> Iterable[dict]:
     """Retrieve mRNA Assay data that is linked to user groups."""
diff --git a/gn_auth/auth/authorisation/data/phenotypes.py b/gn_auth/auth/authorisation/data/phenotypes.py
index ff98295..2f4c564 100644
--- a/gn_auth/auth/authorisation/data/phenotypes.py
+++ b/gn_auth/auth/authorisation/data/phenotypes.py
@@ -4,11 +4,11 @@ from typing import Any, Iterable
 
 from MySQLdb.cursors import DictCursor
 
-import gn3.auth.db as authdb
-import gn3.db_utils as gn3db
-from gn3.auth.dictify import dictify
-from gn3.auth.authorisation.checks import authorised_p
-from gn3.auth.authorisation.groups.models import Group
+import gn_auth.auth.db as authdb
+import gn_auth.db_utils as gn3db
+from gn_auth.auth.dictify import dictify
+from gn_auth.auth.authorisation.checks import authorised_p
+from gn_auth.auth.authorisation.groups.models import Group
 
 def linked_phenotype_data(
         authconn: authdb.DbConnection, gn3conn: gn3db.Connection,
diff --git a/gn_auth/auth/authorisation/data/views.py b/gn_auth/auth/authorisation/data/views.py
index 8adf862..a25e9a2 100644
--- a/gn_auth/auth/authorisation/data/views.py
+++ b/gn_auth/auth/authorisation/data/views.py
@@ -10,31 +10,31 @@ from MySQLdb.cursors import DictCursor
 from authlib.integrations.flask_oauth2.errors import _HTTPException
 from flask import request, jsonify, Response, Blueprint, current_app as app
 
-import gn3.db_utils as gn3db
-from gn3 import jobs
-from gn3.commands import run_async_cmd
-from gn3.db.traits import build_trait_name
+import gn_auth.db_utils as gn3db
+from gn_auth import jobs
+from gn_auth.commands import run_async_cmd
+from gn_auth.db.traits import build_trait_name
 
-from gn3.auth import db
-from gn3.auth.db_utils import with_db_connection
+from gn_auth.auth import db
+from gn_auth.auth.db_utils import with_db_connection
 
-from gn3.auth.authorisation.checks import require_json
-from gn3.auth.authorisation.errors import InvalidData, NotFoundError
+from gn_auth.auth.authorisation.checks import require_json
+from gn_auth.auth.authorisation.errors import InvalidData, NotFoundError
 
-from gn3.auth.authorisation.groups.models import group_by_id
+from gn_auth.auth.authorisation.groups.models import group_by_id
 
-from gn3.auth.authorisation.users.models import user_resource_roles
+from gn_auth.auth.authorisation.users.models import user_resource_roles
 
-from gn3.auth.authorisation.resources.checks import authorised_for
-from gn3.auth.authorisation.resources.models import (
+from gn_auth.auth.authorisation.resources.checks import authorised_for
+from gn_auth.auth.authorisation.resources.models import (
     user_resources, public_resources, attach_resources_data)
 
-from gn3.auth.authentication.users import User
-from gn3.auth.authentication.oauth2.resource_server import require_oauth
+from gn_auth.auth.authentication.users import User
+from gn_auth.auth.authentication.oauth2.resource_server import require_oauth
 
-from gn3.auth.authorisation.data.phenotypes import link_phenotype_data
-from gn3.auth.authorisation.data.mrna import link_mrna_data, ungrouped_mrna_data
-from gn3.auth.authorisation.data.genotypes import (
+from gn_auth.auth.authorisation.data.phenotypes import link_phenotype_data
+from gn_auth.auth.authorisation.data.mrna import link_mrna_data, ungrouped_mrna_data
+from gn_auth.auth.authorisation.data.genotypes import (
     link_genotype_data, ungrouped_genotype_data)
 
 data = Blueprint("data", __name__)
diff --git a/gn_auth/auth/authorisation/groups/data.py b/gn_auth/auth/authorisation/groups/data.py
index ee6f70e..d05747b 100644
--- a/gn_auth/auth/authorisation/groups/data.py
+++ b/gn_auth/auth/authorisation/groups/data.py
@@ -1,11 +1,11 @@
 """Handles the resource objects' data."""
 from MySQLdb.cursors import DictCursor
 
-from gn3 import db_utils as gn3db
-from gn3.auth import db as authdb
-from gn3.auth.authorisation.groups import Group
-from gn3.auth.authorisation.checks import authorised_p
-from gn3.auth.authorisation.errors import NotFoundError
+from gn_auth import db_utils as gn3db
+from gn_auth.auth import db as authdb
+from gn_auth.auth.authorisation.groups import Group
+from gn_auth.auth.authorisation.checks import authorised_p
+from gn_auth.auth.authorisation.errors import NotFoundError
 
 def __fetch_mrna_data_by_ids__(
         conn: gn3db.Connection, dataset_ids: tuple[str, ...]) -> tuple[
diff --git a/gn_auth/auth/authorisation/groups/models.py b/gn_auth/auth/authorisation/groups/models.py
index 5a3ae50..9008bef 100644
--- a/gn_auth/auth/authorisation/groups/models.py
+++ b/gn_auth/auth/authorisation/groups/models.py
@@ -7,9 +7,9 @@ from typing import Any, Sequence, Iterable, Optional, NamedTuple
 from flask import g
 from pymonad.maybe import Just, Maybe, Nothing
 
-from gn3.auth import db
-from gn3.auth.dictify import dictify
-from gn3.auth.authentication.users import User, user_by_id
+from gn_auth.auth import db
+from gn_auth.auth.dictify import dictify
+from gn_auth.auth.authentication.users import User, user_by_id
 
 from ..checks import authorised_p
 from ..privileges import Privilege
diff --git a/gn_auth/auth/authorisation/groups/views.py b/gn_auth/auth/authorisation/groups/views.py
index 628df36..d1724cc 100644
--- a/gn_auth/auth/authorisation/groups/views.py
+++ b/gn_auth/auth/authorisation/groups/views.py
@@ -7,11 +7,11 @@ from functools import partial
 from MySQLdb.cursors import DictCursor
 from flask import request, jsonify, Response, Blueprint, current_app
 
-from gn3.auth import db
-from gn3 import db_utils as gn3db
+from gn_auth.auth import db
+from gn_auth import db_utils as gn3db
 
-from gn3.auth.dictify import dictify
-from gn3.auth.db_utils import with_db_connection
+from gn_auth.auth.dictify import dictify
+from gn_auth.auth.db_utils import with_db_connection
 
 from .data import link_data_to_group
 from .models import (
diff --git a/gn_auth/auth/authorisation/resources/checks.py b/gn_auth/auth/authorisation/resources/checks.py
index fafde76..a341dbd 100644
--- a/gn_auth/auth/authorisation/resources/checks.py
+++ b/gn_auth/auth/authorisation/resources/checks.py
@@ -3,8 +3,8 @@ from uuid import UUID
 from functools import reduce
 from typing import Sequence
 
-from gn3.auth import db
-from gn3.auth.authentication.users import User
+from gn_auth.auth import db
+from gn_auth.auth.authentication.users import User
 
 def __organise_privileges_by_resource_id__(rows):
     def __organise__(privs, row):
diff --git a/gn_auth/auth/authorisation/resources/models.py b/gn_auth/auth/authorisation/resources/models.py
index b301a93..d96979f 100644
--- a/gn_auth/auth/authorisation/resources/models.py
+++ b/gn_auth/auth/authorisation/resources/models.py
@@ -5,10 +5,10 @@ from uuid import UUID, uuid4
 from functools import reduce, partial
 from typing import Any, Dict, Sequence, Optional, NamedTuple
 
-from gn3.auth import db
-from gn3.auth.dictify import dictify
-from gn3.auth.authentication.users import User
-from gn3.auth.db_utils import with_db_connection
+from gn_auth.auth import db
+from gn_auth.auth.dictify import dictify
+from gn_auth.auth.authentication.users import User
+from gn_auth.auth.db_utils import with_db_connection
 
 from .checks import authorised_for
 
diff --git a/gn_auth/auth/authorisation/resources/views.py b/gn_auth/auth/authorisation/resources/views.py
index 3b2bbeb..9645303 100644
--- a/gn_auth/auth/authorisation/resources/views.py
+++ b/gn_auth/auth/authorisation/resources/views.py
@@ -6,7 +6,7 @@ from functools import reduce
 
 from flask import request, jsonify, Response, Blueprint, current_app as app
 
-from gn3.auth.db_utils import with_db_connection
+from gn_auth.auth.db_utils import with_db_connection
 
 from .checks import authorised_for
 from .models import (
diff --git a/gn_auth/auth/authorisation/roles/models.py b/gn_auth/auth/authorisation/roles/models.py
index 97e11af..742a90e 100644
--- a/gn_auth/auth/authorisation/roles/models.py
+++ b/gn_auth/auth/authorisation/roles/models.py
@@ -5,10 +5,10 @@ from typing import Any, Sequence, Iterable, NamedTuple
 
 from pymonad.either import Left, Right, Either
 
-from gn3.auth import db
-from gn3.auth.dictify import dictify
-from gn3.auth.authentication.users import User
-from gn3.auth.authorisation.errors import AuthorisationError
+from gn_auth.auth import db
+from gn_auth.auth.dictify import dictify
+from gn_auth.auth.authentication.users import User
+from gn_auth.auth.authorisation.errors import AuthorisationError
 
 from ..checks import authorised_p
 from ..privileges import Privilege
diff --git a/gn_auth/auth/authorisation/roles/views.py b/gn_auth/auth/authorisation/roles/views.py
index 3670aab..6510365 100644
--- a/gn_auth/auth/authorisation/roles/views.py
+++ b/gn_auth/auth/authorisation/roles/views.py
@@ -3,8 +3,8 @@ import uuid
 
 from flask import jsonify, Response, Blueprint, current_app
 
-from gn3.auth import db
-from gn3.auth.dictify import dictify
+from gn_auth.auth import db
+from gn_auth.auth.dictify import dictify
 
 from .models import user_role
 
diff --git a/gn_auth/auth/authorisation/users/admin/ui.py b/gn_auth/auth/authorisation/users/admin/ui.py
index 242c7a6..4351a68 100644
--- a/gn_auth/auth/authorisation/users/admin/ui.py
+++ b/gn_auth/auth/authorisation/users/admin/ui.py
@@ -2,11 +2,11 @@
 from functools import wraps
 from flask import flash, url_for, redirect
 
-from gn3.auth.authentication.users import User
-from gn3.auth.db_utils import with_db_connection
-from gn3.auth.authorisation.roles.models import user_roles
+from gn_auth.auth.authentication.users import User
+from gn_auth.auth.db_utils import with_db_connection
+from gn_auth.auth.authorisation.roles.models import user_roles
 
-from gn3.session import logged_in, session_user, clear_session_info
+from gn_auth.session import logged_in, session_user, clear_session_info
 
 def is_admin(func):
     """Verify user is a system admin."""
diff --git a/gn_auth/auth/authorisation/users/admin/views.py b/gn_auth/auth/authorisation/users/admin/views.py
index c9f1887..ab04f91 100644
--- a/gn_auth/auth/authorisation/users/admin/views.py
+++ b/gn_auth/auth/authorisation/users/admin/views.py
@@ -17,17 +17,17 @@ from flask import (
     render_template)
 
 
-from gn3 import session
-from gn3.auth import db
-from gn3.auth.db_utils import with_db_connection
+from gn_auth import session
+from gn_auth.auth import db
+from gn_auth.auth.db_utils import with_db_connection
 
-from gn3.auth.authentication.oauth2.models.oauth2client import (
+from gn_auth.auth.authentication.oauth2.models.oauth2client import (
     save_client,
     OAuth2Client,
     oauth2_clients,
     client as oauth2_client,
     delete_client as _delete_client)
-from gn3.auth.authentication.users import (
+from gn_auth.auth.authentication.users import (
     User,
     user_by_id,
     valid_login,
diff --git a/gn_auth/auth/authorisation/users/collections/models.py b/gn_auth/auth/authorisation/users/collections/models.py
index 7577fa8..eb9b188 100644
--- a/gn_auth/auth/authorisation/users/collections/models.py
+++ b/gn_auth/auth/authorisation/users/collections/models.py
@@ -6,7 +6,7 @@ from datetime import datetime
 from redis import Redis
 from email_validator import validate_email, EmailNotValidError
 
-from gn3.auth.authorisation.errors import InvalidData, NotFoundError
+from gn_auth.auth.authorisation.errors import InvalidData, NotFoundError
 
 from ..models import User
 
diff --git a/gn_auth/auth/authorisation/users/collections/views.py b/gn_auth/auth/authorisation/users/collections/views.py
index 1fa25a3..3dcc10f 100644
--- a/gn_auth/auth/authorisation/users/collections/views.py
+++ b/gn_auth/auth/authorisation/users/collections/views.py
@@ -4,13 +4,13 @@ from uuid import UUID
 from redis import Redis
 from flask import jsonify, request, Response, Blueprint, current_app
 
-from gn3.auth import db
-from gn3.auth.db_utils import with_db_connection
-from gn3.auth.authorisation.checks import require_json
-from gn3.auth.authorisation.errors import NotFoundError
+from gn_auth.auth import db
+from gn_auth.auth.db_utils import with_db_connection
+from gn_auth.auth.authorisation.checks import require_json
+from gn_auth.auth.authorisation.errors import NotFoundError
 
-from gn3.auth.authentication.users import User, user_by_id
-from gn3.auth.authentication.oauth2.resource_server import require_oauth
+from gn_auth.auth.authentication.users import User, user_by_id
+from gn_auth.auth.authentication.oauth2.resource_server import require_oauth
 
 from .models import (
     add_traits,
diff --git a/gn_auth/auth/authorisation/users/masquerade/models.py b/gn_auth/auth/authorisation/users/masquerade/models.py
index 9f24b6b..c45d761 100644
--- a/gn_auth/auth/authorisation/users/masquerade/models.py
+++ b/gn_auth/auth/authorisation/users/masquerade/models.py
@@ -5,13 +5,13 @@ from datetime import datetime
 
 from flask import current_app as app
 
-from gn3.auth import db
+from gn_auth.auth import db
 
-from gn3.auth.authorisation.errors import ForbiddenAccess
-from gn3.auth.authorisation.roles.models import user_roles
+from gn_auth.auth.authorisation.errors import ForbiddenAccess
+from gn_auth.auth.authorisation.roles.models import user_roles
 
-from gn3.auth.authentication.users import User
-from gn3.auth.authentication.oauth2.models.oauth2token import (
+from gn_auth.auth.authentication.users import User
+from gn_auth.auth.authentication.oauth2.models.oauth2token import (
     OAuth2Token, save_token)
 
 __FIVE_HOURS__ = (60 * 60 * 5)
diff --git a/gn_auth/auth/authorisation/users/masquerade/views.py b/gn_auth/auth/authorisation/users/masquerade/views.py
index 43286a1..9e42945 100644
--- a/gn_auth/auth/authorisation/users/masquerade/views.py
+++ b/gn_auth/auth/authorisation/users/masquerade/views.py
@@ -4,12 +4,12 @@ from functools import partial
 
 from flask import request, jsonify, Response, Blueprint
 
-from gn3.auth.db_utils import with_db_connection
-from gn3.auth.authorisation.errors import InvalidData
-from gn3.auth.authorisation.checks import require_json
+from gn_auth.auth.db_utils import with_db_connection
+from gn_auth.auth.authorisation.errors import InvalidData
+from gn_auth.auth.authorisation.checks import require_json
 
-from gn3.auth.authentication.users import user_by_id
-from gn3.auth.authentication.oauth2.resource_server import require_oauth
+from gn_auth.auth.authentication.users import user_by_id
+from gn_auth.auth.authentication.oauth2.resource_server import require_oauth
 
 from .models import masquerade_as
 
diff --git a/gn_auth/auth/authorisation/users/models.py b/gn_auth/auth/authorisation/users/models.py
index 89c1d22..71fa390 100644
--- a/gn_auth/auth/authorisation/users/models.py
+++ b/gn_auth/auth/authorisation/users/models.py
@@ -2,12 +2,12 @@
 import uuid
 from functools import reduce
 
-from gn3.auth import db
-from gn3.auth.authorisation.roles.models import Role
-from gn3.auth.authorisation.checks import authorised_p
-from gn3.auth.authorisation.privileges import Privilege
+from gn_auth.auth import db
+from gn_auth.auth.authorisation.roles.models import Role
+from gn_auth.auth.authorisation.checks import authorised_p
+from gn_auth.auth.authorisation.privileges import Privilege
 
-from gn3.auth.authentication.users import User
+from gn_auth.auth.authentication.users import User
 
 @authorised_p(
     ("system:user:list",),
diff --git a/gn_auth/auth/authorisation/users/views.py b/gn_auth/auth/authorisation/users/views.py
index 826e222..7783dca 100644
--- a/gn_auth/auth/authorisation/users/views.py
+++ b/gn_auth/auth/authorisation/users/views.py
@@ -7,9 +7,9 @@ import sqlite3
 from email_validator import validate_email, EmailNotValidError
 from flask import request, jsonify, Response, Blueprint, current_app
 
-from gn3.auth import db
-from gn3.auth.dictify import dictify
-from gn3.auth.db_utils import with_db_connection
+from gn_auth.auth import db
+from gn_auth.auth.dictify import dictify
+from gn_auth.auth.db_utils import with_db_connection
 
 from .models import list_users
 from .masquerade.views import masq