-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVaasAdmin.php
More file actions
75 lines (65 loc) · 2.63 KB
/
VaasAdmin.php
File metadata and controls
75 lines (65 loc) · 2.63 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
<?php
// SPDX-FileCopyrightText: 2025 Lennart Dohmann <lennart.dohmann@gdata.de>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
namespace OCA\GDataVaas\Settings;
use OCA\GDataVaas\AppInfo\Application;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IAppConfig;
use OCP\Settings\ISettings;
class VaasAdmin implements ISettings {
private IAppConfig $config;
public function __construct(IAppConfig $config) {
$this->config = $config;
}
#[\Override]
public function getForm(): TemplateResponse {
$params = [
'username' => $this->config->getValueString(Application::APP_ID, 'username'),
'password' => $this->config->getValueString(Application::APP_ID, 'password'),
'clientId' => $this->config->getValueString(Application::APP_ID, 'clientId'),
'clientSecret' => $this->config->getValueString(Application::APP_ID, 'clientSecret'),
'authMethod'
=> $this->config->getValueString(
Application::APP_ID, 'authMethod', 'ResourceOwnerPassword'
),
'tokenEndpoint'
=> $this->config->getValueString(
Application::APP_ID,
'tokenEndpoint',
'https://account-staging.gdata.de/realms/vaas-staging/protocol/openid-connect/token'
),
'vaasUrl'
=> $this->config->getValueString(
Application::APP_ID,
'vaasUrl',
'https://gateway.staging.vaas.gdatasecurity.de'
),
'quarantineFolder'
=> $this->config->getValueString(Application::APP_ID, 'quarantineFolder', 'Quarantine'),
'autoScanFiles' => $this->config->getValueBool(Application::APP_ID, 'autoScanFiles'),
'prefixMalicious'
=> $this->config->getValueBool(Application::APP_ID, 'prefixMalicious', true),
'disableUnscannedTag' => $this->config->getValueBool(Application::APP_ID, 'disableUnscannedTag'),
'scanOnlyThis' => $this->config->getValueString(Application::APP_ID, 'scanOnlyThis'),
'doNotScanThis' => $this->config->getValueString(Application::APP_ID, 'doNotScanThis'),
'notifyMail' => $this->config->getValueString(Application::APP_ID, 'notifyMails'),
'sendMailOnVirusUpload'
=> $this->config->getValueBool(Application::APP_ID, 'sendMailOnVirusUpload'),
'maxScanSizeInMB'
=> $this->config->getValueInt(Application::APP_ID, 'maxScanSizeInMB', 256),
'timeout' => $this->config->getValueInt(Application::APP_ID, 'timeout', 300),
'cache' => $this->config->getValueBool(Application::APP_ID, 'cache', true),
'hashlookup' => $this->config->getValueBool(Application::APP_ID, 'hashlookup', true),
];
return new TemplateResponse(Application::APP_ID, 'admin', $params);
}
#[\Override]
public function getSection(): string {
return 'vaas';
}
#[\Override]
public function getPriority(): int {
return 10;
}
}