fractal_server.app.schemas¶
| MODULE | DESCRIPTION |
|---|---|
user |
|
user_group |
|
v2 |
|
| CLASS | DESCRIPTION |
|---|---|
OAuthAccountRead |
Schema for storing essential |
UserCreate |
Schema for |
UserGroupCreate |
Schema for |
UserGroupRead |
Schema for |
UserProfileInfo |
Attributes: |
UserRead |
Schema for |
UserUpdate |
Schema for |
UserUpdateGroups |
Schema for |
UserUpdateStrict |
Schema for |
| FUNCTION | DESCRIPTION |
|---|---|
validate_cmd |
Assert that the provided |
| ATTRIBUTE | DESCRIPTION |
|---|---|
ListUniqueNonEmptyString |
List of unique non-empty-string items.
|
ListUniqueNonNegativeInt |
List of unique non-negative-integer items.
|
ListUniqueProjectDir |
List of unique project directories,
|
NonEmptyStr |
A non-empty string, with no leading/trailing whitespaces.
|
Attributes¶
ListUniqueNonEmptyString = Annotated[list[NonEmptyStr], AfterValidator(val_unique_list)]
module-attribute
¶
List of unique non-empty-string items.
ListUniqueNonNegativeInt = Annotated[list[NonNegativeInt], AfterValidator(val_unique_list)]
module-attribute
¶
List of unique non-negative-integer items.
ListUniqueProjectDir = Annotated[list[AbsolutePathStr | S3PathStr], AfterValidator(val_unique_list)]
module-attribute
¶
List of unique project directories, which can be either absolute paths or S3 paths.
NonEmptyStr = Annotated[str, StringConstraints(min_length=1, strip_whitespace=True)]
module-attribute
¶
A non-empty string, with no leading/trailing whitespaces.
Classes¶
OAuthAccountRead
pydantic-model
¶
Bases: BaseModel
Schema for storing essential OAuthAccount information within
UserRead.oauth_accounts.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
ID of the row in fractal-owned
TYPE:
|
account_email |
Email associated to OAuth account
TYPE:
|
oauth_name |
Name of the OAuth provider (e.g.
TYPE:
|
Fields:
Source code in fractal_server/app/schemas/user.py
UserCreate
¶
Bases: BaseUserCreate
Schema for User creation.
| ATTRIBUTE | DESCRIPTION |
|---|---|
is_guest |
TYPE:
|
profile_id |
TYPE:
|
project_dirs |
TYPE:
|
slurm_accounts |
|
Source code in fractal_server/app/schemas/user.py
UserGroupCreate
pydantic-model
¶
Bases: BaseModel
Schema for UserGroup creation
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
Group name
TYPE:
|
Config:
extra:forbid
Fields:
-
name(NonEmptyStr)
Source code in fractal_server/app/schemas/user_group.py
UserGroupRead
pydantic-model
¶
Bases: BaseModel
Schema for UserGroup read
NOTE: user_ids does not correspond to a column of the UserGroup table,
but it is rather computed dynamically in relevant endpoints.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
Group ID
TYPE:
|
name |
Group name
TYPE:
|
timestamp_created |
Creation timestamp
TYPE:
|
user_ids |
IDs of users of this group |
Fields:
-
id(int) -
name(str) -
timestamp_created(AwareDatetime) -
user_ids(list[int] | None)
Source code in fractal_server/app/schemas/user_group.py
UserProfileInfo
pydantic-model
¶
UserRead
¶
Bases: BaseUser[int]
Schema for User read from database.
| ATTRIBUTE | DESCRIPTION |
|---|---|
is_guest |
TYPE:
|
group_ids_names |
|
oauth_accounts |
TYPE:
|
profile_id |
TYPE:
|
project_dirs |
|
slurm_accounts |
|
Source code in fractal_server/app/schemas/user.py
UserUpdate
¶
Bases: BaseUserUpdate
Schema for User update.
| ATTRIBUTE | DESCRIPTION |
|---|---|
password |
TYPE:
|
email |
TYPE:
|
is_active |
TYPE:
|
is_superuser |
TYPE:
|
is_verified |
TYPE:
|
is_guest |
TYPE:
|
profile_id |
TYPE:
|
project_dirs |
TYPE:
|
slurm_accounts |
TYPE:
|
Source code in fractal_server/app/schemas/user.py
UserUpdateGroups
pydantic-model
¶
Bases: BaseModel
Schema for POST /auth/users/{user_id}/set-groups/
| ATTRIBUTE | DESCRIPTION |
|---|---|
group_ids |
TYPE:
|
Config:
extra:forbid
Fields:
-
group_ids(ListUniqueNonNegativeInt)
Source code in fractal_server/app/schemas/user.py
UserUpdateStrict
pydantic-model
¶
Bases: BaseModel
Schema for User self-editing.
| ATTRIBUTE | DESCRIPTION |
|---|---|
slurm_accounts |
TYPE:
|
Config:
extra:forbid
Fields:
-
slurm_accounts(ListUniqueNonEmptyString)
Source code in fractal_server/app/schemas/user.py
Functions:¶
validate_cmd(command, *, allow_char=None, attribute_name='Command')
¶
Assert that the provided command does not contain any of the forbidden
characters for commands
(fractal_server.string_tools.NOT_ALLOWED_FOR_COMMANDS)
| PARAMETER | DESCRIPTION |
|---|---|
|
command to validate.
TYPE:
|
|
chars to accept among the forbidden ones
TYPE:
|
|
Name of the attribute, to be used in error message.
TYPE:
|