Browse Source

feat(oidc): expose is_env_managed in the provider response

The frontend needs it to render the provider read-only. Without the flag the
UI would offer editable fields whose writes the API then refuses with 409 --
the change would look accepted right up until it wasn't.

Refs #2593
Marian 1 month ago
parent
commit
ccc90ff34c
1 changed files with 3 additions and 0 deletions
  1. 3 0
      backend/app/schemas/auth.py

+ 3 - 0
backend/app/schemas/auth.py

@@ -518,6 +518,9 @@ class OIDCProviderResponse(BaseModel):
     icon_url: str | None = None
     icon_url: str | None = None
     default_group_id: int | None = None
     default_group_id: int | None = None
     is_autologin: bool = False  # #1589
     is_autologin: bool = False  # #1589
+    # #2593 — the UI renders this provider read-only; without the flag it would
+    # offer editable fields whose writes the API then refuses with 409.
+    is_env_managed: bool = False
     # Set explicitly in the route handler from `icon_content_type is not None`
     # Set explicitly in the route handler from `icon_content_type is not None`
     # rather than `@computed_field` (project policy) or `icon_data is not None`
     # rather than `@computed_field` (project policy) or `icon_data is not None`
     # (would trigger an async lazy-load on the deferred BLOB column).
     # (would trigger an async lazy-load on the deferred BLOB column).