fractal-server 2.3.11__py3-none-any.whl → 2.4.0a0__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.
Files changed (53) hide show
  1. fractal_server/__init__.py +1 -1
  2. fractal_server/__main__.py +25 -2
  3. fractal_server/app/models/__init__.py +11 -5
  4. fractal_server/app/models/linkusergroup.py +11 -0
  5. fractal_server/app/models/security.py +24 -3
  6. fractal_server/app/models/v1/project.py +1 -1
  7. fractal_server/app/models/v2/project.py +3 -3
  8. fractal_server/app/routes/admin/v1.py +14 -14
  9. fractal_server/app/routes/admin/v2.py +12 -12
  10. fractal_server/app/routes/api/__init__.py +2 -2
  11. fractal_server/app/routes/api/v1/_aux_functions.py +2 -2
  12. fractal_server/app/routes/api/v1/dataset.py +17 -15
  13. fractal_server/app/routes/api/v1/job.py +11 -9
  14. fractal_server/app/routes/api/v1/project.py +9 -9
  15. fractal_server/app/routes/api/v1/task.py +8 -8
  16. fractal_server/app/routes/api/v1/task_collection.py +5 -5
  17. fractal_server/app/routes/api/v1/workflow.py +13 -11
  18. fractal_server/app/routes/api/v1/workflowtask.py +6 -6
  19. fractal_server/app/routes/api/v2/_aux_functions.py +2 -2
  20. fractal_server/app/routes/api/v2/dataset.py +11 -11
  21. fractal_server/app/routes/api/v2/images.py +6 -6
  22. fractal_server/app/routes/api/v2/job.py +9 -9
  23. fractal_server/app/routes/api/v2/project.py +7 -7
  24. fractal_server/app/routes/api/v2/status.py +3 -3
  25. fractal_server/app/routes/api/v2/submit.py +3 -3
  26. fractal_server/app/routes/api/v2/task.py +8 -8
  27. fractal_server/app/routes/api/v2/task_collection.py +5 -5
  28. fractal_server/app/routes/api/v2/task_collection_custom.py +3 -3
  29. fractal_server/app/routes/api/v2/task_legacy.py +9 -9
  30. fractal_server/app/routes/api/v2/workflow.py +11 -11
  31. fractal_server/app/routes/api/v2/workflowtask.py +6 -6
  32. fractal_server/app/routes/auth/__init__.py +55 -0
  33. fractal_server/app/routes/auth/_aux_auth.py +107 -0
  34. fractal_server/app/routes/auth/current_user.py +60 -0
  35. fractal_server/app/routes/auth/group.py +173 -0
  36. fractal_server/app/routes/auth/group_names.py +34 -0
  37. fractal_server/app/routes/auth/login.py +25 -0
  38. fractal_server/app/routes/auth/oauth.py +63 -0
  39. fractal_server/app/routes/auth/register.py +23 -0
  40. fractal_server/app/routes/auth/router.py +19 -0
  41. fractal_server/app/routes/auth/users.py +103 -0
  42. fractal_server/app/schemas/user.py +2 -0
  43. fractal_server/app/schemas/user_group.py +57 -0
  44. fractal_server/app/security/__init__.py +72 -68
  45. fractal_server/data_migrations/2_4_0.py +61 -0
  46. fractal_server/main.py +1 -9
  47. fractal_server/migrations/versions/091b01f51f88_add_usergroup_and_linkusergroup_table.py +53 -0
  48. {fractal_server-2.3.11.dist-info → fractal_server-2.4.0a0.dist-info}/METADATA +1 -1
  49. {fractal_server-2.3.11.dist-info → fractal_server-2.4.0a0.dist-info}/RECORD +52 -39
  50. fractal_server/app/routes/auth.py +0 -165
  51. {fractal_server-2.3.11.dist-info → fractal_server-2.4.0a0.dist-info}/LICENSE +0 -0
  52. {fractal_server-2.3.11.dist-info → fractal_server-2.4.0a0.dist-info}/WHEEL +0 -0
  53. {fractal_server-2.3.11.dist-info → fractal_server-2.4.0a0.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,53 @@
1
+ """“Add_usergroup_and_linkusergroup_table”
2
+
3
+ Revision ID: 091b01f51f88
4
+ Revises: 5bf02391cfef
5
+ Create Date: 2024-09-09 13:17:51.008231
6
+
7
+ """
8
+ import sqlalchemy as sa
9
+ import sqlmodel
10
+ from alembic import op
11
+
12
+
13
+ # revision identifiers, used by Alembic.
14
+ revision = "091b01f51f88"
15
+ down_revision = "5bf02391cfef"
16
+ branch_labels = None
17
+ depends_on = None
18
+
19
+
20
+ def upgrade() -> None:
21
+ # ### commands auto generated by Alembic - please adjust! ###
22
+ op.create_table(
23
+ "usergroup",
24
+ sa.Column("id", sa.Integer(), nullable=False),
25
+ sa.Column("name", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
26
+ sa.Column(
27
+ "timestamp_created", sa.DateTime(timezone=True), nullable=False
28
+ ),
29
+ sa.PrimaryKeyConstraint("id"),
30
+ sa.UniqueConstraint("name"),
31
+ )
32
+ op.create_table(
33
+ "linkusergroup",
34
+ sa.Column("group_id", sa.Integer(), nullable=False),
35
+ sa.Column("user_id", sa.Integer(), nullable=False),
36
+ sa.ForeignKeyConstraint(
37
+ ["group_id"],
38
+ ["usergroup.id"],
39
+ ),
40
+ sa.ForeignKeyConstraint(
41
+ ["user_id"],
42
+ ["user_oauth.id"],
43
+ ),
44
+ sa.PrimaryKeyConstraint("group_id", "user_id"),
45
+ )
46
+ # ### end Alembic commands ###
47
+
48
+
49
+ def downgrade() -> None:
50
+ # ### commands auto generated by Alembic - please adjust! ###
51
+ op.drop_table("linkusergroup")
52
+ op.drop_table("usergroup")
53
+ # ### end Alembic commands ###
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fractal-server
3
- Version: 2.3.11
3
+ Version: 2.4.0a0
4
4
  Summary: Server component of the Fractal analytics platform
5
5
  Home-page: https://github.com/fractal-analytics-platform/fractal-server
6
6
  License: BSD-3-Clause
@@ -1,15 +1,16 @@
1
- fractal_server/__init__.py,sha256=XnC28FXELYVd5ZGFyZZAz8ckHNHo1STRoK9q666a8VE,23
2
- fractal_server/__main__.py,sha256=CocbzZooX1UtGqPi55GcHGNxnrJXFg5tUU5b3wyFCyo,4958
1
+ fractal_server/__init__.py,sha256=3YbyR1dRXTwVjPcWPQWD72VIhMYsj-Cqwfmnwjo80JM,24
2
+ fractal_server/__main__.py,sha256=I9hF_SYc-GTZWDZZhihwyUBK7BMU5GAecbPLTjkpW4U,5830
3
3
  fractal_server/alembic.ini,sha256=MWwi7GzjzawI9cCAK1LW7NxIBQDUqD12-ptJoq5JpP0,3153
4
4
  fractal_server/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  fractal_server/app/db/__init__.py,sha256=KpS_mfmRfew0kieFDlwkSrDFvpzxftcvPALBBZ0LxsY,4048
6
- fractal_server/app/models/__init__.py,sha256=QGRjxBgk6GzHyyXh_7RuHvpLoe5PTl1g5KLkGqhFYMQ,199
6
+ fractal_server/app/models/__init__.py,sha256=zt0Tiv91DWLg0daT8bkENz-LusihOJJX1h09UfHlAns,452
7
+ fractal_server/app/models/linkusergroup.py,sha256=ufthlbLFAWMU_dJmsVZzVlQa_D9C9SmgydxypQ2Xq1U,309
7
8
  fractal_server/app/models/linkuserproject.py,sha256=eQaourbGRshvlMVlKzLYJKHEjfsW1CbWws9yW4eHXhA,567
8
- fractal_server/app/models/security.py,sha256=0oYj_cqPcQFsPFDyN4OTsqbXsLlXRcweawjP_iSiRI0,2900
9
+ fractal_server/app/models/security.py,sha256=JGC3NNakIbJWhwksSIgJq0Jawo7m_fhsWX9L-uKpWJc,3551
9
10
  fractal_server/app/models/v1/__init__.py,sha256=hUI7dEbPaiZGN0IbHW4RSmSicyvtn_xeuevoX7zvUwI,466
10
11
  fractal_server/app/models/v1/dataset.py,sha256=99GDgt7njx8yYQApkImqp_7bHA5HH3ElvbR6Oyj9kVI,2017
11
12
  fractal_server/app/models/v1/job.py,sha256=QLGXcWdVRHaUHQNDapYYlLpEfw4K7QyD8TmcwhrWw2o,3304
12
- fractal_server/app/models/v1/project.py,sha256=tf6fniyBH-sb6rBvGiqNl2wgN9ipR4hDEE3OKvxKaoo,804
13
+ fractal_server/app/models/v1/project.py,sha256=JG7b5J9CzVNxua4MaMYpfB57xt2qjbXr5SnR7_oKQ70,819
13
14
  fractal_server/app/models/v1/state.py,sha256=m9gMZqqnm3oDpJNJp-Lht4kM7oO7pcEI7sL1g7LFvWU,1043
14
15
  fractal_server/app/models/v1/task.py,sha256=3xZqNeFYUqslh8ddMSXF2nO4nIiOD8T5Ij37wY20kss,2782
15
16
  fractal_server/app/models/v1/workflow.py,sha256=dnY5eMaOe3oZv8arn00RNX9qVkBtTLG-vYdWXcQuyo4,3950
@@ -17,39 +18,48 @@ fractal_server/app/models/v2/__init__.py,sha256=uLzdInqATSwi0bS_V4vKB-TqFrOFaXux
17
18
  fractal_server/app/models/v2/collection_state.py,sha256=nxb042i8tt8rCpmgbFJoBCYWU-34m0HdUfO9YurTp8k,588
18
19
  fractal_server/app/models/v2/dataset.py,sha256=-7sxHEw4IIAvF_uSan7tA3o8hvoakBkQ0SRvqS2iOQU,1455
19
20
  fractal_server/app/models/v2/job.py,sha256=ypJmN-qspkKBGhBG7Mt-HypSQqcQ2EmB4Bzzb2-y550,1535
20
- fractal_server/app/models/v2/project.py,sha256=CRBnZ8QITNp6u1f5bMxvi1_mcvEfXpWyitsWB5f7gn8,759
21
+ fractal_server/app/models/v2/project.py,sha256=rAHoh5KfYwIaW7rTX0_O0jvWmxEvfo1BafvmcXuSSRk,786
21
22
  fractal_server/app/models/v2/task.py,sha256=Esf2j9c-0pGYjdbb__Ptpdx7NCAKVxqbQMoza524miU,1286
22
23
  fractal_server/app/models/v2/workflow.py,sha256=YBgFGCziUgU0aJ5EM3Svu9W2c46AewZO9VBlFCHiSps,1069
23
24
  fractal_server/app/models/v2/workflowtask.py,sha256=3jEkObsSnlI05Pur_dSsXYdJxRqPL60Z7tK5-EJLOks,1532
24
25
  fractal_server/app/routes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
26
  fractal_server/app/routes/admin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
- fractal_server/app/routes/admin/v1.py,sha256=jOBESHtU-RmkxqK3yxsYnea0ecJaeoYEIBPUTU72cMk,13898
27
- fractal_server/app/routes/admin/v2.py,sha256=A8TwuxlhhA1dJZqd5f3lkIYijXK_yKArbR4a5WM2IqM,13659
28
- fractal_server/app/routes/api/__init__.py,sha256=XlJUFd-0FossfyKyJti4dmwY6SMysQn1yiisMrNzgBE,615
27
+ fractal_server/app/routes/admin/v1.py,sha256=GIpZlwAwwwLGDWkBqywhtmp9TGsKLhGmZAdj1TDKJvE,13976
28
+ fractal_server/app/routes/admin/v2.py,sha256=P6ndmwNYfXDW5Xh971hMcmlVyVrGF8ubYS074r4bzok,13727
29
+ fractal_server/app/routes/api/__init__.py,sha256=2IDheFi0OFdsUg7nbUiyahqybvpgXqeHUXIL2QtWrQQ,641
29
30
  fractal_server/app/routes/api/v1/__init__.py,sha256=Y2HQdG197J0a7DyQEE2jn53IfxD0EHGhzK1I2JZuEck,958
30
- fractal_server/app/routes/api/v1/_aux_functions.py,sha256=hDBo2nBW04k3NKYCvrwO0T1FwzJQuMi2QfLNDDEek90,13000
31
- fractal_server/app/routes/api/v1/dataset.py,sha256=Yz3La_Vl6lUPRtAEMX730zNXal1D_8n1l0jQf8lWQSI,17167
32
- fractal_server/app/routes/api/v1/job.py,sha256=Ulec7Ik_wJkkapcLnMB1jlDf1Mt3r5BMu9cKKaKs9ZI,5285
33
- fractal_server/app/routes/api/v1/project.py,sha256=_zuaT2w6yTGP6YKjpY7UIlz7RxydJEaQO5PIaISUEfk,16289
34
- fractal_server/app/routes/api/v1/task.py,sha256=-dWV-xrLm25dQa8DXncFK4v3jBb00Yi0s6MoH1EyzTQ,6277
35
- fractal_server/app/routes/api/v1/task_collection.py,sha256=qWYaHmAg35coHBS5GOieMPWQfyjG_IrM5qA_wL4lv5k,8996
36
- fractal_server/app/routes/api/v1/workflow.py,sha256=0mvooYkLipblhDEzuaYtABstidLDSms30GENtsc2LlY,11122
37
- fractal_server/app/routes/api/v1/workflowtask.py,sha256=SogMLhpqUtW6QO008mOAIncfu9xP-7R0wC1GnQsY_4s,5729
31
+ fractal_server/app/routes/api/v1/_aux_functions.py,sha256=1YZdLch-Q1c44hQ_1ZEiijgWhLW6H3QEL5y5SHw5Ijk,13023
32
+ fractal_server/app/routes/api/v1/dataset.py,sha256=KVfKdp-bT8eB14kCjTSmpji4a2IPIHxGID8L10h3Wac,17282
33
+ fractal_server/app/routes/api/v1/job.py,sha256=0jGxvu0xNQnWuov2qnoo9yE7Oat37XbcVn4Ute-UsiE,5370
34
+ fractal_server/app/routes/api/v1/project.py,sha256=mFDqhkd_zR3wqxW5zadCCrxIX-jgL3lYF3CtfbV4pPs,16373
35
+ fractal_server/app/routes/api/v1/task.py,sha256=OLASM6M4yfHvQgHQOuR5810jR2s0_W1HQAmhGQkg0so,6356
36
+ fractal_server/app/routes/api/v1/task_collection.py,sha256=VYxhtd_idBppgJM7-FCHikI2OKMAIz05fhV_TsJpWI8,9060
37
+ fractal_server/app/routes/api/v1/workflow.py,sha256=2T93DuEnSshaDCue-JPmjuvGCtbk6lt9pFMuPt783t8,11217
38
+ fractal_server/app/routes/api/v1/workflowtask.py,sha256=OYYConwJbmNULDw5I3T-UbSJKrbbBiAHbbBeVcpoFKQ,5785
38
39
  fractal_server/app/routes/api/v2/__init__.py,sha256=JrPWfKIJy9btRCP-zw2nZwLpSdBxEKY5emuCuJbqG0s,1813
39
- fractal_server/app/routes/api/v2/_aux_functions.py,sha256=yeA0650pBk43M5ZQGpVQ17nH5D97NIGY-3tNNLQIW1M,14901
40
- fractal_server/app/routes/api/v2/dataset.py,sha256=_HjKNP9XsMGoqyubGdF2ZyeW7vXC3VdK_0_TaUxgIF0,8248
41
- fractal_server/app/routes/api/v2/images.py,sha256=4r_HblPWyuKSZSJZfn8mbDaLv1ncwZU0gWdKneZcNG4,7894
42
- fractal_server/app/routes/api/v2/job.py,sha256=EUoM-cg9761uY0W1B8B0ZhQYb_g6JwS8GdNepRub40k,5086
43
- fractal_server/app/routes/api/v2/project.py,sha256=U4TxD-J4TtQuu1D4BOhL1kTse5fCiNc3BwGH7bnlo38,6592
44
- fractal_server/app/routes/api/v2/status.py,sha256=osLexiMOSqmYcEV-41tlrwt9ofyFbtRm5HmPS5BU0t4,6394
45
- fractal_server/app/routes/api/v2/submit.py,sha256=Oqggq3GeBrUsE535tmw-JsRZEWa7jziU34fKdlj4QUE,8734
46
- fractal_server/app/routes/api/v2/task.py,sha256=bRTtGgL8BBGbT7csVeRB-a54clgU2xHydi5XpcByDxg,8297
47
- fractal_server/app/routes/api/v2/task_collection.py,sha256=BiZ5s6DwdQbM79s_dPivgoxvNJC3Dzfa4iR3N6A7xfE,12273
48
- fractal_server/app/routes/api/v2/task_collection_custom.py,sha256=cvZorN_Xt57Rj-2JATRrdtSw6I_5befB0ua3FWh6hW4,5988
49
- fractal_server/app/routes/api/v2/task_legacy.py,sha256=P_VJv9v0yzFUBuS-DQHhMVSOe20ecGJJcFBqiiFciOM,1628
50
- fractal_server/app/routes/api/v2/workflow.py,sha256=2GlcYNjpvCdjwC_Kn7y0UP16B3pOLSNXBvIVsVDtDKM,11863
51
- fractal_server/app/routes/api/v2/workflowtask.py,sha256=l_eQPniK1zR0u249bJj4c2hFlyDwsSJgsFR6hxJaOjs,8007
52
- fractal_server/app/routes/auth.py,sha256=Xv80iqdyfY3lyicYs2Y8B6zEDEnyUu_H6_6psYtv3R4,4885
40
+ fractal_server/app/routes/api/v2/_aux_functions.py,sha256=sm__AJvEQfRYlh47uYMJ7PjSrmwz5LjjZMTcJdvhuVE,14924
41
+ fractal_server/app/routes/api/v2/dataset.py,sha256=Eilf_BAGjicIhqUiVwI86jlW45ineA5sVzxXW4b2GoQ,8329
42
+ fractal_server/app/routes/api/v2/images.py,sha256=JR1rR6qEs81nacjriOXAOBQjAbCXF4Ew7M7mkWdxBU0,7920
43
+ fractal_server/app/routes/api/v2/job.py,sha256=Bga2Kz1OjvDIdxZObWaaXVhNIhC_5JKhKRjEH2_ayEE,5157
44
+ fractal_server/app/routes/api/v2/project.py,sha256=eWYFJ7F2ZYQcpi-_n-rhPF-Q4gJhzYBsVGYFhHZZXAE,6653
45
+ fractal_server/app/routes/api/v2/status.py,sha256=6N9DSZ4iFqbZImorWfEAPoyoFUgEruo4Hweqo0x0xXU,6435
46
+ fractal_server/app/routes/api/v2/submit.py,sha256=iTGCYbxiZNszHQa8r3gmAR4QcF6QhVrb8ktzste2Ovc,8775
47
+ fractal_server/app/routes/api/v2/task.py,sha256=XgRnGBvSoI9VNJHtWZQ2Ide99f6elo7a2FN3GQkf0dU,8376
48
+ fractal_server/app/routes/api/v2/task_collection.py,sha256=wEwP8VfsxhKPZ6K3v1Bnput_Zw0Cjhlaal0-e50feIQ,12337
49
+ fractal_server/app/routes/api/v2/task_collection_custom.py,sha256=6MW-l7xTCTbWKDSYDw8e_hnm5jFCJpgFL3UdvrHAaBk,6029
50
+ fractal_server/app/routes/api/v2/task_legacy.py,sha256=GjW0lpX51b64-LCg2EtCO3Ik6Yx4eTqgbtspXh-K_4k,1744
51
+ fractal_server/app/routes/api/v2/workflow.py,sha256=8rir-alW5KjS6_HIkYFPkJcm3BouAFsKboKqGu8HSqo,11944
52
+ fractal_server/app/routes/api/v2/workflowtask.py,sha256=HoHFnVRDa0Cw1oqTea1Of6A5ZhjGJeSTDTdI-SKP7Co,8063
53
+ fractal_server/app/routes/auth/__init__.py,sha256=fao6CS0WiAjHDTvBzgBVV_bSXFpEAeDBF6Z6q7rRkPc,1658
54
+ fractal_server/app/routes/auth/_aux_auth.py,sha256=Kpgiw5q1eiCYLFkfhTT7XJGBu1d08YM71CEHhNtfJ5g,3126
55
+ fractal_server/app/routes/auth/current_user.py,sha256=LK0Z13NgaXYQ3FaQ3MNec0p2RRiKxKN31XIt2g9mcGk,2003
56
+ fractal_server/app/routes/auth/group.py,sha256=ZVXeUisf0gUzHXHMINbaPXwXnzXtbcX01AuWXBvNdrA,4871
57
+ fractal_server/app/routes/auth/group_names.py,sha256=zvYDfhxKlDmbSr-oLXYy6WUVkPPTvzH6ZJtuoNdGZbE,960
58
+ fractal_server/app/routes/auth/login.py,sha256=tSu6OBLOieoBtMZB4JkBAdEgH2Y8KqPGSbwy7NIypIo,566
59
+ fractal_server/app/routes/auth/oauth.py,sha256=AnFHbjqL2AgBX3eksI931xD6RTtmbciHBEuGf9YJLjU,1895
60
+ fractal_server/app/routes/auth/register.py,sha256=DlHq79iOvGd_gt2v9uwtsqIKeO6i_GKaW59VIkllPqY,587
61
+ fractal_server/app/routes/auth/router.py,sha256=zWoZWiO69U48QFQf5tLRYQDWu8PUCj7GacnaFeW1n_I,618
62
+ fractal_server/app/routes/auth/users.py,sha256=G9lFJ5zk-lAXDT1oDXXS66B_AxIlfnG35Sg7U44BdU4,3171
53
63
  fractal_server/app/routes/aux/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
64
  fractal_server/app/routes/aux/_job.py,sha256=q-RCiW17yXnZKAC_0La52RLvhqhxuvbgQJ2MlGXOj8A,702
55
65
  fractal_server/app/routes/aux/_runner.py,sha256=FdCVla5DxGAZ__aB7Z8dEJzD_RIeh5tftjrPyqkr8N8,895
@@ -116,7 +126,8 @@ fractal_server/app/runner/v2/v1_compat.py,sha256=t0ficzAHUFaaeI56nqTb4YEKxfARF7L
116
126
  fractal_server/app/runner/versions.py,sha256=dSaPRWqmFPHjg20kTCHmi_dmGNcCETflDtDLronNanU,852
117
127
  fractal_server/app/schemas/__init__.py,sha256=jiIf54owztXupv3PO6Ilh0qcrkh2RUzKq4bcEFqEfc4,40
118
128
  fractal_server/app/schemas/_validators.py,sha256=1dTOYr1IZykrxuQSV2-zuEMZbKe_nGwrfS7iUrsh-sE,3461
119
- fractal_server/app/schemas/user.py,sha256=rE8WgBz-ceVUs0Sz2ZwcjUrSTZTnS0ys5SBtD2XD9r8,3113
129
+ fractal_server/app/schemas/user.py,sha256=ImNoZH7uqDkFuajVd0h9cDzJQ7D9YwYkluNuWtpk5_o,3199
130
+ fractal_server/app/schemas/user_group.py,sha256=CgW38Ett-DuRvN4tFEjG1jfX1csCFJIhVu5mjVlGEyI,1262
120
131
  fractal_server/app/schemas/v1/__init__.py,sha256=CrBGgBhoemCvmZ70ZUchM-jfVAICnoa7AjZBAtL2UB0,1852
121
132
  fractal_server/app/schemas/v1/applyworkflow.py,sha256=uuIh7fHlHEL4yLqL-dePI6-nfCsqgBYATmht7w_KITw,4302
122
133
  fractal_server/app/schemas/v1/dataset.py,sha256=n71lNUO3JLy2K3IM9BZM2Fk1EnKQOTU7pm2s2rJ1FGY,3444
@@ -138,18 +149,20 @@ fractal_server/app/schemas/v2/task.py,sha256=7IfxiZkaVqlARy7WYE_H8m7j_IEcuQaZORU
138
149
  fractal_server/app/schemas/v2/task_collection.py,sha256=8PG1bOqkfQqORMN0brWf6mHDmijt0bBW-mZsF7cSxUs,6129
139
150
  fractal_server/app/schemas/v2/workflow.py,sha256=Zzx3e-qgkH8le0FUmAx9UrV5PWd7bj14PPXUh_zgZXM,1827
140
151
  fractal_server/app/schemas/v2/workflowtask.py,sha256=atVuVN4aXsVEOmSd-vyg-8_8OnPmqx-gT75rXcn_AlQ,6552
141
- fractal_server/app/security/__init__.py,sha256=2-QbwuR-nsuHM_uwKS_WzYvkhnuhO5jUv8UVROetyVk,11169
152
+ fractal_server/app/security/__init__.py,sha256=a-UEm1bdjgxLt88wmMyurf3X64UwxVw57yM9I8I2JYg,11687
142
153
  fractal_server/config.py,sha256=R0VezSe2PEDjQjHEX2V29A1jMdoomdyECBjWNY15v_0,25049
154
+ fractal_server/data_migrations/2_4_0.py,sha256=T1HRRWp9ZuXeVfBY6NRGxQ8aNIHVSftOMnB-CMrfvi8,2117
143
155
  fractal_server/data_migrations/README.md,sha256=_3AEFvDg9YkybDqCLlFPdDmGJvr6Tw7HRI14aZ3LOIw,398
144
156
  fractal_server/gunicorn_fractal.py,sha256=u6U01TLGlXgq1v8QmEpLih3QnsInZD7CqphgJ_GrGzc,1230
145
157
  fractal_server/images/__init__.py,sha256=xO6jTLE4EZKO6cTDdJsBmK9cdeh9hFTaSbSuWgQg7y4,196
146
158
  fractal_server/images/models.py,sha256=9ipU5h4N6ogBChoB-2vHoqtL0TXOHCv6kRR-fER3mkM,4167
147
159
  fractal_server/images/tools.py,sha256=gxeniYy4Z-cp_ToK2LHPJUTVVUUrdpogYdcBUvBuLiY,2209
148
160
  fractal_server/logger.py,sha256=56wfka6fHaa3Rx5qO009nEs_y8gx5wZ2NUNZZ1I-uvc,5130
149
- fractal_server/main.py,sha256=Kmty1C9jPfH101nP3b82u9H9QvT-5Z-8Dd60wf9S5h0,5298
161
+ fractal_server/main.py,sha256=NUvMd8C8kosulAcQ8pCFLnOGdLw7j-6RzcHxoNvSB7k,5003
150
162
  fractal_server/migrations/README,sha256=4rQvyDfqodGhpJw74VYijRmgFP49ji5chyEemWGHsuw,59
151
163
  fractal_server/migrations/env.py,sha256=Bvg-FJzRJZIH_wqS_ZyZNXANIaathjo22_IY7c3fCjo,2636
152
164
  fractal_server/migrations/script.py.mako,sha256=oMXw9LC3zRbinWWPPDgeZ4z9FJrV2zhRWiYdS5YgNbI,526
165
+ fractal_server/migrations/versions/091b01f51f88_add_usergroup_and_linkusergroup_table.py,sha256=BtcSkXsY7ZHNmwV93bSTiDw-wuxpfL7xpbZ5zH-nLnA,1456
153
166
  fractal_server/migrations/versions/4c308bcaea2b_add_task_args_schema_and_task_args_.py,sha256=-wHe-fOffmYeAm0JXVl_lxZ7hhDkaEVqxgxpHkb_uL8,954
154
167
  fractal_server/migrations/versions/4cedeb448a53_workflowtask_foreign_keys_not_nullables.py,sha256=Mob8McGYAcmgvrseyyYOa54E6Gsgr-4SiGdC-r9O4_A,1157
155
168
  fractal_server/migrations/versions/50a13d6138fd_initial_schema.py,sha256=zwXegXs9J40eyCWi3w0c_iIBVJjXNn4VdVnQaT3KxDg,8770
@@ -194,8 +207,8 @@ fractal_server/tasks/v2/utils.py,sha256=JOyCacb6MNvrwfLNTyLwcz8y79J29YuJeJ2MK5kq
194
207
  fractal_server/urls.py,sha256=5o_qq7PzKKbwq12NHSQZDmDitn5RAOeQ4xufu-2v9Zk,448
195
208
  fractal_server/utils.py,sha256=b7WwFdcFZ8unyT65mloFToYuEDXpQoHRcmRNqrhd_dQ,2115
196
209
  fractal_server/zip_tools.py,sha256=xYpzBshysD2nmxkD5WLYqMzPYUcCRM3kYy-7n9bJL-U,4426
197
- fractal_server-2.3.11.dist-info/LICENSE,sha256=QKAharUuhxL58kSoLizKJeZE3mTCBnX6ucmz8W0lxlk,1576
198
- fractal_server-2.3.11.dist-info/METADATA,sha256=OTZ6bXsdRBt9122GdJpYhcuq4Jm5gjM6nHlPX-S1Ho8,4629
199
- fractal_server-2.3.11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
200
- fractal_server-2.3.11.dist-info/entry_points.txt,sha256=8tV2kynvFkjnhbtDnxAqImL6HMVKsopgGfew0DOp5UY,58
201
- fractal_server-2.3.11.dist-info/RECORD,,
210
+ fractal_server-2.4.0a0.dist-info/LICENSE,sha256=QKAharUuhxL58kSoLizKJeZE3mTCBnX6ucmz8W0lxlk,1576
211
+ fractal_server-2.4.0a0.dist-info/METADATA,sha256=sZdr0mUMZvRpXhgArOMw16lfa282uBrl90dY_7QG4WU,4630
212
+ fractal_server-2.4.0a0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
213
+ fractal_server-2.4.0a0.dist-info/entry_points.txt,sha256=8tV2kynvFkjnhbtDnxAqImL6HMVKsopgGfew0DOp5UY,58
214
+ fractal_server-2.4.0a0.dist-info/RECORD,,
@@ -1,165 +0,0 @@
1
- """
2
- Definition of `/auth` routes.
3
- """
4
- from fastapi import APIRouter
5
- from fastapi import Depends
6
- from fastapi import HTTPException
7
- from fastapi import status
8
- from fastapi_users import exceptions
9
- from fastapi_users import schemas
10
- from fastapi_users.router.common import ErrorCode
11
- from sqlalchemy.ext.asyncio import AsyncSession
12
- from sqlmodel import select
13
-
14
- from ...config import get_settings
15
- from ...syringe import Inject
16
- from ..db import get_async_db
17
- from ..models.security import UserOAuth as User
18
- from ..schemas.user import UserCreate
19
- from ..schemas.user import UserRead
20
- from ..schemas.user import UserUpdate
21
- from ..schemas.user import UserUpdateStrict
22
- from ..security import cookie_backend
23
- from ..security import current_active_superuser
24
- from ..security import current_active_user
25
- from ..security import fastapi_users
26
- from ..security import get_user_manager
27
- from ..security import token_backend
28
- from ..security import UserManager
29
-
30
- router_auth = APIRouter()
31
-
32
- router_auth.include_router(
33
- fastapi_users.get_auth_router(token_backend),
34
- prefix="/token",
35
- )
36
- router_auth.include_router(
37
- fastapi_users.get_auth_router(cookie_backend),
38
- )
39
- router_auth.include_router(
40
- fastapi_users.get_register_router(UserRead, UserCreate),
41
- dependencies=[Depends(current_active_superuser)],
42
- )
43
-
44
- users_router = fastapi_users.get_users_router(UserRead, UserUpdate)
45
-
46
- # We remove `/auth/users/me` endpoints to implement our own
47
- # at `/auth/current-user/`.
48
- # We also remove `DELETE /auth/users/{user_id}`
49
- # (ref https://github.com/fastapi-users/fastapi-users/discussions/606)
50
- users_router.routes = [
51
- route
52
- for route in users_router.routes
53
- if route.name
54
- not in [
55
- "users:current_user",
56
- "users:delete_user",
57
- "users:patch_current_user",
58
- ]
59
- ]
60
- router_auth.include_router(
61
- users_router,
62
- prefix="/users",
63
- dependencies=[Depends(current_active_superuser)],
64
- )
65
-
66
-
67
- @router_auth.patch("/current-user/", response_model=UserRead)
68
- async def patch_current_user(
69
- user_update: UserUpdateStrict,
70
- current_user: User = Depends(current_active_user),
71
- user_manager: UserManager = Depends(get_user_manager),
72
- ):
73
-
74
- update = UserUpdate(**user_update.dict(exclude_unset=True))
75
-
76
- try:
77
- user = await user_manager.update(update, current_user, safe=True)
78
- except exceptions.InvalidPasswordException as e:
79
- raise HTTPException(
80
- status_code=status.HTTP_400_BAD_REQUEST,
81
- detail={
82
- "code": ErrorCode.UPDATE_USER_INVALID_PASSWORD,
83
- "reason": e.reason,
84
- },
85
- )
86
- return schemas.model_validate(User, user)
87
-
88
-
89
- @router_auth.get("/current-user/", response_model=UserRead)
90
- async def get_current_user(user: User = Depends(current_active_user)):
91
- """
92
- Return current user
93
- """
94
- return user
95
-
96
-
97
- @router_auth.get("/users/", response_model=list[UserRead])
98
- async def list_users(
99
- user: User = Depends(current_active_superuser),
100
- db: AsyncSession = Depends(get_async_db),
101
- ):
102
- """
103
- Return list of all users
104
- """
105
- stm = select(User)
106
- res = await db.execute(stm)
107
- user_list = res.scalars().unique().all()
108
- await db.close()
109
- return user_list
110
-
111
-
112
- # OAUTH CLIENTS
113
-
114
- # NOTE: settings.OAUTH_CLIENTS are collected by
115
- # Settings.collect_oauth_clients(). If no specific client is specified in the
116
- # environment variables (e.g. by setting OAUTH_FOO_CLIENT_ID and
117
- # OAUTH_FOO_CLIENT_SECRET), this list is empty
118
-
119
- # FIXME:Dependency injection should be wrapped within a function call to make
120
- # it truly lazy. This function could then be called on startup of the FastAPI
121
- # app (cf. fractal_server.main)
122
- settings = Inject(get_settings)
123
-
124
- for client_config in settings.OAUTH_CLIENTS_CONFIG:
125
-
126
- client_name = client_config.CLIENT_NAME.lower()
127
-
128
- if client_name == "google":
129
- from httpx_oauth.clients.google import GoogleOAuth2
130
-
131
- client = GoogleOAuth2(
132
- client_config.CLIENT_ID, client_config.CLIENT_SECRET
133
- )
134
- elif client_name == "github":
135
- from httpx_oauth.clients.github import GitHubOAuth2
136
-
137
- client = GitHubOAuth2(
138
- client_config.CLIENT_ID, client_config.CLIENT_SECRET
139
- )
140
- else:
141
- from httpx_oauth.clients.openid import OpenID
142
-
143
- client = OpenID(
144
- client_config.CLIENT_ID,
145
- client_config.CLIENT_SECRET,
146
- client_config.OIDC_CONFIGURATION_ENDPOINT,
147
- )
148
-
149
- router_auth.include_router(
150
- fastapi_users.get_oauth_router(
151
- client,
152
- cookie_backend,
153
- settings.JWT_SECRET_KEY,
154
- is_verified_by_default=False,
155
- associate_by_email=True,
156
- redirect_url=client_config.REDIRECT_URL,
157
- ),
158
- prefix=f"/{client_name}",
159
- )
160
-
161
-
162
- # Add trailing slash to all routes' paths
163
- for route in router_auth.routes:
164
- if not route.path.endswith("/"):
165
- route.path = f"{route.path}/"