reyserver 1.1.68__py3-none-any.whl → 1.1.70__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.
Potentially problematic release.
This version of reyserver might be problematic. Click here for more details.
- reyserver/rauth.py +7 -6
- reyserver/rfile.py +1 -1
- reyserver/rserver.py +4 -3
- {reyserver-1.1.68.dist-info → reyserver-1.1.70.dist-info}/METADATA +1 -1
- reyserver-1.1.70.dist-info/RECORD +11 -0
- reyserver-1.1.68.dist-info/RECORD +0 -11
- {reyserver-1.1.68.dist-info → reyserver-1.1.70.dist-info}/WHEEL +0 -0
- {reyserver-1.1.68.dist-info → reyserver-1.1.70.dist-info}/licenses/LICENSE +0 -0
reyserver/rauth.py
CHANGED
|
@@ -78,7 +78,7 @@ class DatabaseORMTableUser(rorm.Table):
|
|
|
78
78
|
create_time: rorm.Datetime = rorm.Field(field_default=':create_time', not_null=True, index_n=True, comment='Record create time.')
|
|
79
79
|
update_time: rorm.Datetime = rorm.Field(field_default=':update_time', not_null=True, index_n=True, comment='Record update time.')
|
|
80
80
|
user_id: int = rorm.Field(rorm.types_mysql.MEDIUMINT(unsigned=True), key_auto=True, comment='User ID.')
|
|
81
|
-
name: str = rorm.Field(rorm.types.VARCHAR(50), not_null=True, index_u=True, comment='User name.')
|
|
81
|
+
name: str = rorm.Field(rorm.types.VARCHAR(50), not_null=True, index_u=True, comment='User name, use lowercase letters.')
|
|
82
82
|
password: str = rorm.Field(rorm.types.CHAR(60), not_null=True, comment='User password, encrypted with "bcrypt".')
|
|
83
83
|
email: rorm.Email = rorm.Field(rorm.types.VARCHAR(255), index_u=True, comment='User email.')
|
|
84
84
|
phone: str = rorm.Field(rorm.types.CHAR(11), index_u=True, comment='User phone.')
|
|
@@ -328,6 +328,7 @@ async def get_user_data(
|
|
|
328
328
|
"""
|
|
329
329
|
|
|
330
330
|
# Parameters.
|
|
331
|
+
database = conn.engine.database
|
|
331
332
|
if filter_invalid:
|
|
332
333
|
sql_where = (
|
|
333
334
|
' WHERE (\n'
|
|
@@ -353,28 +354,28 @@ async def get_user_data(
|
|
|
353
354
|
" GROUP_CONCAT(DISTINCT `perm`.`api` SEPARATOR ';') AS `perm_apis`\n"
|
|
354
355
|
'FROM (\n'
|
|
355
356
|
' SELECT `create_time`, `update_time`, `user_id`, `password`, `name`, `email`, `phone`, `avatar`\n'
|
|
356
|
-
' FROM `
|
|
357
|
+
f' FROM `{database}`.`user`\n'
|
|
357
358
|
f'{sql_where}'
|
|
358
359
|
' LIMIT 1\n'
|
|
359
360
|
') as `user`\n'
|
|
360
361
|
'LEFT JOIN (\n'
|
|
361
362
|
' SELECT `user_id`, `role_id`\n'
|
|
362
|
-
' FROM `
|
|
363
|
+
' FROM `{database}`.`user_role`\n'
|
|
363
364
|
') as `user_role`\n'
|
|
364
365
|
'ON `user_role`.`user_id` = `user`.`user_id`\n'
|
|
365
366
|
'LEFT JOIN (\n'
|
|
366
367
|
' SELECT `role_id`, `name`\n'
|
|
367
|
-
' FROM `
|
|
368
|
+
' FROM `{database}`.`role`\n'
|
|
368
369
|
') AS `role`\n'
|
|
369
370
|
'ON `user_role`.`role_id` = `role`.`role_id`\n'
|
|
370
371
|
'LEFT JOIN (\n'
|
|
371
372
|
' SELECT `role_id`, `perm_id`\n'
|
|
372
|
-
' FROM `
|
|
373
|
+
' FROM `{database}`.`role_perm`\n'
|
|
373
374
|
') as `role_perm`\n'
|
|
374
375
|
'ON `role_perm`.`role_id` = `role`.`role_id`\n'
|
|
375
376
|
'LEFT JOIN (\n'
|
|
376
377
|
" SELECT `perm_id`, `name`, `api`\n"
|
|
377
|
-
' FROM `
|
|
378
|
+
' FROM `{database}`.`perm`\n'
|
|
378
379
|
') AS `perm`\n'
|
|
379
380
|
'ON `role_perm`.`perm_id` = `perm`.`perm_id`\n'
|
|
380
381
|
'GROUP BY `user_id`'
|
reyserver/rfile.py
CHANGED
reyserver/rserver.py
CHANGED
|
@@ -23,6 +23,7 @@ from fastapi.middleware.trustedhost import TrustedHostMiddleware
|
|
|
23
23
|
from fastapi.middleware.httpsredirect import HTTPSRedirectMiddleware
|
|
24
24
|
from reydb import DatabaseAsync
|
|
25
25
|
from reykit.rbase import CoroutineFunctionSimple, Singleton, throw
|
|
26
|
+
from reykit.ros import FileStore
|
|
26
27
|
from reykit.rrand import randchar
|
|
27
28
|
|
|
28
29
|
from .rbase import ServerBase, Bind
|
|
@@ -103,8 +104,8 @@ class Server(ServerBase, Singleton):
|
|
|
103
104
|
'Authentication API JWT encryption key.'
|
|
104
105
|
self.api_auth_sess_seconds: int
|
|
105
106
|
'Authentication API session valid seconds.'
|
|
106
|
-
self.
|
|
107
|
-
'File API store
|
|
107
|
+
self.api_file_store: FileStore
|
|
108
|
+
'File API store instance.'
|
|
108
109
|
|
|
109
110
|
# Filter warning.
|
|
110
111
|
self.__filter_warning()
|
|
@@ -400,7 +401,7 @@ class Server(ServerBase, Singleton):
|
|
|
400
401
|
build_db_file(engine)
|
|
401
402
|
|
|
402
403
|
# Add.
|
|
403
|
-
self.
|
|
404
|
+
self.api_file_store = FileStore(file_dir)
|
|
404
405
|
self.app.include_router(router_file, tags=['file'], dependencies=(Bind.token,))
|
|
405
406
|
|
|
406
407
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
reyserver/__init__.py,sha256=7GX64p7uI2eetJH9NJ-DTg-8iyQwOsGcviADFJCPxVA,373
|
|
2
|
+
reyserver/rall.py,sha256=riyDRTUsigco_Bee1H4aZFb8IgvjnxdX9qcnVb9i9mE,270
|
|
3
|
+
reyserver/rauth.py,sha256=tKyqUDi-3JloZZYtd__wmUWLcXUsXMrDuFkVZPNYNT4,15213
|
|
4
|
+
reyserver/rbase.py,sha256=OKXZ_VOfPEVgO3oVn6j-pqHjnIbDL0UoZtp8GcN9hzw,8990
|
|
5
|
+
reyserver/rclient.py,sha256=og5YuWm-PODkFn9njBwYQpGlk0j1BfqFuEarlCFSQYI,6229
|
|
6
|
+
reyserver/rfile.py,sha256=tf3zKuKMXFsKUagiUp6plK5I33fBMjtiarVSKGaAZZo,8868
|
|
7
|
+
reyserver/rserver.py,sha256=V-iZX8JohlJNQ8XwZoT8yoUIMgwNwVW77lBvP_pytpU,11381
|
|
8
|
+
reyserver-1.1.70.dist-info/METADATA,sha256=125S3uRvJqiWI1dF1KDRjaSVXZqoX3JqEk_IXjbh0AM,1666
|
|
9
|
+
reyserver-1.1.70.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
10
|
+
reyserver-1.1.70.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
|
11
|
+
reyserver-1.1.70.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
reyserver/__init__.py,sha256=7GX64p7uI2eetJH9NJ-DTg-8iyQwOsGcviADFJCPxVA,373
|
|
2
|
-
reyserver/rall.py,sha256=riyDRTUsigco_Bee1H4aZFb8IgvjnxdX9qcnVb9i9mE,270
|
|
3
|
-
reyserver/rauth.py,sha256=mqyo5FsN4vdW5GRgvZssWcpfku1Dfo_Md8vvoo8JzhU,15122
|
|
4
|
-
reyserver/rbase.py,sha256=OKXZ_VOfPEVgO3oVn6j-pqHjnIbDL0UoZtp8GcN9hzw,8990
|
|
5
|
-
reyserver/rclient.py,sha256=og5YuWm-PODkFn9njBwYQpGlk0j1BfqFuEarlCFSQYI,6229
|
|
6
|
-
reyserver/rfile.py,sha256=6H5_7B9aiA3F56VToQDI9Trarkrl9gcIuFqYyCVCiCU,8877
|
|
7
|
-
reyserver/rserver.py,sha256=L_a92THAZHca1WHdGczoRf-rnIw5-aGcFuAfvhd5r9w,11332
|
|
8
|
-
reyserver-1.1.68.dist-info/METADATA,sha256=9zPRRCTex-TayU1dBN7HqLvmTtKUwTgfwmflXJo0uK4,1666
|
|
9
|
-
reyserver-1.1.68.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
10
|
-
reyserver-1.1.68.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
|
11
|
-
reyserver-1.1.68.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|