Server settings API reference
Admin routes for server settings, the login photo and the test email.
delete_login_photo
delete_login_photo(request, storage, db)
Delete custom login page photo.
Requires admin authentication with server-settings:write scope.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
Request
|
The HTTP request object. |
required |
storage
|
Storage
|
The platform storage provider. |
required |
db
|
DbSession
|
Database session. |
required |
Source code in backend/app/modules/server_settings/router.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
edit_mail_settings
edit_mail_settings(request, mail_settings_attributes, db, response, if_match, verify_step_up)
Update the mail server settings.
Requires admin authentication with server-settings:write scope and the administrator's
own step-up verification in step_up, as pointing mail at another server exposes
every password-reset link. The body replaces the whole configuration; only the
password may be omitted, which keeps the stored one.
If-Match with the ETag from the read is required: a request without it is refused
with 428, and a stale tag with 412.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
Request
|
The HTTP request object. |
required |
mail_settings_attributes
|
MailSettingsEditRequest
|
Settings to update, and the administrator's step-up. |
required |
db
|
DbSession
|
Database session. |
required |
response
|
Response
|
The response, which carries the new ETag. |
required |
if_match
|
IfMatch
|
The |
required |
verify_step_up
|
StepUpVerifierDep
|
Verifies the administrator's step-up. |
required |
Returns:
| Type | Description |
|---|---|
MailSettingsAdminRead
|
Updated mail settings, without the password. |
Raises:
| Type | Description |
|---|---|
StepUpFailedError
|
403 if the step-up fails. |
InvalidInputError
|
400 if the configuration is not usable. |
ConflictError
|
409 if a field is set by an environment variable. |
PreconditionFailedError
|
412 if the settings changed since the client read them. |
Source code in backend/app/modules/server_settings/router.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | |
edit_server_settings
edit_server_settings(request, server_settings_attributes, db, response, if_match, verify_step_up)
Update server settings.
Requires admin authentication with server-settings:write scope. A change to a setting that governs
sign-up, sign-in, sessions, the audit trail or the owner info on public links also needs the administrator's
own step-up verification in step_up; any other change needs none. The body replaces
the whole configuration; only the API keys may be omitted, which keeps the stored
ones. If-Match with the ETag from the read is required: a request without it is
refused with 428, and a stale tag with 412 rather than reverting an admin who saved
in between.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
Request
|
The HTTP request object. |
required |
server_settings_attributes
|
ServerSettingsEditRequest
|
Settings to update, and the administrator's step-up. |
required |
db
|
DbSession
|
Database session. |
required |
response
|
Response
|
The response, which carries the new ETag. |
required |
if_match
|
IfMatch
|
The |
required |
verify_step_up
|
StepUpVerifierDep
|
Verifies the administrator's step-up. |
required |
Returns:
| Type | Description |
|---|---|
ServerSettingsAdminRead
|
Updated server settings configuration, without the tile API key. |
Source code in backend/app/modules/server_settings/router.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
put_login_photo
put_login_photo(request, file, storage, db, response)
Set the custom login page photo.
Requires admin authentication with server-settings:write scope. Answers 201 when there was no custom photo and 200 when it replaced one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
Request
|
The HTTP request object. |
required |
file
|
UploadFile
|
Image file to upload. |
required |
storage
|
Storage
|
The platform storage provider. |
required |
db
|
DbSession
|
Database session. |
required |
response
|
Response
|
The response, whose status is 200 when a photo was replaced. |
required |
Returns:
| Type | Description |
|---|---|
LoginPhotoRead
|
The stored photo's version. |
Source code in backend/app/modules/server_settings/router.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
read_mail_settings
read_mail_settings(db, response)
Get the mail server settings.
Requires admin authentication with server-settings:read scope.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db
|
DbSession
|
Database session. |
required |
response
|
Response
|
The response, which carries the ETag. |
required |
Returns:
| Type | Description |
|---|---|
MailSettingsAdminRead
|
The mail settings. The password is never returned, only whether one is stored; |
MailSettingsAdminRead
|
|
Source code in backend/app/modules/server_settings/router.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
read_server_settings
read_server_settings(db, response)
Get current server settings.
Requires admin authentication with server-settings:read scope.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db
|
DbSession
|
Database session. |
required |
response
|
Response
|
The response, which carries the ETag. |
required |
Returns:
| Type | Description |
|---|---|
ServerSettingsAdminRead
|
Current server settings configuration. The tile API key is never returned, |
ServerSettingsAdminRead
|
only whether one is stored. |
Source code in backend/app/modules/server_settings/router.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
send_test_email
send_test_email(request, token_user_id, mail, db)
Send a test email to the requesting admin.
Requires admin authentication with server-settings:write scope. The recipient is always the caller's own email address.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
Request
|
The HTTP request object. |
required |
token_user_id
|
CurrentUserId
|
The requesting admin's user ID, from the access token. |
required |
mail
|
Annotated[MailProvider, Depends(get_mail)]
|
The platform mail provider. |
required |
db
|
DbSession
|
Database session. |
required |
Raises:
| Type | Description |
|---|---|
ServiceUnavailableError
|
503 if email is not configured. |
UpstreamError
|
502 if the mail server did not accept the message. |
Source code in backend/app/modules/server_settings/router.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | |
Request and response shapes for server settings.
Currency
Bases: Enum
An enumeration representing supported currencies.
Attributes:
| Name | Type | Description |
|---|---|---|
EURO |
Represents the Euro currency. |
|
DOLLAR |
Represents the US Dollar currency. |
|
POUND |
Represents the British Pound currency. |
Source code in backend/app/modules/server_settings/schema.py
36 37 38 39 40 41 42 43 44 45 46 47 | |
EmailStatus
Bases: BaseModel
Whether outgoing email is usable, and why not when it is not.
Attributes:
| Name | Type | Description |
|---|---|---|
configured |
bool
|
True when the mail settings are valid and email can be sent. |
problems |
list[str]
|
Reasons email is disabled. Names settings, never their values. |
Source code in backend/app/modules/server_settings/schema.py
715 716 717 718 719 720 721 722 723 724 | |
LoginPhotoRead
Bases: BaseModel
The login photo after an upload.
Attributes:
| Name | Type | Description |
|---|---|---|
version |
StrictInt
|
The server settings version that identifies the stored photo; the public photo route
sends it as the |
Source code in backend/app/modules/server_settings/schema.py
579 580 581 582 583 584 585 586 587 | |
MailSettingsAdminRead
Bases: BaseModel
Mail server settings response for admins; the password is never returned.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
StrictInt
|
Unique identifier (always 1, singleton pattern). |
version |
StrictInt
|
Optimistic-concurrency counter, also sent as the |
host |
StrictStr | None
|
Mail server hostname, or null when mail is disabled. |
port |
StrictInt
|
Mail server port. |
security |
MailSecurity
|
Connection security. |
username |
StrictStr | None
|
Authentication username. |
from_address |
StrictStr | None
|
Sender address, or null when the username is used. |
password_set |
StrictBool
|
Whether a password is stored. |
env_managed |
dict[str, str]
|
Field name to the environment variable that sets it; those fields cannot be edited while the variable is set. |
email_status |
EmailStatus
|
Whether outgoing email is usable with these settings; read-only. |
Source code in backend/app/modules/server_settings/schema.py
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 | |
MailSettingsEdit
Bases: BaseModel
Request body for editing the mail server settings.
A full replacement except for the password.
Attributes:
| Name | Type | Description |
|---|---|---|
host |
StrictStr | None
|
Mail server hostname; empty or null disables mail. |
port |
StrictInt
|
Mail server port. |
security |
MailSecurity
|
Connection security. |
username |
StrictStr | None
|
Authentication username. |
from_address |
StrictStr | None
|
Sender address; the username is used when empty. |
password |
StrictStr | None
|
Plain-text password; stored encrypted and never returned. Omit it to keep the stored password; send null or an empty string to remove it. |
Source code in backend/app/modules/server_settings/schema.py
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 | |
MailSettingsEditRequest
Bases: MailSettingsEdit
The body of PUT /server-settings/email/settings: the mail settings and the administrator's step-up.
Attributes:
| Name | Type | Description |
|---|---|---|
step_up |
StepUpVerification
|
The administrator's own step-up verification; it is never a mail setting. |
Source code in backend/app/modules/server_settings/schema.py
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 | |
to_edit
to_edit()
Return the mail settings the client sent, without the step-up.
Returns:
| Type | Description |
|---|---|
MailSettingsEdit
|
The settings as a :class: |
Source code in backend/app/modules/server_settings/schema.py
688 689 690 691 692 693 694 | |
MailSettingsRead
Bases: MailSettingsEdit
The mail settings row as stored, for in-process use only.
Never a response model: the password is the stored (encrypted) value.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
StrictInt
|
Unique identifier (always 1, singleton pattern). |
version |
StrictInt
|
Optimistic-concurrency counter, also sent as the |
Source code in backend/app/modules/server_settings/schema.py
697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 | |
ServerSettingsAdminRead
Bases: ServerSettingsBase, ServerSettingsGeocoding, ServerSettingsSessionPolicy, ServerSettingsRetention
Complete server settings response for admins; API keys are never returned.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
StrictInt
|
Unique identifier (always 1, singleton pattern). |
login_photo_set |
StrictBool
|
Whether a custom login photo is configured. |
version |
StrictInt
|
Optimistic-concurrency counter, also sent as the |
tileserver_api_key_set |
StrictBool
|
Whether a tile API key is stored. |
geocoding_api_key_set |
StrictBool
|
Whether a geocoding API key is stored. |
env_managed |
dict[str, str]
|
Field name to the environment variable that sets it; those fields cannot be edited while the variable is set. |
signup_sso_enabled |
StrictBool
|
Allow identity providers to create accounts at first sign-in. |
signup_require_admin_approval |
StrictBool
|
Require admin approval for new sign-ups. |
signup_require_email_verification |
StrictBool
|
Require email verification for new sign-ups. |
password_breach_check_enabled |
StrictBool
|
Refuse a new password found in a known data breach. |
require_mfa |
RequireMfa
|
Which accounts must have MFA (off, administrators, everyone). |
step_up_fields |
list[StrictStr]
|
The settings whose change needs the administrator's step-up; read-only. |
logs_viewer_enabled |
StrictBool
|
Whether the server log can be read through the API on this deployment; read-only. |
Source code in backend/app/modules/server_settings/schema.py
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 | |
ServerSettingsBase
Bases: BaseModel
Pydantic model for server settings configuration.
This model defines all configurable server settings for the Endurain application, including units, currency, authentication methods, map configuration, and password policies.
Attributes:
| Name | Type | Description |
|---|---|---|
units |
Units
|
Unit system for measurements (METRIC or IMPERIAL). |
public_shareable_links |
StrictBool
|
Enable/disable public shareable links. |
public_shareable_links_user_info |
StrictBool
|
Show user info on public shareable links. |
currency |
Currency
|
Currency type (EURO, DOLLAR, or POUND). |
num_records_per_page |
StrictInt
|
Number of records per page in lists (1-100). |
signup_enabled |
StrictBool
|
Allow new user registration. |
sso_enabled |
StrictBool
|
Enable SSO/IdP authentication. |
local_login_enabled |
StrictBool
|
Allow local username/password authentication. |
sso_auto_redirect |
StrictBool
|
Automatically redirect to SSO when exactly one identity provider is enabled and local login is disabled. |
tileserver_url |
StrictStr
|
URL template for map tile server with coordinate placeholders. |
tileserver_attribution |
StrictStr
|
Attribution string for map tile server. |
map_background_color |
StrictStr
|
Hex color code for map background (#RRGGBB format). |
password_length_regular_users |
StrictInt
|
Minimum password length for regular users (8-128). |
password_length_admin_users |
StrictInt
|
Minimum password length for admin users (8-128). |
Validators
- validate_tileserver_url: Ensures tile server URL is secure, uses proper protocol, contains required placeholders, and blocks dangerous patterns.
- validate_attribution: Sanitizes attribution string to prevent XSS attacks.
Model Config
- Validates on assignment.
- Forbids extra fields.
- Uses enum values in serialization.
- Supports ORM attribute mapping.
Source code in backend/app/modules/server_settings/schema.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
validate_attribution
classmethod
validate_attribution(value)
Sanitize tileserver attribution to prevent XSS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
Raw attribution string. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Sanitized string with only safe HTML. |
Source code in backend/app/modules/server_settings/schema.py
196 197 198 199 200 201 202 203 204 205 206 207 | |
validate_tileserver_url
classmethod
validate_tileserver_url(value)
Validate tile server URL for security and correctness.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
Tile server URL template. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Validated URL. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If URL is invalid or insecure. |
Source code in backend/app/modules/server_settings/schema.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
ServerSettingsEdit
Bases: ServerSettingsBase, ServerSettingsGeocoding, ServerSettingsSessionPolicy, ServerSettingsRetention
Request body for editing the server settings.
A full replacement: every setting except the tile API key is required. The row id and the login-photo flag are not here: the id is fixed (singleton) and the flag is set only by the login-photo upload and delete routes, so a stale form can never reset it.
Attributes:
| Name | Type | Description |
|---|---|---|
tileserver_api_key |
StrictStr | None
|
Plain-text API key for the tile server; stored encrypted and never returned. Omit it to keep the stored key; send null or an empty string to remove it. |
signup_sso_enabled |
StrictBool
|
Allow identity providers to create accounts at first sign-in (true - yes, false - no). |
signup_require_admin_approval |
StrictBool
|
Require admin approval for new sign-ups (true - yes, false - no). |
signup_require_email_verification |
StrictBool
|
Require email verification for new sign-ups (true - yes, false - no). |
password_breach_check_enabled |
StrictBool
|
Refuse a new password found in a known data breach, checked against the Have I Been Pwned range API (true - yes, false - no). |
require_mfa |
RequireMfa
|
Which accounts must have MFA (off, administrators, everyone). |
geocoding_api_key |
StrictStr | None
|
Plain-text API key for the geocoding service; same
write-only semantics as |
Source code in backend/app/modules/server_settings/schema.py
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 | |
ServerSettingsEditRequest
Bases: ServerSettingsEdit
The body of PUT /server-settings: the settings and, when needed, the administrator's step-up.
Attributes:
| Name | Type | Description |
|---|---|---|
step_up |
StepUpVerification | None
|
The administrator's own step-up verification, or null when no security-relevant setting changes;
it is never a setting. The key is always sent, as a |
Source code in backend/app/modules/server_settings/schema.py
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 | |
to_edit
to_edit()
Return the settings the client sent, without the step-up.
Returns:
| Type | Description |
|---|---|
ServerSettingsEdit
|
The settings as a :class: |
Source code in backend/app/modules/server_settings/schema.py
442 443 444 445 446 447 448 | |
validate_access_token_lifetime
validate_access_token_lifetime()
Refuse an access token lifetime that is not shorter than the enforced idle timeout.
The check belongs to the request, not to the shared session policy fields: a stored row that predates it must still read, and the administrator edits it into validity.
Returns:
| Type | Description |
|---|---|
ServerSettingsEditRequest
|
The validated model. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the idle timeout is enforced and the access token lifetime is not shorter than it. |
Source code in backend/app/modules/server_settings/schema.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | |
ServerSettingsGeocoding
Bases: BaseModel
The reverse-geocoding fields, kept off the public settings model.
A separate mixin rather than part of :class:ServerSettingsBase, which the public
settings inherit: the geocoding host of a self-hosted instance is not for anonymous visitors.
Attributes:
| Name | Type | Description |
|---|---|---|
geocoding_service |
GeocodingService
|
The reverse-geocoding service. |
geocoding_host |
StrictStr | None
|
Host (and optional port) of the service; empty for the service's default host. |
geocoding_use_https |
StrictBool
|
Address the host over HTTPS. |
geocoding_rate_limit |
float
|
Maximum requests per second (0 disables throttling). |
Source code in backend/app/modules/server_settings/schema.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | |
validate_geocoding_host
classmethod
validate_geocoding_host(value)
Normalise the geocoding host and refuse anything but host[:port].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str | None
|
The submitted host. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
The lower-cased host, or None when blank. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the value carries a scheme, path or other characters. |
Source code in backend/app/modules/server_settings/schema.py
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | |
ServerSettingsRead
Bases: ServerSettingsEdit
The settings row as stored, for in-process use only.
Never a response model: the tile API key is the stored (encrypted) value.
Clients get :class:ServerSettingsAdminRead or :class:ServerSettingsReadPublic.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
StrictInt
|
Unique identifier (always 1, singleton pattern). |
login_photo_set |
StrictBool
|
Whether a custom login photo is configured. |
version |
StrictInt
|
Optimistic-concurrency counter, also sent as the |
Source code in backend/app/modules/server_settings/schema.py
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | |
ServerSettingsReadPublic
Bases: ServerSettingsBase
Public-facing schema for unauthenticated server settings access.
Provides only public-safe server settings. Used for the public API endpoint that doesn't require authentication.
Inherits all safe fields from ServerSettingsBase but explicitly excludes admin-level configuration fields. The email-verification requirement is public because the sign-up form depends on it and the sign-up response already discloses it; admin approval stays admin-only.
Attributes:
| Name | Type | Description |
|---|---|---|
signup_require_email_verification |
StrictBool
|
Whether a new sign-up must verify its email address, which is also when the password is chosen. |
login_photo_set |
StrictBool
|
Whether a custom login photo is configured. |
allowed_redirect_uris |
list[str]
|
Exact redirect addresses (ALLOWED_REDIRECT_URIS) that SSO redirects may target, so the frontend validates the same allow-list as the backend. |
Source code in backend/app/modules/server_settings/schema.py
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 | |
ServerSettingsRetention
Bases: BaseModel
The data retention fields, kept off the public settings model.
Attributes:
| Name | Type | Description |
|---|---|---|
read_notification_retention_days |
StrictInt
|
Days after which read notifications are purged (0 disables pruning). |
Source code in backend/app/modules/server_settings/schema.py
327 328 329 330 331 332 333 334 335 336 | |
ServerSettingsSessionPolicy
Bases: BaseModel
The session and token policy fields, kept off the public settings model.
Attributes:
| Name | Type | Description |
|---|---|---|
session_idle_timeout_enabled |
StrictBool
|
Enforce the idle session timeout; the absolute timeout always applies. |
session_idle_timeout_hours |
StrictInt
|
Hours of inactivity that end a session (1-8760). |
session_absolute_timeout_hours |
StrictInt
|
Hours after which a session ends (1-8760, not below the idle timeout). |
access_token_expire_minutes |
StrictInt
|
Access token lifetime in minutes (1-1440). |
refresh_token_expire_days |
StrictInt
|
Refresh token lifetime in days (1-365). |
api_key_max_lifetime_days |
StrictInt
|
Longest lifetime of a new API key, and its default, in days (1-3650). |
Source code in backend/app/modules/server_settings/schema.py
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | |
validate_absolute_timeout
validate_absolute_timeout()
Refuse an absolute timeout shorter than the idle timeout.
Returns:
| Type | Description |
|---|---|
ServerSettingsSessionPolicy
|
The validated model. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the absolute timeout is below the idle timeout. |
Source code in backend/app/modules/server_settings/schema.py
312 313 314 315 316 317 318 319 320 321 322 323 324 | |
TileMapsTemplate
Bases: BaseModel
Schema representing available tile map templates.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
StrictStr
|
Human-readable name of the tile map template. |
url_template |
StrictStr
|
URL template for fetching map tiles. |
attribution |
StrictStr
|
HTML string for map attribution. |
requires_api_key_frontend |
StrictBool
|
Indicates if an API key is required on the frontend to use the tile map. |
requires_api_key_backend |
StrictBool
|
Indicates if an API key is required on the backend to use the tile map. |
Source code in backend/app/modules/server_settings/schema.py
590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 | |
Units
Bases: Enum
An enumeration representing measurement units.
Attributes:
| Name | Type | Description |
|---|---|---|
METRIC |
Metric system (e.g., meters, kilograms). |
|
IMPERIAL |
Imperial system (e.g., miles, pounds). |
Source code in backend/app/modules/server_settings/schema.py
24 25 26 27 28 29 30 31 32 33 | |
require_access_token_below_idle_timeout
require_access_token_below_idle_timeout(idle_timeout_enabled, idle_timeout_hours, access_token_expire_minutes)
Refuse an access token that lives as long as the enforced idle timeout.
The idle timeout counts from the last refresh, which the client does only after an access token expires, so a lifetime at or above the idle timeout can end the session of a user who is active.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
idle_timeout_enabled
|
bool
|
Whether the idle timeout is enforced; nothing is refused while it is not. |
required |
idle_timeout_hours
|
int
|
The idle timeout in hours. |
required |
access_token_expire_minutes
|
int
|
The access token lifetime in minutes. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the idle timeout is enforced and the access token lifetime is not shorter than it. |
Source code in backend/app/modules/server_settings/schema.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |