Skip to content

Commit 27b7f89

Browse files
authored
Use monospace font for some settings in admin UI (#3546)
## Description Enable monospace font rendering for form fields in the OIDC and SAML patron authentication configuration models that contain code-like content — regular expressions, filter expressions, JSON, and XML/PEM blobs. ## Motivation and Context Fields holding structured or code-like values (regex patterns, Python expressions, XML metadata, JSON objects, private keys) are easier to read and edit in a monospace font. This sets `use_monospace_font=True` on those fields in the admin UI so their content renders as expected. ## How Has This Been Tested? - Manual testing in local dev environment to verify that fields display with correct font family. - No logic changes, so existing tests should continue to pass. ## Checklist - N/A - I have updated the documentation accordingly. - N/A - All new and existing tests passed.
1 parent ebd19a1 commit 27b7f89

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

  • src/palace/manager/integration/patron_auth

src/palace/manager/integration/patron_auth/oidc/configuration/model.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ class OIDCAuthSettings(AuthProviderSettings, LoggerMixin):
277277
"<pre>(?P&lt;patron_id&gt;[^@]+)@example\\.edu</pre>"
278278
"Leave empty to use the full claim value."
279279
),
280+
use_monospace_font=True,
280281
),
281282
] = None
282283

@@ -316,6 +317,7 @@ class OIDCAuthSettings(AuthProviderSettings, LoggerMixin):
316317
"<pre>claims['email'].endswith('@example.edu')</pre>"
317318
),
318319
type=FormFieldType.TEXTAREA,
320+
use_monospace_font=True,
319321
),
320322
] = None
321323

@@ -334,6 +336,7 @@ class OIDCAuthSettings(AuthProviderSettings, LoggerMixin):
334336
),
335337
type=FormFieldType.JSON,
336338
patron_auth_filter_context=True,
339+
use_monospace_font=True,
337340
),
338341
] = None
339342

@@ -584,6 +587,7 @@ class OIDCAuthLibrarySettings(AuthProviderLibrarySettings):
584587
" syntax and available context variables."
585588
),
586589
type=FormFieldType.TEXTAREA,
590+
use_monospace_font=True,
587591
),
588592
] = None
589593

src/palace/manager/integration/patron_auth/saml/configuration/model.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ class SAMLWebSSOAuthSettings(AuthProviderSettings, LoggerMixin):
140140
"Leave empty to use environment configuration (PALACE_SAML_SP_METADATA or PALACE_SAML_SP_METADATA_FILE)."
141141
),
142142
type=FormFieldType.TEXTAREA,
143+
use_monospace_font=True,
143144
),
144145
] = None
145146
service_provider_private_key: Annotated[
@@ -149,6 +150,7 @@ class SAMLWebSSOAuthSettings(AuthProviderSettings, LoggerMixin):
149150
description="Private key used for encrypting SAML requests. "
150151
"Leave empty to use environment configuration (PALACE_SAML_SP_PRIVATE_KEY or PALACE_SAML_SP_PRIVATE_KEY_FILE).",
151152
type=FormFieldType.TEXTAREA,
153+
use_monospace_font=True,
152154
),
153155
] = None
154156
federated_identity_provider_entity_ids: Annotated[
@@ -216,6 +218,7 @@ class SAMLWebSSOAuthSettings(AuthProviderSettings, LoggerMixin):
216218
"The expression will extract the <b>patron_id</b> from the first SAML attribute that matches "
217219
"or NameID if it matches the expression."
218220
),
221+
use_monospace_font=True,
219222
),
220223
] = None
221224
non_federated_identity_provider_xml_metadata: Annotated[
@@ -229,6 +232,7 @@ class SAMLWebSSOAuthSettings(AuthProviderSettings, LoggerMixin):
229232
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect."
230233
),
231234
type=FormFieldType.TEXTAREA,
235+
use_monospace_font=True,
232236
),
233237
] = None
234238
session_lifetime: Annotated[
@@ -278,6 +282,7 @@ class SAMLWebSSOAuthSettings(AuthProviderSettings, LoggerMixin):
278282
"</pre>"
279283
),
280284
type=FormFieldType.TEXTAREA,
285+
use_monospace_font=True,
281286
),
282287
] = None
283288
# Note: the key-ordering caveat in the description below is a JSONB storage
@@ -295,6 +300,7 @@ class SAMLWebSSOAuthSettings(AuthProviderSettings, LoggerMixin):
295300
),
296301
type=FormFieldType.JSON,
297302
patron_auth_filter_context=True,
303+
use_monospace_font=True,
298304
),
299305
] = None
300306
service_provider_strict_mode: Annotated[
@@ -484,6 +490,7 @@ class SAMLWebSSOAuthLibrarySettings(AuthProviderLibrarySettings):
484490
" syntax and examples."
485491
),
486492
type=FormFieldType.TEXTAREA,
493+
use_monospace_font=True,
487494
),
488495
] = None
489496

0 commit comments

Comments
 (0)