Completed
Pull Request — master (#26700)
by Philipp
08:19
created

files_external/lib/Lib/Auth/AmazonS3/AccessKey.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * @author Robin McCorkell <[email protected]>
4
 *
5
 * @copyright Copyright (c) 2016, ownCloud GmbH.
6
 * @license AGPL-3.0
7
 *
8
 * This code is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU Affero General Public License, version 3,
10
 * as published by the Free Software Foundation.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
 * GNU Affero General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Affero General Public License, version 3,
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
19
 *
20
 */
21
22
namespace OCA\Files_External\Lib\Auth\AmazonS3;
23
24
use \OCP\IL10N;
25
use \OCA\Files_External\Lib\DefinitionParameter;
26
use \OCA\Files_External\Lib\Auth\AuthMechanism;
27
28
/**
29
 * Amazon S3 access key authentication
30
 */
31 View Code Duplication
class AccessKey extends AuthMechanism {
0 ignored issues
show
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
32
33
	const SCHEME_AMAZONS3_ACCESSKEY = 'amazons3_accesskey';
34
35
	public function __construct(IL10N $l) {
36
		$this
37
			->setIdentifier('amazons3::accesskey')
38
			->setScheme(self::SCHEME_AMAZONS3_ACCESSKEY)
39
			->setText($l->t('Access key'))
40
			->addParameters([
41
				(new DefinitionParameter('key', $l->t('Access key'))),
42
				(new DefinitionParameter('secret', $l->t('Secret key')))
43
					->setType(DefinitionParameter::VALUE_PASSWORD),
44
			]);
45
	}
46
47
}
48