Completed
Push — master ( 8646f0...c3aea9 )
by Morris
278:02 queued 258:09
created
apps/oauth2/appinfo/routes.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -20,31 +20,31 @@
 block discarded – undo
20 20
  */
21 21
 
22 22
 return [
23
-	'routes' => [
24
-		[
25
-			'name' => 'Settings#addClient',
26
-			'url' => '/clients',
27
-			'verb' => 'POST',
28
-		],
29
-		[
30
-			'name' => 'Settings#getClients',
31
-			'url' => '/clients',
32
-			'verb' => 'GET',
33
-		],
34
-		[
35
-			'name' => 'Settings#deleteClient',
36
-			'url' => '/clients/{id}',
37
-			'verb' => 'DELETE'
38
-		],
39
-		[
40
-			'name' => 'LoginRedirector#authorize',
41
-			'url' => '/authorize',
42
-			'verb' => 'GET',
43
-		],
44
-		[
45
-			'name' => 'OauthApi#getToken',
46
-			'url' => '/api/v1/token',
47
-			'verb' => 'POST'
48
-		],
49
-	],
23
+    'routes' => [
24
+        [
25
+            'name' => 'Settings#addClient',
26
+            'url' => '/clients',
27
+            'verb' => 'POST',
28
+        ],
29
+        [
30
+            'name' => 'Settings#getClients',
31
+            'url' => '/clients',
32
+            'verb' => 'GET',
33
+        ],
34
+        [
35
+            'name' => 'Settings#deleteClient',
36
+            'url' => '/clients/{id}',
37
+            'verb' => 'DELETE'
38
+        ],
39
+        [
40
+            'name' => 'LoginRedirector#authorize',
41
+            'url' => '/authorize',
42
+            'verb' => 'GET',
43
+        ],
44
+        [
45
+            'name' => 'OauthApi#getToken',
46
+            'url' => '/api/v1/token',
47
+            'verb' => 'POST'
48
+        ],
49
+    ],
50 50
 ];
Please login to merge, or discard this patch.
apps/oauth2/lib/Controller/SettingsController.php 1 patch
Indentation   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -32,82 +32,82 @@
 block discarded – undo
32 32
 use OCP\Security\ISecureRandom;
33 33
 
34 34
 class SettingsController extends Controller {
35
-	/** @var ClientMapper */
36
-	private $clientMapper;
37
-	/** @var ISecureRandom */
38
-	private $secureRandom;
39
-	/** @var AccessTokenMapper  */
40
-	private $accessTokenMapper;
41
-	/** @var  DefaultTokenMapper */
42
-	private $defaultTokenMapper;
35
+    /** @var ClientMapper */
36
+    private $clientMapper;
37
+    /** @var ISecureRandom */
38
+    private $secureRandom;
39
+    /** @var AccessTokenMapper  */
40
+    private $accessTokenMapper;
41
+    /** @var  DefaultTokenMapper */
42
+    private $defaultTokenMapper;
43 43
 
44
-	const validChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
44
+    const validChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
45 45
 
46
-	/**
47
-	 * @param string $appName
48
-	 * @param IRequest $request
49
-	 * @param ClientMapper $clientMapper
50
-	 * @param ISecureRandom $secureRandom
51
-	 * @param AccessTokenMapper $accessTokenMapper
52
-	 * @param DefaultTokenMapper $defaultTokenMapper
53
-	 */
54
-	public function __construct(string $appName,
55
-								IRequest $request,
56
-								ClientMapper $clientMapper,
57
-								ISecureRandom $secureRandom,
58
-								AccessTokenMapper $accessTokenMapper,
59
-								DefaultTokenMapper $defaultTokenMapper
60
-	) {
61
-		parent::__construct($appName, $request);
62
-		$this->secureRandom = $secureRandom;
63
-		$this->clientMapper = $clientMapper;
64
-		$this->accessTokenMapper = $accessTokenMapper;
65
-		$this->defaultTokenMapper = $defaultTokenMapper;
66
-	}
46
+    /**
47
+     * @param string $appName
48
+     * @param IRequest $request
49
+     * @param ClientMapper $clientMapper
50
+     * @param ISecureRandom $secureRandom
51
+     * @param AccessTokenMapper $accessTokenMapper
52
+     * @param DefaultTokenMapper $defaultTokenMapper
53
+     */
54
+    public function __construct(string $appName,
55
+                                IRequest $request,
56
+                                ClientMapper $clientMapper,
57
+                                ISecureRandom $secureRandom,
58
+                                AccessTokenMapper $accessTokenMapper,
59
+                                DefaultTokenMapper $defaultTokenMapper
60
+    ) {
61
+        parent::__construct($appName, $request);
62
+        $this->secureRandom = $secureRandom;
63
+        $this->clientMapper = $clientMapper;
64
+        $this->accessTokenMapper = $accessTokenMapper;
65
+        $this->defaultTokenMapper = $defaultTokenMapper;
66
+    }
67 67
 
68
-	public function addClient(string $name,
69
-							  string $redirectUri): JSONResponse {
70
-		$client = new Client();
71
-		$client->setName($name);
72
-		$client->setRedirectUri($redirectUri);
73
-		$client->setSecret($this->secureRandom->generate(64, self::validChars));
74
-		$client->setClientIdentifier($this->secureRandom->generate(64, self::validChars));
75
-		$client = $this->clientMapper->insert($client);
68
+    public function addClient(string $name,
69
+                                string $redirectUri): JSONResponse {
70
+        $client = new Client();
71
+        $client->setName($name);
72
+        $client->setRedirectUri($redirectUri);
73
+        $client->setSecret($this->secureRandom->generate(64, self::validChars));
74
+        $client->setClientIdentifier($this->secureRandom->generate(64, self::validChars));
75
+        $client = $this->clientMapper->insert($client);
76 76
 
77
-		$result = [
78
-			'id' => $client->getId(),
79
-			'name' => $client->getName(),
80
-			'redirectUri' => $client->getRedirectUri(),
81
-			'clientId' => $client->getClientIdentifier(),
82
-			'clientSecret' => $client->getSecret(),
83
-		];
77
+        $result = [
78
+            'id' => $client->getId(),
79
+            'name' => $client->getName(),
80
+            'redirectUri' => $client->getRedirectUri(),
81
+            'clientId' => $client->getClientIdentifier(),
82
+            'clientSecret' => $client->getSecret(),
83
+        ];
84 84
 
85
-		return new JSONResponse($result);
86
-	}
85
+        return new JSONResponse($result);
86
+    }
87 87
 
88
-	public function deleteClient(int $id): JSONResponse {
89
-		$client = $this->clientMapper->getByUid($id);
90
-		$this->accessTokenMapper->deleteByClientId($id);
91
-		$this->defaultTokenMapper->deleteByName($client->getName());
92
-		$this->clientMapper->delete($client);
93
-		return new JSONResponse([]);
94
-	}
88
+    public function deleteClient(int $id): JSONResponse {
89
+        $client = $this->clientMapper->getByUid($id);
90
+        $this->accessTokenMapper->deleteByClientId($id);
91
+        $this->defaultTokenMapper->deleteByName($client->getName());
92
+        $this->clientMapper->delete($client);
93
+        return new JSONResponse([]);
94
+    }
95 95
 
96
-	public function getClients(): JSONResponse {
97
-		$clients = $this->clientMapper->getClients();
96
+    public function getClients(): JSONResponse {
97
+        $clients = $this->clientMapper->getClients();
98 98
 
99
-		$result = [];
99
+        $result = [];
100 100
 
101
-		foreach ($clients as $client) {
102
-			$result[] = [
103
-				'id' => $client->getId(),
104
-				'name' => $client->getName(),
105
-				'redirectUri' => $client->getRedirectUri(),
106
-				'clientId' => $client->getClientIdentifier(),
107
-				'clientSecret' => $client->getSecret(),
108
-			];
109
-		}
101
+        foreach ($clients as $client) {
102
+            $result[] = [
103
+                'id' => $client->getId(),
104
+                'name' => $client->getName(),
105
+                'redirectUri' => $client->getRedirectUri(),
106
+                'clientId' => $client->getClientIdentifier(),
107
+                'clientSecret' => $client->getSecret(),
108
+            ];
109
+        }
110 110
 
111
-		return new JSONResponse($result);
112
-	}
111
+        return new JSONResponse($result);
112
+    }
113 113
 }
Please login to merge, or discard this patch.
apps/oauth2/lib/Settings/Admin.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -27,20 +27,20 @@
 block discarded – undo
27 27
 
28 28
 class Admin implements ISettings {
29 29
 
30
-	public function getForm(): TemplateResponse {
31
-		return new TemplateResponse(
32
-			'oauth2',
33
-			'admin',
34
-			[],
35
-			''
36
-		);
37
-	}
30
+    public function getForm(): TemplateResponse {
31
+        return new TemplateResponse(
32
+            'oauth2',
33
+            'admin',
34
+            [],
35
+            ''
36
+        );
37
+    }
38 38
 
39
-	public function getSection(): string {
40
-		return 'security';
41
-	}
39
+    public function getSection(): string {
40
+        return 'security';
41
+    }
42 42
 
43
-	public function getPriority(): int {
44
-		return 0;
45
-	}
43
+    public function getPriority(): int {
44
+        return 0;
45
+    }
46 46
 }
Please login to merge, or discard this patch.