-
Notifications
You must be signed in to change notification settings - Fork 219
Expand file tree
/
Copy pathConfigLexicon.php
More file actions
117 lines (109 loc) · 3.21 KB
/
Copy pathConfigLexicon.php
File metadata and controls
117 lines (109 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Contacts;
use OCP\Config\Lexicon\Entry;
use OCP\Config\Lexicon\ILexicon;
use OCP\Config\Lexicon\Strictness;
use OCP\Config\ValueType;
use OCP\IAppConfig;
/**
* Config Lexicon for contacts.
*
* Please add and manage your config keys in this file and keep the
* Lexicon up to date.
*
* {@see ILexicon}
*/
class ConfigLexicon implements ILexicon {
public const OCM_INVITES_ENABLED = 'ocm_invites_enabled';
public const OCM_INVITES_OPTIONAL_MAIL = 'ocm_invites_optional_mail';
public const OCM_INVITES_ENCODED_COPY_BUTTON = 'ocm_invites_encoded_copy_button';
public const OCM_INVITES_DISABLE_SSRF_GUARD = 'ocm_invites_disable_ssrf_guard';
public const MESH_PROVIDERS_SERVICE = 'mesh_providers_service';
public const WAYF_ENDPOINT = 'wayf_endpoint';
public const FEDERATIONS_CACHE = 'federations_cache';
public const FEDERATIONS_CACHE_EXPIRES = 'expires';
public const FEDERATIONS_CACHE_DELTA_EXPIRES = 'delta_expires';
#[\Override]
public function getStrictness(): Strictness {
return Strictness::NOTICE;
}
#[\Override]
public function getAppConfigs(): array {
return [
new Entry(
self::OCM_INVITES_ENABLED,
ValueType::BOOL,
defaultRaw: false,
definition: 'Whether OCM invites for contacts are enabled.',
lazy: true,
),
new Entry(
self::OCM_INVITES_OPTIONAL_MAIL,
ValueType::BOOL,
defaultRaw: false,
definition: 'Whether the recipient email field is optional when creating an OCM invite.',
lazy: true,
),
new Entry(
self::OCM_INVITES_ENCODED_COPY_BUTTON,
ValueType::BOOL,
defaultRaw: false,
definition: 'Whether the invite email "Open invite" button uses the encoded WAYF URL instead of the raw token.',
lazy: true,
),
new Entry(
self::OCM_INVITES_DISABLE_SSRF_GUARD,
ValueType::BOOL,
defaultRaw: false,
definition: 'Unsafe development override that disables private-host and localhost checks for OCM invite discovery.',
lazy: true,
),
new Entry(
self::MESH_PROVIDERS_SERVICE,
ValueType::STRING,
defaultRaw: '',
definition: 'Space-separated list of mesh provider service URLs used for WAYF discovery.',
lazy: true,
),
new Entry(
self::WAYF_ENDPOINT,
ValueType::STRING,
defaultRaw: '',
definition: 'Optional override for the base WAYF endpoint used in invite links.',
note: 'If empty, the app route is used at runtime.',
lazy: true,
),
new Entry(
self::FEDERATIONS_CACHE,
ValueType::ARRAY,
defaultRaw: [],
definition: 'Internal cron-maintained cache for discovered federations and expiry metadata.',
flags: IAppConfig::FLAG_SENSITIVE,
lazy: true,
),
new Entry(
self::FEDERATIONS_CACHE_EXPIRES,
ValueType::INT,
defaultRaw: 0,
definition: 'Federations cache refresh expiration time.',
lazy: true,
),
new Entry(
self::FEDERATIONS_CACHE_DELTA_EXPIRES,
ValueType::INT,
defaultRaw: 0,
definition: 'Federations cache update (delta) expiration time.',
lazy: true,
),
];
}
#[\Override]
public function getUserConfigs(): array {
return [];
}
}