2020-08-12 09:16:33 -04:00
< ? php
declare ( strict_types = 1 );
/**
* @ copyright Copyright ( c ) 2020 Morris Jobke < hey @ morrisjobke . de >
*
2020-08-24 08:54:25 -04:00
* @ author Morris Jobke < hey @ morrisjobke . de >
2020-08-12 09:16:33 -04:00
*
* @ license GNU AGPL version 3 or any later version
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 of the
* License , or ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
2021-06-04 15:52:51 -04:00
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
2020-08-12 09:16:33 -04:00
* GNU Affero General Public License for more details .
*
* You should have received a copy of the GNU Affero General Public License
* along with this program . If not , see < http :// www . gnu . org / licenses />.
*
*/
namespace OCA\Settings\SetupChecks ;
use OCP\IConfig ;
use OCP\IL10N ;
use OCP\IURLGenerator ;
2022-05-30 03:59:52 -04:00
use OCP\SetupCheck\ISetupCheck ;
use OCP\SetupCheck\SetupResult ;
2020-08-12 09:16:33 -04:00
2022-05-30 03:59:52 -04:00
class LegacySSEKeyFormat implements ISetupCheck {
2023-09-28 10:15:00 -04:00
public function __construct (
private IL10N $l10n ,
private IConfig $config ,
private IURLGenerator $urlGenerator ,
) {
2020-08-12 09:16:33 -04:00
}
2022-05-30 03:59:52 -04:00
public function getCategory () : string {
return 'security' ;
2020-08-12 09:16:33 -04:00
}
2022-05-30 03:59:52 -04:00
public function getName () : string {
2023-10-24 05:40:03 -04:00
return $this -> l10n -> t ( 'Old server-side-encryption' );
2020-08-12 09:16:33 -04:00
}
2022-05-30 03:59:52 -04:00
public function run () : SetupResult {
if ( $this -> config -> getSystemValueBool ( 'encryption.legacy_format_support' , false ) === false ) {
2023-10-24 05:40:03 -04:00
return SetupResult :: success ( $this -> l10n -> t ( 'Disabled' ));
2022-05-30 03:59:52 -04:00
}
2023-10-16 11:23:47 -04:00
return SetupResult :: warning ( $this -> l10n -> t ( 'The old server-side-encryption format is enabled. We recommend disabling this.' ), $this -> urlGenerator -> linkToDocs ( 'admin-sse-legacy-format' ));
2020-08-12 09:16:33 -04:00
}
}