xn-auth 0.2.42__py3-none-any.whl → 0.2.44__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
x_auth/controller.py CHANGED
@@ -41,7 +41,9 @@ class Auth:
41
41
  res = self.jwt.login(
42
42
  identifier=str(db_user.id),
43
43
  token_extras={"role": db_user.role, "blocked": db_user.blocked},
44
- response_body=XyncUser.model_validate({**user.model_dump(), "pub": b64encode(db_user.pub)}),
44
+ response_body=XyncUser.model_validate(
45
+ {**user.model_dump(), "pub": db_user.pub and b64encode(db_user.pub)}
46
+ ),
45
47
  )
46
48
  res.cookies[0].httponly = False
47
49
  return res
x_auth/models.py CHANGED
@@ -27,7 +27,7 @@ from tortoise.fields import (
27
27
  from tortoise.fields.data import CharEnumFieldInstance
28
28
 
29
29
  from x_auth import types
30
- from x_model.field import DatetimeSecField, UIntField, UInt8Field, UniqBinaryField, UInt1Field, UInt2Field
30
+ from x_model.field import DatetimeSecField, UInt8Field, UniqBinaryField, UInt1Field, UInt2Field
31
31
  from x_model.models import Model, TsTrait
32
32
  from tortoise import Model as TortModel
33
33
  from x_model.types import BaseUpd
@@ -36,7 +36,7 @@ from x_auth.enums import Lang, Role, PeerType
36
36
 
37
37
 
38
38
  class Username(TortModel):
39
- id: int = UIntField(True, description="tg_id")
39
+ id: int = UInt8Field(True, description="tg_id")
40
40
  username: str = CharField(127, null=True)
41
41
  phone = UInt8Field(null=True)
42
42
 
@@ -187,7 +187,7 @@ class Fcm(TortModel):
187
187
 
188
188
 
189
189
  class App(Model):
190
- id: int = UInt1Field(True)
190
+ id: int = IntField(True)
191
191
  hsh = CharField(32, unique=True)
192
192
  dc: ForeignKeyRelation[Dc] = ForeignKeyField("models.Dc", "apps", on_update=CASCADE, default=2)
193
193
  dc_id: int
x_auth/types.py CHANGED
@@ -63,4 +63,4 @@ class TgUser(Xs):
63
63
 
64
64
 
65
65
  class XyncUser(WebAppUser):
66
- pub: bytes
66
+ pub: bytes | None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xn-auth
3
- Version: 0.2.42
3
+ Version: 0.2.44
4
4
  Summary: Auth adapter for XN-Api framework
5
5
  Author-email: Artemiev <mixartemev@gmail.com>
6
6
  License: MIT
@@ -0,0 +1,10 @@
1
+ x_auth/controller.py,sha256=IUUkxkUD8Hup_v34Y1J_DOUq-ZuUUvRVCHe8lo7HCZc,3027
2
+ x_auth/enums.py,sha256=l4NTYsA-h0gyOp4PUe40Lb8LKoA94zL6EDkCmoGmBL0,732
3
+ x_auth/exceptions.py,sha256=2B4okJxhPyNqTJXlSTfblJUQJ60bLGXdgJIu6ue7S6w,162
4
+ x_auth/middleware.py,sha256=JfssQomDv0J_69GfS2a_2_uyRzs26zSY6IW1Vk7m8K0,2900
5
+ x_auth/models.py,sha256=LZhDQkyXDyFj10nliT2k3PohpGkkgoyZr2A3Z56v8iA,9195
6
+ x_auth/types.py,sha256=Ki9oz-Ds0hLK3U7rt_Wg_-pq2huQc6wuwoALtr-JxhU,1407
7
+ xn_auth-0.2.44.dist-info/METADATA,sha256=mDwJd4B8QtbNVk_QArnavKdRTipgLnJdCO9gvHq0Pzc,823
8
+ xn_auth-0.2.44.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
+ xn_auth-0.2.44.dist-info/top_level.txt,sha256=ydMDkzxgQPtW-E_MNDfUAroAFZvWSqU-x_kZSA7NSFo,7
10
+ xn_auth-0.2.44.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- x_auth/controller.py,sha256=KGbXT-hX7Rp6eYZJGx_-ioAr3As73bbKjPhow41c1SE,2973
2
- x_auth/enums.py,sha256=l4NTYsA-h0gyOp4PUe40Lb8LKoA94zL6EDkCmoGmBL0,732
3
- x_auth/exceptions.py,sha256=2B4okJxhPyNqTJXlSTfblJUQJ60bLGXdgJIu6ue7S6w,162
4
- x_auth/middleware.py,sha256=JfssQomDv0J_69GfS2a_2_uyRzs26zSY6IW1Vk7m8K0,2900
5
- x_auth/models.py,sha256=7HzcrTRGGeFs4MDqaGd0qh01tlepEtoUKxt1WHhpb34,9207
6
- x_auth/types.py,sha256=GTjNOm7XkyYDCdIaqByP2LzHnwCJRkWGOwdc4tVWFy0,1400
7
- xn_auth-0.2.42.dist-info/METADATA,sha256=W5-hz5uMWgop6Kbf_ls5gur4_iapZdlpS1NG9OW-jCk,823
8
- xn_auth-0.2.42.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
- xn_auth-0.2.42.dist-info/top_level.txt,sha256=ydMDkzxgQPtW-E_MNDfUAroAFZvWSqU-x_kZSA7NSFo,7
10
- xn_auth-0.2.42.dist-info/RECORD,,