mirror of
https://github.com/nextcloud/documentation.git
synced 2026-01-02 17:59:36 +07:00
Merge pull request #13166 from nextcloud/feat/developer_manual/declarative_settings
feat: sensitive declarative settings
This commit is contained in:
@@ -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'],
|
||||
],
|
||||
],
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@ AppConfig
|
||||
|
||||
The ExApp AppConfig API is similar to the standard Nextcloud **appconfig** API.
|
||||
|
||||
.. note::
|
||||
Since Nextcloud 32, sensitive config values are encrypted in the database.
|
||||
|
||||
|
||||
Set app config value
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -24,6 +28,7 @@ Request data
|
||||
"sensitive": "sensitive flag affecting the visibility of the value (0/1, default: 0)"
|
||||
}
|
||||
|
||||
|
||||
Response data
|
||||
*************
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ Preferences
|
||||
The ExApp preferences API is similar to the standard preferences API.
|
||||
It is a user specific setting.
|
||||
|
||||
.. note::
|
||||
Since Nextcloud 32, sensitive config values are encrypted in the database.
|
||||
|
||||
|
||||
Set user config value
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
BIN
developer_manual/images/declarative_settings_sensitive.png
Normal file
BIN
developer_manual/images/declarative_settings_sensitive.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
Reference in New Issue
Block a user