diff --git a/developer_manual/digging_deeper/declarative_settings.rst b/developer_manual/digging_deeper/declarative_settings.rst index 12da24c56..d4632474e 100644 --- a/developer_manual/digging_deeper/declarative_settings.rst +++ b/developer_manual/digging_deeper/declarative_settings.rst @@ -448,4 +448,39 @@ Select and Multi-select 'options' => ['foo', 'bar', 'baz'], // simple options for select, radio, multi-select 'placeholder' => 'Select some multiple options', // input placeholder 'default' => ['foo', 'bar'], - ], \ No newline at end of file + ], + + +Sensitive field type +-------------------- + +Since Nextcloud 32 there is a new field attribute ``sensitive: true/false`` available for ``DeclarativeSettingsTypes::TEXT``, ``DeclarativeSettingsTypes::PASSWORD`` types. +The values of such fields are stored in an encrypted form in the database and are not exposed to the UI. + + +.. code-block:: php + + [ + 'id' => 'test_sensitive_field', + 'title' => 'Sensitive text field', + 'description' => 'Set some secure value setting that is stored encrypted', + 'type' => DeclarativeSettingsTypes::TEXT, + 'label' => 'Sensitive field', + 'placeholder' => 'Set secure value', + 'default' => '', + 'sensitive' => true, // only for TEXT, PASSWORD types + ], + [ + 'id' => 'test_sensitive_field_2', + 'title' => 'Sensitive password field', + 'description' => 'Set some password setting that is stored encrypted', + 'type' => DeclarativeSettingsTypes::PASSWORD, + 'label' => 'Sensitive field', + 'placeholder' => 'Set secure value', + 'default' => '', + 'sensitive' => true, // only for TEXT, PASSWORD types + ], + +.. figure:: ../images/declarative_settings_sensitive.png + :alt: sensitive fields + diff --git a/developer_manual/images/declarative_settings_sensitive.png b/developer_manual/images/declarative_settings_sensitive.png new file mode 100644 index 000000000..e32e0abd3 Binary files /dev/null and b/developer_manual/images/declarative_settings_sensitive.png differ