1
0
mirror of https://github.com/etesync/server synced 2024-11-22 08:48:07 +00:00

fix: move myauth module from toplevel to under etebase_server

This is in preparation for creating a python package, which should only
occupy the "etebase_server" name in the global module namespace.
This commit is contained in:
Xiretza 2022-05-08 15:10:48 +02:00
parent 163f7766f1
commit 9d6e0ae60a
22 changed files with 19 additions and 18 deletions

View File

@ -1,7 +1,7 @@
from django.db import models from django.db import models
from django.utils import timezone from django.utils import timezone
from django.utils.crypto import get_random_string from django.utils.crypto import get_random_string
from myauth.models import get_typed_user_model from etebase_server.myauth.models import get_typed_user_model
User = get_typed_user_model() User = get_typed_user_model()

View File

@ -3,7 +3,7 @@ from dataclasses import dataclass
from django.db.models import QuerySet from django.db.models import QuerySet
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
from myauth.models import UserType, get_typed_user_model from etebase_server.myauth.models import UserType, get_typed_user_model
from . import app_settings from . import app_settings

View File

@ -8,7 +8,7 @@ from django.db.models import QuerySet
from django_etebase import models from django_etebase import models
from django_etebase.token_auth.models import AuthToken, get_default_expiry from django_etebase.token_auth.models import AuthToken, get_default_expiry
from myauth.models import UserType, get_typed_user_model from etebase_server.myauth.models import UserType, get_typed_user_model
from .exceptions import AuthenticationFailed from .exceptions import AuthenticationFailed
from .utils import get_object_or_404 from .utils import get_object_or_404
from .db_hack import django_db_cleanup_decorator from .db_hack import django_db_cleanup_decorator

View File

@ -19,7 +19,7 @@ from django_etebase.token_auth.models import AuthToken
from django_etebase.models import UserInfo from django_etebase.models import UserInfo
from django_etebase.signals import user_signed_up from django_etebase.signals import user_signed_up
from django_etebase.utils import create_user, get_user_queryset, CallbackContext from django_etebase.utils import create_user, get_user_queryset, CallbackContext
from myauth.models import UserType, get_typed_user_model from etebase_server.myauth.models import UserType, get_typed_user_model
from ..exceptions import AuthenticationFailed, transform_validation_error, HttpError from ..exceptions import AuthenticationFailed, transform_validation_error, HttpError
from ..msgpack import MsgpackRoute from ..msgpack import MsgpackRoute
from ..utils import BaseModel, permission_responses, msgpack_encode, msgpack_decode, get_user_username_email_kwargs from ..utils import BaseModel, permission_responses, msgpack_encode, msgpack_decode, get_user_username_email_kwargs

View File

@ -8,7 +8,7 @@ from django.db.models import Q, QuerySet
from fastapi import APIRouter, Depends, status, Request, BackgroundTasks from fastapi import APIRouter, Depends, status, Request, BackgroundTasks
from django_etebase import models from django_etebase import models
from myauth.models import UserType from etebase_server.myauth.models import UserType
from .authentication import get_authenticated_user from .authentication import get_authenticated_user
from .websocket import get_ticket, TicketRequest, TicketOut from .websocket import get_ticket, TicketRequest, TicketOut
from ..exceptions import HttpError, transform_validation_error, PermissionDenied, ValidationError from ..exceptions import HttpError, transform_validation_error, PermissionDenied, ValidationError

View File

@ -6,7 +6,7 @@ from fastapi import APIRouter, Depends, status, Request
from django_etebase import models from django_etebase import models
from django_etebase.utils import get_user_queryset, CallbackContext from django_etebase.utils import get_user_queryset, CallbackContext
from myauth.models import UserType, get_typed_user_model from etebase_server.myauth.models import UserType, get_typed_user_model
from .authentication import get_authenticated_user from .authentication import get_authenticated_user
from ..exceptions import HttpError, PermissionDenied from ..exceptions import HttpError, PermissionDenied
from ..msgpack import MsgpackRoute from ..msgpack import MsgpackRoute

View File

@ -5,7 +5,7 @@ from django.db.models import QuerySet
from fastapi import APIRouter, Depends, status from fastapi import APIRouter, Depends, status
from django_etebase import models from django_etebase import models
from myauth.models import UserType, get_typed_user_model from etebase_server.myauth.models import UserType, get_typed_user_model
from .authentication import get_authenticated_user from .authentication import get_authenticated_user
from ..msgpack import MsgpackRoute from ..msgpack import MsgpackRoute
from ..utils import get_object_or_404, BaseModel, permission_responses, PERMISSIONS_READ, PERMISSIONS_READWRITE from ..utils import get_object_or_404, BaseModel, permission_responses, PERMISSIONS_READ, PERMISSIONS_READWRITE

View File

@ -7,7 +7,7 @@ from django_etebase.utils import get_user_queryset, CallbackContext
from .authentication import SignupIn, signup_save from .authentication import SignupIn, signup_save
from ..msgpack import MsgpackRoute from ..msgpack import MsgpackRoute
from ..exceptions import HttpError from ..exceptions import HttpError
from myauth.models import get_typed_user_model from etebase_server.myauth.models import get_typed_user_model
test_reset_view_router = APIRouter(route_class=MsgpackRoute, tags=["test helpers"]) test_reset_view_router = APIRouter(route_class=MsgpackRoute, tags=["test helpers"])
User = get_typed_user_model() User = get_typed_user_model()

View File

@ -10,7 +10,7 @@ import nacl.utils
from django_etebase import models from django_etebase import models
from django_etebase.utils import CallbackContext, get_user_queryset from django_etebase.utils import CallbackContext, get_user_queryset
from myauth.models import UserType, get_typed_user_model from etebase_server.myauth.models import UserType, get_typed_user_model
from ..dependencies import get_collection_queryset, get_item_queryset from ..dependencies import get_collection_queryset, get_item_queryset
from ..exceptions import NotSupported from ..exceptions import NotSupported

View File

@ -12,7 +12,7 @@ from django.core.exceptions import ObjectDoesNotExist
from django_etebase import app_settings from django_etebase import app_settings
from django_etebase.models import AccessLevels from django_etebase.models import AccessLevels
from myauth.models import UserType, get_typed_user_model from etebase_server.myauth.models import UserType, get_typed_user_model
from .exceptions import HttpError, HttpErrorOut from .exceptions import HttpError, HttpErrorOut

View File

@ -2,4 +2,5 @@ from django.apps import AppConfig
class MyauthConfig(AppConfig): class MyauthConfig(AppConfig):
name = "myauth" name = "etebase_server.myauth"
label = "myauth"

View File

@ -1,6 +1,6 @@
from django import forms from django import forms
from django.contrib.auth.forms import UsernameField from django.contrib.auth.forms import UsernameField
from myauth.models import get_typed_user_model from etebase_server.myauth.models import get_typed_user_model
User = get_typed_user_model() User = get_typed_user_model()

View File

@ -1,7 +1,7 @@
# Generated by Django 3.0.3 on 2020-05-15 08:01 # Generated by Django 3.0.3 on 2020-05-15 08:01
from django.db import migrations, models from django.db import migrations, models
import myauth.models import etebase_server.myauth.models as myauth_models
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -19,7 +19,7 @@ class Migration(migrations.Migration):
help_text="Required. 150 characters or fewer. Letters, digits and ./+/-/_ only.", help_text="Required. 150 characters or fewer. Letters, digits and ./+/-/_ only.",
max_length=150, max_length=150,
unique=True, unique=True,
validators=[myauth.models.UnicodeUsernameValidator()], validators=[myauth_models.UnicodeUsernameValidator()],
verbose_name="username", verbose_name="username",
), ),
), ),

View File

@ -1,7 +1,7 @@
# Generated by Django 3.1.1 on 2020-11-19 08:10 # Generated by Django 3.1.1 on 2020-11-19 08:10
from django.db import migrations, models from django.db import migrations, models
import myauth.models import etebase_server.myauth.models as myauth_models
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -14,7 +14,7 @@ class Migration(migrations.Migration):
migrations.AlterModelManagers( migrations.AlterModelManagers(
name="user", name="user",
managers=[ managers=[
("objects", myauth.models.UserManager()), ("objects", myauth_models.UserManager()),
], ],
), ),
migrations.AlterField( migrations.AlterField(
@ -30,7 +30,7 @@ class Migration(migrations.Migration):
help_text="Required. 150 characters or fewer. Letters, digits and ./-/_ only.", help_text="Required. 150 characters or fewer. Letters, digits and ./-/_ only.",
max_length=150, max_length=150,
unique=True, unique=True,
validators=[myauth.models.UnicodeUsernameValidator()], validators=[myauth_models.UnicodeUsernameValidator()],
verbose_name="username", verbose_name="username",
), ),
), ),

View File

@ -54,7 +54,7 @@ INSTALLED_APPS = [
"django.contrib.sessions", "django.contrib.sessions",
"django.contrib.messages", "django.contrib.messages",
"django.contrib.staticfiles", "django.contrib.staticfiles",
"myauth.apps.MyauthConfig", "etebase_server.myauth.apps.MyauthConfig",
"django_etebase.apps.DjangoEtebaseConfig", "django_etebase.apps.DjangoEtebaseConfig",
"django_etebase.token_auth.apps.TokenAuthConfig", "django_etebase.token_auth.apps.TokenAuthConfig",
] ]