Skip to content

Commit bb0d1e1

Browse files
committed
feat: sensitive declarative settings
Signed-off-by: Andrey Borysenko <[email protected]>
1 parent 009934f commit bb0d1e1

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

developer_manual/digging_deeper/declarative_settings.rst

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,4 +448,39 @@ Select and Multi-select
448448
'options' => ['foo', 'bar', 'baz'], // simple options for select, radio, multi-select
449449
'placeholder' => 'Select some multiple options', // input placeholder
450450
'default' => ['foo', 'bar'],
451-
],
451+
],
452+
453+
454+
Sensitive field type
455+
--------------------
456+
457+
Since Nextcloud 32 there is a new field attribute ``sensitive: true/false`` available for ``DeclarativeSettingsTypes::TEXT``, ``DeclarativeSettingsTypes::PASSWORD`` types.
458+
The values of such fields are stored in an encrypted form in the database and are not exposed to the UI.
459+
460+
461+
.. code-block:: php
462+
463+
[
464+
'id' => 'test_sensitive_field',
465+
'title' => 'Sensitive text field',
466+
'description' => 'Set some secure value setting that is stored encrypted',
467+
'type' => DeclarativeSettingsTypes::TEXT,
468+
'label' => 'Sensitive field',
469+
'placeholder' => 'Set secure value',
470+
'default' => '',
471+
'sensitive' => true, // only for TEXT, PASSWORD types
472+
],
473+
[
474+
'id' => 'test_sensitive_field_2',
475+
'title' => 'Sensitive password field',
476+
'description' => 'Set some password setting that is stored encrypted',
477+
'type' => DeclarativeSettingsTypes::PASSWORD,
478+
'label' => 'Sensitive field',
479+
'placeholder' => 'Set secure value',
480+
'default' => '',
481+
'sensitive' => true, // only for TEXT, PASSWORD types
482+
],
483+
484+
.. figure:: ../images/declarative_settings_sensitive.png
485+
:alt: sensitive fields
486+
20.3 KB
Loading

0 commit comments

Comments
 (0)