fractal-server 2.17.0a3__py3-none-any.whl → 2.17.0a5__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 (65) hide show
  1. fractal_server/__init__.py +1 -1
  2. fractal_server/__main__.py +137 -120
  3. fractal_server/app/models/security.py +19 -21
  4. fractal_server/app/models/user_settings.py +1 -0
  5. fractal_server/app/models/v2/task_group.py +1 -0
  6. fractal_server/app/routes/admin/v2/accounting.py +3 -3
  7. fractal_server/app/routes/admin/v2/impersonate.py +2 -2
  8. fractal_server/app/routes/admin/v2/job.py +6 -6
  9. fractal_server/app/routes/admin/v2/profile.py +4 -4
  10. fractal_server/app/routes/admin/v2/project.py +2 -2
  11. fractal_server/app/routes/admin/v2/resource.py +42 -8
  12. fractal_server/app/routes/admin/v2/task.py +2 -2
  13. fractal_server/app/routes/admin/v2/task_group.py +5 -5
  14. fractal_server/app/routes/admin/v2/task_group_lifecycle.py +4 -4
  15. fractal_server/app/routes/api/__init__.py +5 -5
  16. fractal_server/app/routes/api/v2/dataset.py +10 -19
  17. fractal_server/app/routes/api/v2/history.py +8 -8
  18. fractal_server/app/routes/api/v2/images.py +5 -5
  19. fractal_server/app/routes/api/v2/job.py +8 -8
  20. fractal_server/app/routes/api/v2/pre_submission_checks.py +3 -3
  21. fractal_server/app/routes/api/v2/project.py +6 -6
  22. fractal_server/app/routes/api/v2/status_legacy.py +2 -2
  23. fractal_server/app/routes/api/v2/submit.py +24 -26
  24. fractal_server/app/routes/api/v2/task.py +6 -7
  25. fractal_server/app/routes/api/v2/task_collection.py +4 -3
  26. fractal_server/app/routes/api/v2/task_collection_custom.py +4 -3
  27. fractal_server/app/routes/api/v2/task_collection_pixi.py +2 -2
  28. fractal_server/app/routes/api/v2/task_group.py +6 -6
  29. fractal_server/app/routes/api/v2/task_group_lifecycle.py +4 -4
  30. fractal_server/app/routes/api/v2/task_version_update.py +3 -3
  31. fractal_server/app/routes/api/v2/workflow.py +9 -9
  32. fractal_server/app/routes/api/v2/workflow_import.py +2 -2
  33. fractal_server/app/routes/api/v2/workflowtask.py +5 -5
  34. fractal_server/app/routes/auth/__init__.py +34 -5
  35. fractal_server/app/routes/auth/current_user.py +22 -67
  36. fractal_server/app/routes/auth/group.py +8 -35
  37. fractal_server/app/routes/auth/register.py +2 -2
  38. fractal_server/app/routes/auth/users.py +5 -46
  39. fractal_server/app/schemas/__init__.py +0 -1
  40. fractal_server/app/schemas/user.py +23 -0
  41. fractal_server/app/schemas/v2/task_group.py +1 -0
  42. fractal_server/app/security/__init__.py +134 -46
  43. fractal_server/app/security/signup_email.py +52 -34
  44. fractal_server/config/__init__.py +1 -7
  45. fractal_server/config/_email.py +10 -47
  46. fractal_server/config/_main.py +14 -3
  47. fractal_server/migrations/versions/f65ee53991e3_user_settings_related.py +67 -0
  48. fractal_server/runner/config/_slurm.py +3 -2
  49. fractal_server/runner/executors/slurm_common/base_slurm_runner.py +2 -2
  50. fractal_server/runner/executors/slurm_common/get_slurm_config.py +1 -1
  51. fractal_server/runner/executors/slurm_common/slurm_config.py +7 -13
  52. fractal_server/runner/executors/slurm_ssh/runner.py +1 -1
  53. fractal_server/runner/executors/slurm_sudo/runner.py +1 -1
  54. fractal_server/runner/v2/_slurm_ssh.py +2 -1
  55. fractal_server/runner/v2/_slurm_sudo.py +1 -1
  56. fractal_server/runner/v2/submit_workflow.py +12 -12
  57. {fractal_server-2.17.0a3.dist-info → fractal_server-2.17.0a5.dist-info}/METADATA +1 -2
  58. {fractal_server-2.17.0a3.dist-info → fractal_server-2.17.0a5.dist-info}/RECORD +61 -64
  59. fractal_server/app/routes/aux/validate_user_settings.py +0 -76
  60. fractal_server/app/schemas/user_settings.py +0 -63
  61. fractal_server/app/user_settings.py +0 -32
  62. fractal_server/config/_init_data.py +0 -27
  63. {fractal_server-2.17.0a3.dist-info → fractal_server-2.17.0a5.dist-info}/WHEEL +0 -0
  64. {fractal_server-2.17.0a3.dist-info → fractal_server-2.17.0a5.dist-info}/entry_points.txt +0 -0
  65. {fractal_server-2.17.0a3.dist-info → fractal_server-2.17.0a5.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- __VERSION__ = "2.17.0a3"
1
+ __VERSION__ = "2.17.0a5"
@@ -62,14 +62,33 @@ init_db_data_parser = subparsers.add_parser(
62
62
  init_db_data_parser.add_argument(
63
63
  "--resource",
64
64
  type=str,
65
- help=("Either `default` or path to the JSON file of the first resource."),
66
- required=True,
65
+ help="Either `default` or path to the JSON file of the first resource.",
66
+ required=False,
67
67
  )
68
68
  init_db_data_parser.add_argument(
69
69
  "--profile",
70
70
  type=str,
71
- help=("Either `default` or path to the JSON file of the first profile."),
72
- required=True,
71
+ help="Either `default` or path to the JSON file of the first profile.",
72
+ required=False,
73
+ )
74
+ init_db_data_parser.add_argument(
75
+ "--admin-email",
76
+ type=str,
77
+ help="Email of the first admin user.",
78
+ required=False,
79
+ )
80
+ init_db_data_parser.add_argument(
81
+ "--admin-pwd",
82
+ type=str,
83
+ help="Password for the first admin user.",
84
+ required=False,
85
+ )
86
+
87
+ init_db_data_parser.add_argument(
88
+ "--admin-project-dir",
89
+ type=str,
90
+ help="Project_dir for the first admin user.",
91
+ required=False,
73
92
  )
74
93
 
75
94
  # fractalctl update-db-data
@@ -78,15 +97,6 @@ update_db_data_parser = subparsers.add_parser(
78
97
  description="Apply data-migration script to an existing database.",
79
98
  )
80
99
 
81
- # fractalctl encrypt-email-password
82
- encrypt_email_password_parser = subparsers.add_parser(
83
- "encrypt-email-password",
84
- description=(
85
- "Generate valid values for environment variables "
86
- "FRACTAL_EMAIL_PASSWORD and FRACTAL_EMAIL_PASSWORD_KEY."
87
- ),
88
- )
89
-
90
100
 
91
101
  def save_openapi(dest="openapi.json"):
92
102
  from fractal_server.main import start_application
@@ -125,13 +135,14 @@ def set_db():
125
135
 
126
136
  def init_db_data(
127
137
  *,
128
- resource: str,
129
- profile: str,
138
+ resource: str | None = None,
139
+ profile: str | None = None,
140
+ admin_email: str | None = None,
141
+ admin_password: str | None = None,
142
+ admin_project_dir: str | None = None,
130
143
  ) -> None:
131
144
  from fractal_server.app.security import _create_first_user
132
145
  from fractal_server.app.security import _create_first_group
133
- from fractal_server.syringe import Inject
134
- from fractal_server.config import get_init_data_settings
135
146
  from fractal_server.app.db import get_sync_db
136
147
  from sqlalchemy import select, func
137
148
  from fractal_server.app.models.security import UserOAuth
@@ -139,104 +150,120 @@ def init_db_data(
139
150
  from fractal_server.app.schemas.v2.resource import cast_serialize_resource
140
151
  from fractal_server.app.schemas.v2.profile import cast_serialize_profile
141
152
 
142
- init_data_settings = Inject(get_init_data_settings)
143
-
144
153
  # Create default group and user
145
154
  print()
146
155
  _create_first_group()
147
156
  print()
148
- asyncio.run(
149
- _create_first_user(
150
- email=init_data_settings.FRACTAL_DEFAULT_ADMIN_EMAIL,
151
- password=(
152
- init_data_settings.FRACTAL_DEFAULT_ADMIN_PASSWORD.get_secret_value() # noqa E501
153
- ),
154
- is_superuser=True,
155
- is_verified=True,
156
- )
157
- )
158
- print()
159
157
 
160
- # Create resource and profile
161
- with next(get_sync_db()) as db:
162
- # Preliminary check
163
- num_resources = db.execute(select(func.count(Resource.id))).scalar()
164
- if num_resources != 0:
165
- print(f"There exist already {num_resources=} resources. Exit.")
166
- sys.exit(1)
167
-
168
- # Get resource/profile data
169
- if resource == "default":
170
- _python_version = (
171
- f"{sys.version_info.major}.{sys.version_info.minor}"
172
- )
173
- resource_data = {
174
- "name": "Local resource",
175
- "type": ResourceType.LOCAL,
176
- "jobs_local_dir": (Path.cwd() / "data-jobs").as_posix(),
177
- "tasks_local_dir": (Path.cwd() / "data-tasks").as_posix(),
178
- "tasks_python_config": {
179
- "default_version": _python_version,
180
- "versions": {
181
- _python_version: sys.executable,
182
- },
183
- },
184
- "jobs_poll_interval": 0,
185
- "jobs_runner_config": {},
186
- "tasks_pixi_config": {},
187
- }
188
- print("Prepared default resource data.")
189
- else:
190
- with open(resource) as f:
191
- resource_data = json.load(f)
192
- print(f"Read resource data from {resource}.")
193
- if profile == "default":
194
- profile_data = {
195
- "resource_type": "local",
196
- "name": "Local profile",
197
- }
198
- print("Prepared default profile data.")
199
- else:
200
- with open(profile) as f:
201
- profile_data = json.load(f)
202
- print(f"Read profile data from {profile}.")
203
-
204
- # Validate resource/profile data
205
- try:
206
- resource_data = cast_serialize_resource(resource_data)
207
- except ValidationError as e:
208
- sys.exit(
209
- f"ERROR: Invalid resource data.\nOriginal error:\n{str(e)}"
210
- )
211
- try:
212
- profile_data = cast_serialize_profile(profile_data)
213
- except ValidationError as e:
214
- sys.exit(
215
- f"ERROR: Invalid profile data.\nOriginal error:\n{str(e)}"
158
+ # Create admin user if requested
159
+ if not (
160
+ (admin_email is None)
161
+ == (admin_password is None)
162
+ == (admin_project_dir is None)
163
+ ):
164
+ print(
165
+ "You must provide either or or none of `--admin-email`, "
166
+ "`--admin-pwd` and `--admin-project-dir`. Exit."
167
+ )
168
+ sys.exit(1)
169
+ if admin_password and admin_email:
170
+ asyncio.run(
171
+ _create_first_user(
172
+ email=admin_email,
173
+ password=admin_password,
174
+ project_dir=admin_project_dir,
175
+ is_superuser=True,
176
+ is_verified=True,
216
177
  )
217
-
218
- # Create resource/profile db objects
219
- resource_obj = Resource(**resource_data)
220
- db.add(resource_obj)
221
- db.commit()
222
- db.refresh(resource_obj)
223
- profile_data["resource_id"] = resource_obj.id
224
- profile_obj = Profile(**profile_data)
225
- db.add(profile_obj)
226
- db.commit()
227
- db.refresh(profile_obj)
228
-
229
- # Associate profile to users
230
- res = db.execute(select(UserOAuth))
231
- users = res.unique().scalars().all()
232
- for user in users:
233
- print(f"Now set profile_id={profile_obj.id} for {user.email}.")
234
- user.profile_id = profile_obj.id
235
- db.add(user)
236
- db.commit()
237
- db.expunge_all()
178
+ )
238
179
  print()
239
180
 
181
+ # Create resource and profile if requested
182
+ if (resource is None) != (profile is None):
183
+ print("You must provide both --resource and --profile. Exit.")
184
+ sys.exit(1)
185
+ if resource and profile:
186
+ with next(get_sync_db()) as db:
187
+ # Preliminary check
188
+ num_resources = db.execute(
189
+ select(func.count(Resource.id))
190
+ ).scalar()
191
+ if num_resources != 0:
192
+ print(f"There exist already {num_resources=} resources. Exit.")
193
+ sys.exit(1)
194
+
195
+ # Get resource/profile data
196
+ if resource == "default":
197
+ _python_version = (
198
+ f"{sys.version_info.major}.{sys.version_info.minor}"
199
+ )
200
+ resource_data = {
201
+ "name": "Local resource",
202
+ "type": ResourceType.LOCAL,
203
+ "jobs_local_dir": (Path.cwd() / "data-jobs").as_posix(),
204
+ "tasks_local_dir": (Path.cwd() / "data-tasks").as_posix(),
205
+ "tasks_python_config": {
206
+ "default_version": _python_version,
207
+ "versions": {
208
+ _python_version: sys.executable,
209
+ },
210
+ },
211
+ "jobs_poll_interval": 0,
212
+ "jobs_runner_config": {},
213
+ "tasks_pixi_config": {},
214
+ }
215
+ print("Prepared default resource data.")
216
+ else:
217
+ with open(resource) as f:
218
+ resource_data = json.load(f)
219
+ print(f"Read resource data from {resource}.")
220
+ if profile == "default":
221
+ profile_data = {
222
+ "resource_type": "local",
223
+ "name": "Local profile",
224
+ }
225
+ print("Prepared default profile data.")
226
+ else:
227
+ with open(profile) as f:
228
+ profile_data = json.load(f)
229
+ print(f"Read profile data from {profile}.")
230
+
231
+ # Validate resource/profile data
232
+ try:
233
+ resource_data = cast_serialize_resource(resource_data)
234
+ except ValidationError as e:
235
+ sys.exit(
236
+ f"ERROR: Invalid resource data.\nOriginal error:\n{str(e)}"
237
+ )
238
+ try:
239
+ profile_data = cast_serialize_profile(profile_data)
240
+ except ValidationError as e:
241
+ sys.exit(
242
+ f"ERROR: Invalid profile data.\nOriginal error:\n{str(e)}"
243
+ )
244
+
245
+ # Create resource/profile db objects
246
+ resource_obj = Resource(**resource_data)
247
+ db.add(resource_obj)
248
+ db.commit()
249
+ db.refresh(resource_obj)
250
+ profile_data["resource_id"] = resource_obj.id
251
+ profile_obj = Profile(**profile_data)
252
+ db.add(profile_obj)
253
+ db.commit()
254
+ db.refresh(profile_obj)
255
+
256
+ # Associate profile to users
257
+ res = db.execute(select(UserOAuth))
258
+ users = res.unique().scalars().all()
259
+ for user in users:
260
+ print(f"Now set profile_id={profile_obj.id} for {user.email}.")
261
+ user.profile_id = profile_obj.id
262
+ db.add(user)
263
+ db.commit()
264
+ db.expunge_all()
265
+ print()
266
+
240
267
 
241
268
  def update_db_data():
242
269
  """
@@ -306,17 +333,6 @@ def update_db_data():
306
333
  current_update_db_data_module.fix_db()
307
334
 
308
335
 
309
- def print_encrypted_password():
310
- from cryptography.fernet import Fernet
311
-
312
- password = input("Insert email password: ").encode("utf-8")
313
- key = Fernet.generate_key().decode("utf-8")
314
- encrypted_password = Fernet(key).encrypt(password).decode("utf-8")
315
-
316
- print(f"\nFRACTAL_EMAIL_PASSWORD={encrypted_password}")
317
- print(f"FRACTAL_EMAIL_PASSWORD_KEY={key}")
318
-
319
-
320
336
  def run():
321
337
  args = parser.parse_args(sys.argv[1:])
322
338
 
@@ -328,6 +344,9 @@ def run():
328
344
  init_db_data(
329
345
  resource=args.resource,
330
346
  profile=args.profile,
347
+ admin_email=args.admin_email,
348
+ admin_password=args.admin_pwd,
349
+ admin_project_dir=args.admin_project_dir,
331
350
  )
332
351
  elif args.cmd == "update-db-data":
333
352
  update_db_data()
@@ -338,8 +357,6 @@ def run():
338
357
  port=args.port,
339
358
  reload=args.reload,
340
359
  )
341
- elif args.cmd == "encrypt-email-password":
342
- print_encrypted_password()
343
360
  else:
344
361
  sys.exit(f"Error: invalid command '{args.cmd}'.")
345
362
 
@@ -1,27 +1,17 @@
1
- # This is based on fastapi_users_db_sqlmodel
2
- # <https://github.com/fastapi-users/fastapi-users-db-sqlmodel>
3
- # Original Copyright
4
- # Copyright 2022 François Voron
5
- # License: MIT
6
- #
7
- # Modified by:
8
- # Tommaso Comparin <tommaso.comparin@exact-lab.it>
9
- #
10
- # Copyright 2022 (C) Friedrich Miescher Institute for Biomedical Research and
11
- # University of Zurich
12
1
  from datetime import datetime
13
2
  from typing import Optional
14
3
 
15
4
  from pydantic import ConfigDict
16
5
  from pydantic import EmailStr
17
6
  from sqlalchemy import Column
7
+ from sqlalchemy import String
8
+ from sqlalchemy.dialects.postgresql import ARRAY
18
9
  from sqlalchemy.dialects.postgresql import JSONB
19
10
  from sqlalchemy.types import DateTime
20
11
  from sqlmodel import Field
21
12
  from sqlmodel import Relationship
22
13
  from sqlmodel import SQLModel
23
14
 
24
- from .user_settings import UserSettings
25
15
  from fractal_server.utils import get_timestamp
26
16
 
27
17
 
@@ -74,17 +64,20 @@ class UserOAuth(SQLModel, table=True):
74
64
  is_superuser:
75
65
  is_verified:
76
66
  oauth_accounts:
77
- user_settings_id:
78
67
  profile_id:
79
- settings:
68
+ project_dir:
69
+ slurm_accounts:
80
70
  """
81
71
 
72
+ model_config = ConfigDict(from_attributes=True)
73
+
82
74
  __tablename__ = "user_oauth"
83
75
 
84
76
  id: int | None = Field(default=None, primary_key=True)
85
77
 
86
78
  email: EmailStr = Field(
87
- sa_column_kwargs={"unique": True, "index": True}, nullable=False
79
+ sa_column_kwargs={"unique": True, "index": True},
80
+ nullable=False,
88
81
  )
89
82
  hashed_password: str
90
83
  is_active: bool = Field(default=True, nullable=False)
@@ -96,18 +89,23 @@ class UserOAuth(SQLModel, table=True):
96
89
  sa_relationship_kwargs={"lazy": "joined", "cascade": "all, delete"},
97
90
  )
98
91
 
99
- user_settings_id: int | None = Field(
100
- foreign_key="user_settings.id", default=None
101
- )
102
92
  profile_id: int | None = Field(
103
93
  foreign_key="profile.id",
104
94
  default=None,
105
95
  ondelete="SET NULL",
106
96
  )
107
- settings: UserSettings | None = Relationship(
108
- sa_relationship_kwargs=dict(lazy="selectin", cascade="all, delete")
97
+
98
+ # TODO-2.17.1: update to `project_dir: str`
99
+ project_dir: str = Field(
100
+ sa_column=Column(
101
+ String,
102
+ server_default="/PLACEHOLDER",
103
+ nullable=False,
104
+ )
105
+ )
106
+ slurm_accounts: list[str] = Field(
107
+ sa_column=Column(ARRAY(String), server_default="{}"),
109
108
  )
110
- model_config = ConfigDict(from_attributes=True)
111
109
 
112
110
 
113
111
  class UserGroup(SQLModel, table=True):
@@ -4,6 +4,7 @@ from sqlmodel import Field
4
4
  from sqlmodel import SQLModel
5
5
 
6
6
 
7
+ # TODO-2.17.1: Drop `UserSettings`
7
8
  class UserSettings(SQLModel, table=True):
8
9
  """
9
10
  Comprehensive list of user settings.
@@ -42,6 +42,7 @@ class TaskGroupV2(SQLModel, table=True):
42
42
  user_group_id: int | None = Field(
43
43
  foreign_key="usergroup.id", default=None, ondelete="SET NULL"
44
44
  )
45
+ # TODO-2.17.1: make `resource_id` not nullable
45
46
  resource_id: int | None = Field(
46
47
  foreign_key="resource.id", default=None, ondelete="SET NULL"
47
48
  )
@@ -13,7 +13,7 @@ from fractal_server.app.db import get_async_db
13
13
  from fractal_server.app.models import UserOAuth
14
14
  from fractal_server.app.models.v2 import AccountingRecord
15
15
  from fractal_server.app.models.v2 import AccountingRecordSlurm
16
- from fractal_server.app.routes.auth import current_active_superuser
16
+ from fractal_server.app.routes.auth import current_superuser_act
17
17
  from fractal_server.app.routes.pagination import get_pagination_params
18
18
  from fractal_server.app.routes.pagination import PaginationRequest
19
19
  from fractal_server.app.routes.pagination import PaginationResponse
@@ -34,7 +34,7 @@ async def query_accounting(
34
34
  query: AccountingQuery,
35
35
  # Dependencies
36
36
  pagination: PaginationRequest = Depends(get_pagination_params),
37
- superuser: UserOAuth = Depends(current_active_superuser),
37
+ superuser: UserOAuth = Depends(current_superuser_act),
38
38
  db: AsyncSession = Depends(get_async_db),
39
39
  ) -> PaginationResponse[AccountingRecordRead]:
40
40
  page = pagination.page
@@ -79,7 +79,7 @@ async def query_accounting(
79
79
  async def query_accounting_slurm(
80
80
  query: AccountingQuery,
81
81
  # dependencies
82
- superuser: UserOAuth = Depends(current_active_superuser),
82
+ superuser: UserOAuth = Depends(current_superuser_act),
83
83
  db: AsyncSession = Depends(get_async_db),
84
84
  ) -> JSONResponse:
85
85
  stm = select(AccountingRecordSlurm.slurm_job_ids)
@@ -6,7 +6,7 @@ from fastapi_users.authentication import JWTStrategy
6
6
  from fractal_server.app.db import AsyncSession
7
7
  from fractal_server.app.db import get_async_db
8
8
  from fractal_server.app.models import UserOAuth
9
- from fractal_server.app.routes.auth import current_active_superuser
9
+ from fractal_server.app.routes.auth import current_superuser_act
10
10
  from fractal_server.app.routes.auth._aux_auth import _user_or_404
11
11
  from fractal_server.config import get_settings
12
12
  from fractal_server.syringe import Inject
@@ -17,7 +17,7 @@ router = APIRouter()
17
17
  @router.get("/{user_id}/")
18
18
  async def impersonate_user(
19
19
  user_id: int,
20
- superuser: UserOAuth = Depends(current_active_superuser),
20
+ superuser: UserOAuth = Depends(current_superuser_act),
21
21
  db: AsyncSession = Depends(get_async_db),
22
22
  ) -> JSONResponse:
23
23
  user = await _user_or_404(user_id, db)
@@ -16,7 +16,7 @@ from fractal_server.app.models.v2 import HistoryRun
16
16
  from fractal_server.app.models.v2 import HistoryUnit
17
17
  from fractal_server.app.models.v2 import JobV2
18
18
  from fractal_server.app.models.v2 import ProjectV2
19
- from fractal_server.app.routes.auth import current_active_superuser
19
+ from fractal_server.app.routes.auth import current_superuser_act
20
20
  from fractal_server.app.routes.aux._job import _write_shutdown_file
21
21
  from fractal_server.app.routes.aux._runner import _check_shutdown_is_supported
22
22
  from fractal_server.app.schemas.v2 import HistoryUnitStatus
@@ -43,7 +43,7 @@ async def view_job(
43
43
  end_timestamp_min: AwareDatetime | None = None,
44
44
  end_timestamp_max: AwareDatetime | None = None,
45
45
  log: bool = True,
46
- user: UserOAuth = Depends(current_active_superuser),
46
+ user: UserOAuth = Depends(current_superuser_act),
47
47
  db: AsyncSession = Depends(get_async_db),
48
48
  ) -> list[JobReadV2]:
49
49
  """
@@ -111,7 +111,7 @@ async def view_job(
111
111
  async def view_single_job(
112
112
  job_id: int,
113
113
  show_tmp_logs: bool = False,
114
- user: UserOAuth = Depends(current_active_superuser),
114
+ user: UserOAuth = Depends(current_superuser_act),
115
115
  db: AsyncSession = Depends(get_async_db),
116
116
  ) -> JobReadV2:
117
117
  job = await db.get(JobV2, job_id)
@@ -136,7 +136,7 @@ async def view_single_job(
136
136
  async def update_job(
137
137
  job_update: JobUpdateV2,
138
138
  job_id: int,
139
- user: UserOAuth = Depends(current_active_superuser),
139
+ user: UserOAuth = Depends(current_superuser_act),
140
140
  db: AsyncSession = Depends(get_async_db),
141
141
  ) -> JobReadV2 | None:
142
142
  """
@@ -200,7 +200,7 @@ async def update_job(
200
200
  @router.get("/{job_id}/stop/", status_code=202)
201
201
  async def stop_job(
202
202
  job_id: int,
203
- user: UserOAuth = Depends(current_active_superuser),
203
+ user: UserOAuth = Depends(current_superuser_act),
204
204
  db: AsyncSession = Depends(get_async_db),
205
205
  ) -> Response:
206
206
  """
@@ -224,7 +224,7 @@ async def stop_job(
224
224
  @router.get("/{job_id}/download/", response_class=StreamingResponse)
225
225
  async def download_job_logs(
226
226
  job_id: int,
227
- user: UserOAuth = Depends(current_active_superuser),
227
+ user: UserOAuth = Depends(current_superuser_act),
228
228
  db: AsyncSession = Depends(get_async_db),
229
229
  ) -> StreamingResponse:
230
230
  """
@@ -11,7 +11,7 @@ from ._aux_functions import _get_profile_or_404
11
11
  from fractal_server.app.db import AsyncSession
12
12
  from fractal_server.app.db import get_async_db
13
13
  from fractal_server.app.models import UserOAuth
14
- from fractal_server.app.routes.auth import current_active_superuser
14
+ from fractal_server.app.routes.auth import current_superuser_act
15
15
  from fractal_server.app.schemas.v2 import ProfileCreate
16
16
  from fractal_server.app.schemas.v2 import ProfileRead
17
17
 
@@ -21,7 +21,7 @@ router = APIRouter()
21
21
  @router.get("/{profile_id}/", response_model=ProfileRead, status_code=200)
22
22
  async def get_single_profile(
23
23
  profile_id: int,
24
- superuser: UserOAuth = Depends(current_active_superuser),
24
+ superuser: UserOAuth = Depends(current_superuser_act),
25
25
  db: AsyncSession = Depends(get_async_db),
26
26
  ) -> ProfileRead:
27
27
  """
@@ -35,7 +35,7 @@ async def get_single_profile(
35
35
  async def put_profile(
36
36
  profile_id: int,
37
37
  profile_update: ProfileCreate,
38
- superuser: UserOAuth = Depends(current_active_superuser),
38
+ superuser: UserOAuth = Depends(current_superuser_act),
39
39
  db: AsyncSession = Depends(get_async_db),
40
40
  ) -> ProfileRead:
41
41
  """
@@ -56,7 +56,7 @@ async def put_profile(
56
56
  @router.delete("/{profile_id}/", status_code=204)
57
57
  async def delete_profile(
58
58
  profile_id: int,
59
- superuser: UserOAuth = Depends(current_active_superuser),
59
+ superuser: UserOAuth = Depends(current_superuser_act),
60
60
  db: AsyncSession = Depends(get_async_db),
61
61
  ):
62
62
  """
@@ -6,7 +6,7 @@ from fractal_server.app.db import AsyncSession
6
6
  from fractal_server.app.db import get_async_db
7
7
  from fractal_server.app.models import UserOAuth
8
8
  from fractal_server.app.models.v2 import ProjectV2
9
- from fractal_server.app.routes.auth import current_active_superuser
9
+ from fractal_server.app.routes.auth import current_superuser_act
10
10
  from fractal_server.app.schemas.v2 import ProjectReadV2
11
11
 
12
12
  router = APIRouter()
@@ -16,7 +16,7 @@ router = APIRouter()
16
16
  async def view_project(
17
17
  id: int | None = None,
18
18
  user_id: int | None = None,
19
- user: UserOAuth = Depends(current_active_superuser),
19
+ user: UserOAuth = Depends(current_superuser_act),
20
20
  db: AsyncSession = Depends(get_async_db),
21
21
  ) -> list[ProjectReadV2]:
22
22
  """