fractal-server 2.18.0a9__py3-none-any.whl → 2.18.1__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.
- fractal_server/__init__.py +1 -1
- fractal_server/app/models/linkuserproject.py +3 -15
- fractal_server/app/models/security.py +3 -6
- fractal_server/app/routes/auth/_aux_auth.py +1 -0
- fractal_server/app/routes/auth/viewer_paths.py +1 -1
- fractal_server/migrations/versions/b7477cc98f45_2_18_1.py +50 -0
- {fractal_server-2.18.0a9.dist-info → fractal_server-2.18.1.dist-info}/METADATA +1 -1
- {fractal_server-2.18.0a9.dist-info → fractal_server-2.18.1.dist-info}/RECORD +11 -11
- fractal_server/data_migrations/2_18_0.py +0 -30
- {fractal_server-2.18.0a9.dist-info → fractal_server-2.18.1.dist-info}/WHEEL +0 -0
- {fractal_server-2.18.0a9.dist-info → fractal_server-2.18.1.dist-info}/entry_points.txt +0 -0
- {fractal_server-2.18.0a9.dist-info → fractal_server-2.18.1.dist-info}/licenses/LICENSE +0 -0
fractal_server/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__VERSION__ = "2.18.
|
|
1
|
+
__VERSION__ = "2.18.1"
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
from sqlmodel import BOOLEAN
|
|
2
1
|
from sqlmodel import CheckConstraint
|
|
3
|
-
from sqlmodel import Column
|
|
4
2
|
from sqlmodel import Field
|
|
5
3
|
from sqlmodel import Index
|
|
6
4
|
from sqlmodel import SQLModel
|
|
7
|
-
from sqlmodel import String
|
|
8
5
|
from sqlmodel import column
|
|
9
6
|
|
|
10
7
|
|
|
@@ -18,18 +15,9 @@ class LinkUserProjectV2(SQLModel, table=True):
|
|
|
18
15
|
)
|
|
19
16
|
user_id: int = Field(foreign_key="user_oauth.id", primary_key=True)
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
)
|
|
25
|
-
# TODO-2.18.1 drop server_default
|
|
26
|
-
is_verified: bool = Field(
|
|
27
|
-
sa_column=Column(BOOLEAN, server_default="true", nullable=False)
|
|
28
|
-
)
|
|
29
|
-
# TODO-2.18.1 drop server_default
|
|
30
|
-
permissions: str = Field(
|
|
31
|
-
sa_column=Column(String, server_default="'rwx'", nullable=False)
|
|
32
|
-
)
|
|
18
|
+
is_owner: bool
|
|
19
|
+
is_verified: bool
|
|
20
|
+
permissions: str
|
|
33
21
|
|
|
34
22
|
__table_args__ = (
|
|
35
23
|
Index(
|
|
@@ -75,8 +75,8 @@ class UserOAuth(SQLModel, table=True):
|
|
|
75
75
|
profile_id:
|
|
76
76
|
Foreign key linking the user to a `Profile`. If this is unset,
|
|
77
77
|
the user has no access to the `/api/v2/` endpoints.
|
|
78
|
-
|
|
79
|
-
Absolute
|
|
78
|
+
project_dirs:
|
|
79
|
+
Absolute paths of the user's project directory. This is used (A) as
|
|
80
80
|
a default base folder for the `zarr_dir` of new datasets (where
|
|
81
81
|
the output Zarr are located), and (B) as a folder which is included
|
|
82
82
|
by default in the paths that a user is allowed to stream (if the
|
|
@@ -112,11 +112,8 @@ class UserOAuth(SQLModel, table=True):
|
|
|
112
112
|
ondelete="RESTRICT",
|
|
113
113
|
)
|
|
114
114
|
|
|
115
|
-
# TODO-2.18.1: drop `project_dir`
|
|
116
|
-
project_dir: str | None = Field(default=None, nullable=True)
|
|
117
|
-
# TODO-2.18.1: `project_dirs: list[str] = Field(min_length=1)`
|
|
118
115
|
project_dirs: list[str] = Field(
|
|
119
|
-
sa_column=Column(ARRAY(String), nullable=False
|
|
116
|
+
sa_column=Column(ARRAY(String), nullable=False),
|
|
120
117
|
)
|
|
121
118
|
|
|
122
119
|
slurm_accounts: list[str] = Field(
|
|
@@ -34,7 +34,7 @@ async def get_current_user_allowed_viewer_paths(
|
|
|
34
34
|
LinkUserProjectV2, LinkUserProjectV2.project_id == ProjectV2.id
|
|
35
35
|
)
|
|
36
36
|
.where(LinkUserProjectV2.user_id == current_user.id)
|
|
37
|
-
.where(LinkUserProjectV2.
|
|
37
|
+
.where(LinkUserProjectV2.is_verified.is_(True))
|
|
38
38
|
)
|
|
39
39
|
authorized_paths.extend(res.unique().scalars().all())
|
|
40
40
|
# Note that `project_dirs` and the `db.execute` result may have some
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""2.18.1
|
|
2
|
+
|
|
3
|
+
Revision ID: b7477cc98f45
|
|
4
|
+
Revises: 88270f589c9b
|
|
5
|
+
Create Date: 2025-12-04 14:07:27.954252
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import sqlalchemy as sa
|
|
10
|
+
from alembic import op
|
|
11
|
+
|
|
12
|
+
# revision identifiers, used by Alembic.
|
|
13
|
+
revision = "b7477cc98f45"
|
|
14
|
+
down_revision = "88270f589c9b"
|
|
15
|
+
branch_labels = None
|
|
16
|
+
depends_on = None
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def upgrade() -> None:
|
|
20
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
21
|
+
with op.batch_alter_table("user_oauth", schema=None) as batch_op:
|
|
22
|
+
batch_op.drop_column("project_dir")
|
|
23
|
+
|
|
24
|
+
# ### end Alembic commands ###
|
|
25
|
+
|
|
26
|
+
batch_op.alter_column("project_dirs", server_default=None)
|
|
27
|
+
|
|
28
|
+
with op.batch_alter_table("linkuserprojectv2", schema=None) as batch_op:
|
|
29
|
+
batch_op.alter_column("is_owner", server_default=None)
|
|
30
|
+
batch_op.alter_column("is_verified", server_default=None)
|
|
31
|
+
batch_op.alter_column("permissions", server_default=None)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def downgrade() -> None:
|
|
35
|
+
with op.batch_alter_table("linkuserprojectv2", schema=None) as batch_op:
|
|
36
|
+
batch_op.alter_column("permissions", server_default="rwx")
|
|
37
|
+
batch_op.alter_column("is_verified", server_default="true")
|
|
38
|
+
batch_op.alter_column("is_owner", server_default="true")
|
|
39
|
+
|
|
40
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
41
|
+
with op.batch_alter_table("user_oauth", schema=None) as batch_op:
|
|
42
|
+
batch_op.add_column(
|
|
43
|
+
sa.Column(
|
|
44
|
+
"project_dir", sa.VARCHAR(), autoincrement=False, nullable=True
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
# ### end Alembic commands ###
|
|
49
|
+
|
|
50
|
+
batch_op.alter_column("project_dirs", server_default="{}")
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
fractal_server/__init__.py,sha256=
|
|
1
|
+
fractal_server/__init__.py,sha256=BKsIdxrz9PsV9xvr1HmK94dmxX69wjDyrYRY53MjstQ,23
|
|
2
2
|
fractal_server/__main__.py,sha256=QeKoAgqoiozLJDa8kSVe-Aso1WWgrk1yLUYWS8RxZVM,11405
|
|
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=Otswoi_PlwX1zRhLTFQUKbW9Ho7piRn8dezjq8k-XaU,2834
|
|
6
6
|
fractal_server/app/models/__init__.py,sha256=oglUT1A1lLhXy2GFz3XsQ7wqkyfs3NXRtuNov-gOHXM,368
|
|
7
7
|
fractal_server/app/models/linkusergroup.py,sha256=3KkkE4QIUAlTrBAZs_tVy0pGvAxUAq6yOEjflct_z2M,678
|
|
8
|
-
fractal_server/app/models/linkuserproject.py,sha256=
|
|
9
|
-
fractal_server/app/models/security.py,sha256=
|
|
8
|
+
fractal_server/app/models/linkuserproject.py,sha256=Bk0VzjzG7RbnVnOwrztqxKIPxz_AsUynXVxyMWHCbXA,1109
|
|
9
|
+
fractal_server/app/models/security.py,sha256=Wh25Vk_lTU-qwgwCNn_m5FEfj_dlY-yk5ASsfK_blyQ,4592
|
|
10
10
|
fractal_server/app/models/v2/__init__.py,sha256=xL05Mvdx0dqUFhJf694oPfuqkUQxZbxOkoUgRuNIXl4,949
|
|
11
11
|
fractal_server/app/models/v2/accounting.py,sha256=VNweFARrvY3mj5LI0834Ku061S2aGC61kuVHzi_tZhc,1187
|
|
12
12
|
fractal_server/app/models/v2/dataset.py,sha256=BL5elDU0UXnUSwvuXSO4JeKa9gje0QFerU_LP7sI754,1273
|
|
@@ -61,7 +61,7 @@ fractal_server/app/routes/api/v2/workflow.py,sha256=VR4zdtJpkBcYg6uh8dcVeeV742y3
|
|
|
61
61
|
fractal_server/app/routes/api/v2/workflow_import.py,sha256=mf5u2q9XRDOGa0-gbDmJKNsJj9zbBdzkJvrWRz2CEyY,9646
|
|
62
62
|
fractal_server/app/routes/api/v2/workflowtask.py,sha256=a2RJ4Ln9H9qplQVgPEiifSc5YWIcmqTQW2wZDojEyNA,8254
|
|
63
63
|
fractal_server/app/routes/auth/__init__.py,sha256=RghfjGuu0RTW8RxBCvaePx9KErO4rTkI96XgbtbeSJU,2337
|
|
64
|
-
fractal_server/app/routes/auth/_aux_auth.py,sha256=
|
|
64
|
+
fractal_server/app/routes/auth/_aux_auth.py,sha256=gKdYTWUzxcU44Iep787zReWwdAs4kW5baNDXCPmiKn8,9195
|
|
65
65
|
fractal_server/app/routes/auth/current_user.py,sha256=uDWttWo9isG69Jv1EGnnr2Ki5ZGd0D76jgjVDQMkn8c,3251
|
|
66
66
|
fractal_server/app/routes/auth/group.py,sha256=uR98vdQHH-7BFl-Czj85ESPxT2yQymy4qtagaMrnUPU,6491
|
|
67
67
|
fractal_server/app/routes/auth/login.py,sha256=buVa5Y8T0cd_SW1CqC-zMv-3SfPxGJknf7MYlUyKOl0,567
|
|
@@ -69,7 +69,7 @@ fractal_server/app/routes/auth/oauth.py,sha256=NxrwOWBGPe7hLPEnD66nfWPGMWzDM80LI
|
|
|
69
69
|
fractal_server/app/routes/auth/register.py,sha256=IiUJhgY0ZrTs0RlBRRjoTv4wF5Gb3eXTInFV-dXkpsE,615
|
|
70
70
|
fractal_server/app/routes/auth/router.py,sha256=Zip_fw9qJWtoXWjluznschyrCKb2n_rf3xWarSXMkgI,692
|
|
71
71
|
fractal_server/app/routes/auth/users.py,sha256=5BagdH1dz-ZoXdvTgIo9QWBNFPW3p1pIZfY9BBu4eds,7397
|
|
72
|
-
fractal_server/app/routes/auth/viewer_paths.py,sha256=
|
|
72
|
+
fractal_server/app/routes/auth/viewer_paths.py,sha256=aW1QM4fdCM-WFEOXNf7I7V7_XQuuRrOHvd32nr08Ofs,1618
|
|
73
73
|
fractal_server/app/routes/aux/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
74
|
fractal_server/app/routes/aux/_job.py,sha256=n-UhONvomKyKkQDDqd0lFh2kCMhlCGXpfdMNW39R1E4,644
|
|
75
75
|
fractal_server/app/routes/aux/_runner.py,sha256=-SvcXCVEV7Mb6q4PbbxuTCCruX6sAlR5QGXk9CzBVv8,979
|
|
@@ -105,7 +105,6 @@ fractal_server/config/_email.py,sha256=vMwLHN9-beYp_-up-WkTpeyNUZk4EHwt3N2l6-PYn
|
|
|
105
105
|
fractal_server/config/_main.py,sha256=6splUmAPRD1J9HXkeZ-Vqif7Nw4ljJXIugpvRrcwPeI,2476
|
|
106
106
|
fractal_server/config/_oauth.py,sha256=UTmlFppDZcOQhr3RvkiG5XMqvr54XRAQ_Y-iR0V8N-8,2024
|
|
107
107
|
fractal_server/config/_settings_config.py,sha256=tsyXQOnn9QKCFJD6hRo_dJXlQQyl70DbqgHMJoZ1xnY,144
|
|
108
|
-
fractal_server/data_migrations/2_18_0.py,sha256=GSTs69gLnMJ0XSf59dIOARYu5aP4SSAG5Eid670yCgk,854
|
|
109
108
|
fractal_server/data_migrations/README.md,sha256=_3AEFvDg9YkybDqCLlFPdDmGJvr6Tw7HRI14aZ3LOIw,398
|
|
110
109
|
fractal_server/data_migrations/tools.py,sha256=LeMeASwYGtEqd-3wOLle6WARdTGAimoyMmRbbJl-hAM,572
|
|
111
110
|
fractal_server/exceptions.py,sha256=l6aZDk_6u_9PwDaQSoIFdI40ekpzqOJaxjx5rhW-HVI,141
|
|
@@ -157,6 +156,7 @@ fractal_server/migrations/versions/af1ef1c83c9b_add_accounting_tables.py,sha256=
|
|
|
157
156
|
fractal_server/migrations/versions/af8673379a5c_drop_old_filter_columns.py,sha256=iEqkCJvqpDxRCKD1twh92W_u665OKEGRJqsWflPx8BM,1552
|
|
158
157
|
fractal_server/migrations/versions/b1e7f7a1ff71_task_group_for_pixi.py,sha256=ElHX3KHpEGJoWc-yPS5ZlGNqJ9khONWEe5_Loh78egA,1293
|
|
159
158
|
fractal_server/migrations/versions/b3ffb095f973_json_to_jsonb.py,sha256=fwaqVzGKRwZ4Nz3n_Y29WO6NzLYpa3JWCM8GjiNY9WQ,10036
|
|
159
|
+
fractal_server/migrations/versions/b7477cc98f45_2_18_1.py,sha256=clKGCwh95sWFTeU04KE6ScyuULL3Iugjx4kENvSwTHg,1581
|
|
160
160
|
fractal_server/migrations/versions/bc0e8b3327a7_project_sharing.py,sha256=5h8ogjfQPbKbVwN0-pfh5ixPQSCCYsiVnQoOveUKKUA,2145
|
|
161
161
|
fractal_server/migrations/versions/c90a7c76e996_job_id_in_history_run.py,sha256=CPQNKHqsx22wSY4ylqM8UMhDOWkQeC9eLAHlQQJYSfQ,1102
|
|
162
162
|
fractal_server/migrations/versions/caba9fb1ea5e_drop_useroauth_user_settings_id.py,sha256=7MpunfOBk0LM6u-xrwca8GUHIjinAJZrS9AUT3l62qU,1320
|
|
@@ -268,8 +268,8 @@ fractal_server/types/validators/_workflow_task_arguments_validators.py,sha256=zt
|
|
|
268
268
|
fractal_server/urls.py,sha256=QjIKAC1a46bCdiPMu3AlpgFbcv6a4l3ABcd5xz190Og,471
|
|
269
269
|
fractal_server/utils.py,sha256=-rjg8QTXQcKweXjn0NcmETFs1_uM9PGnbl0Q7c4ERPM,2181
|
|
270
270
|
fractal_server/zip_tools.py,sha256=Uhn-ax4_9g1PJ32BdyaX30hFpAeVOv2tZYTUK-zVn1E,5719
|
|
271
|
-
fractal_server-2.18.
|
|
272
|
-
fractal_server-2.18.
|
|
273
|
-
fractal_server-2.18.
|
|
274
|
-
fractal_server-2.18.
|
|
275
|
-
fractal_server-2.18.
|
|
271
|
+
fractal_server-2.18.1.dist-info/METADATA,sha256=iRsGxaPkJm0dyxgMSpGihfqfAbjZ3l-j3K-LcQR4Qfo,4275
|
|
272
|
+
fractal_server-2.18.1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
273
|
+
fractal_server-2.18.1.dist-info/entry_points.txt,sha256=8tV2kynvFkjnhbtDnxAqImL6HMVKsopgGfew0DOp5UY,58
|
|
274
|
+
fractal_server-2.18.1.dist-info/licenses/LICENSE,sha256=QKAharUuhxL58kSoLizKJeZE3mTCBnX6ucmz8W0lxlk,1576
|
|
275
|
+
fractal_server-2.18.1.dist-info/RECORD,,
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
import sys
|
|
3
|
-
from os.path import normpath
|
|
4
|
-
|
|
5
|
-
from sqlalchemy.orm.attributes import flag_modified
|
|
6
|
-
from sqlmodel import select
|
|
7
|
-
|
|
8
|
-
from fractal_server.app.db import get_sync_db
|
|
9
|
-
from fractal_server.app.models import UserOAuth
|
|
10
|
-
|
|
11
|
-
logging.basicConfig(level=logging.INFO)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def fix_db():
|
|
15
|
-
logging.info("START - fix db")
|
|
16
|
-
|
|
17
|
-
with next(get_sync_db()) as db:
|
|
18
|
-
res = db.execute(select(UserOAuth).order_by(UserOAuth.email))
|
|
19
|
-
user_list = res.scalars().unique().all()
|
|
20
|
-
|
|
21
|
-
for user in user_list:
|
|
22
|
-
logging.info(f"Now handling user {user.email}.")
|
|
23
|
-
if user.project_dirs != []:
|
|
24
|
-
sys.exit(f"Non empty `project_dirs` for User[{user.id}]")
|
|
25
|
-
user.project_dirs.append(normpath(user.project_dir))
|
|
26
|
-
flag_modified(user, "project_dirs")
|
|
27
|
-
|
|
28
|
-
db.commit()
|
|
29
|
-
|
|
30
|
-
logging.info("END - fix db")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|