@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | ->where('id = :id', [':id' => $authCodeKey]) |
| 72 | 72 | ->one($this->db); |
| 73 | 73 | if ($entity !== false) { |
| 74 | - throw new DuplicateKeyException('Duplicate key "' . $authCodeKey . '"'); |
|
| 74 | + throw new DuplicateKeyException('Duplicate key "'.$authCodeKey.'"'); |
|
| 75 | 75 | } |
| 76 | 76 | $values = $authCode->getDirtyAttributes($attributes); |
| 77 | 77 | $authCodeParameters = []; |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | ->where('id = :id', [':id' => $values[$modelKey]]) |
| 138 | 138 | ->one($this->db); |
| 139 | 139 | if ($entity !== false) { |
| 140 | - throw new DuplicateKeyException('Duplicate key "' . $values[$modelKey] . '"'); |
|
| 140 | + throw new DuplicateKeyException('Duplicate key "'.$values[$modelKey].'"'); |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | $authCodeKey = isset($values[$modelKey]) ? $values[$modelKey] : $authCode->getKey(); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | ->where('id = :id', [':id' => $scope->id]) |
| 73 | 73 | ->one($this->db); |
| 74 | 74 | if ($entity !== false) { |
| 75 | - throw new DuplicateKeyException('Duplicate key "' . $scope->id . '"'); |
|
| 75 | + throw new DuplicateKeyException('Duplicate key "'.$scope->id.'"'); |
|
| 76 | 76 | } |
| 77 | 77 | $values = $scope->getDirtyAttributes($attributes); |
| 78 | 78 | $scopeParameters = []; |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | ->where('id = :id', [':id' => $values[$modelKey]]) |
| 127 | 127 | ->one($this->db); |
| 128 | 128 | if ($entity !== false) { |
| 129 | - throw new DuplicateKeyException('Duplicate key "' . $values[$modelKey] . '"'); |
|
| 129 | + throw new DuplicateKeyException('Duplicate key "'.$values[$modelKey].'"'); |
|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | $scopeKey = isset($values[$modelKey]) ? $values[$modelKey] : $scope->getKey(); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | ->where('id = :id', [':id' => $cypherKeyKey]) |
| 67 | 67 | ->one($this->db); |
| 68 | 68 | if ($entity !== false) { |
| 69 | - throw new DuplicateKeyException('Duplicate key "' . $cypherKeyKey . '"'); |
|
| 69 | + throw new DuplicateKeyException('Duplicate key "'.$cypherKeyKey.'"'); |
|
| 70 | 70 | } |
| 71 | 71 | $values = $cypherKey->getDirtyAttributes($attributes); |
| 72 | 72 | $cypherKeyParameters = []; |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | ->where('id = :id', [':id' => $values[$modelKey]]) |
| 121 | 121 | ->one($this->db); |
| 122 | 122 | if ($entity !== false) { |
| 123 | - throw new DuplicateKeyException('Duplicate key "' . $values[$modelKey] . '"'); |
|
| 123 | + throw new DuplicateKeyException('Duplicate key "'.$values[$modelKey].'"'); |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | $cypherKeyKey = isset($values[$modelKey]) ? $values[$modelKey] : $cypherKey->getKey(); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | ->where('id = :id', [':id' => $jtiKey]) |
| 68 | 68 | ->one($this->db); |
| 69 | 69 | if ($entity !== false) { |
| 70 | - throw new DuplicateKeyException('Duplicate key "' . $jtiKey . '"'); |
|
| 70 | + throw new DuplicateKeyException('Duplicate key "'.$jtiKey.'"'); |
|
| 71 | 71 | } |
| 72 | 72 | $values = $jti->getDirtyAttributes($attributes); |
| 73 | 73 | $jtisParameters = []; |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | ->where('id = :id', [':id' => $values[$modelKey]]) |
| 122 | 122 | ->one($this->db); |
| 123 | 123 | if ($entity !== false) { |
| 124 | - throw new DuplicateKeyException('Duplicate key "' . $values[$modelKey] . '"'); |
|
| 124 | + throw new DuplicateKeyException('Duplicate key "'.$values[$modelKey].'"'); |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | $jtiKey = isset($values[$modelKey]) ? $values[$modelKey] : $jti->getKey(); |
@@ -233,7 +233,7 @@ |
||
| 233 | 233 | } else { |
| 234 | 234 | Yii::$app->session->setFlash('error', [ |
| 235 | 235 | 'error' => 'invalid_scope', |
| 236 | - 'error_description' => 'Scope ' . $scope . ' does not exist.', |
|
| 236 | + 'error_description' => 'Scope '.$scope.' does not exist.', |
|
| 237 | 237 | ], false); |
| 238 | 238 | return $this->redirect(['error']); |
| 239 | 239 | } |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | /** |
| 193 | 193 | * @var int duration of login time for multiple authorize calls |
| 194 | 194 | */ |
| 195 | - public $loginDuration = 60 * 60 * 24 * 30; |
|
| 195 | + public $loginDuration = 60*60*24*30; |
|
| 196 | 196 | |
| 197 | 197 | /** |
| 198 | 198 | * @var bool configure authorization code (enforce_redirect) |
@@ -273,19 +273,19 @@ discard block |
||
| 273 | 273 | } |
| 274 | 274 | $this->setUpDi($app); |
| 275 | 275 | if (empty($this->baseEndPoint) === false) { |
| 276 | - $this->baseEndPoint = trim($this->baseEndPoint, '/') . '/'; |
|
| 276 | + $this->baseEndPoint = trim($this->baseEndPoint, '/').'/'; |
|
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | if ($app instanceof ConsoleApplication) { |
| 280 | 280 | $this->mapConsoleControllers($app); |
| 281 | 281 | } else { |
| 282 | 282 | $app->getUrlManager()->addRules([ |
| 283 | - ['verb' => 'POST', 'pattern' => $this->baseEndPoint . 'token', 'route' => $this->id . '/token/index'], |
|
| 284 | - ['verb' => 'OPTIONS', 'pattern' => $this->baseEndPoint . 'token', 'route' => $this->id . '/token/options'], |
|
| 285 | - ['verb' => 'GET', 'pattern' => $this->baseEndPoint . 'authorize', 'route' => $this->id . '/authorize/index'], |
|
| 286 | - ['pattern' => $this->baseEndPoint . 'authorize-login', 'route' => $this->id . '/authorize/login'], |
|
| 287 | - ['pattern' => $this->baseEndPoint . 'authorize-application', 'route' => $this->id . '/authorize/authorize'], |
|
| 288 | - ['pattern' => $this->baseEndPoint . 'authorize-error', 'route' => $this->id . '/authorize/error'], |
|
| 283 | + ['verb' => 'POST', 'pattern' => $this->baseEndPoint.'token', 'route' => $this->id.'/token/index'], |
|
| 284 | + ['verb' => 'OPTIONS', 'pattern' => $this->baseEndPoint.'token', 'route' => $this->id.'/token/options'], |
|
| 285 | + ['verb' => 'GET', 'pattern' => $this->baseEndPoint.'authorize', 'route' => $this->id.'/authorize/index'], |
|
| 286 | + ['pattern' => $this->baseEndPoint.'authorize-login', 'route' => $this->id.'/authorize/login'], |
|
| 287 | + ['pattern' => $this->baseEndPoint.'authorize-application', 'route' => $this->id.'/authorize/authorize'], |
|
| 288 | + ['pattern' => $this->baseEndPoint.'authorize-error', 'route' => $this->id.'/authorize/error'], |
|
| 289 | 289 | ]); |
| 290 | 290 | } |
| 291 | 291 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | protected function getJtiKey($jid) |
| 55 | 55 | { |
| 56 | - return $this->namespace . ':' . $jid; |
|
| 56 | + return $this->namespace.':'.$jid; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | protected function getSubjectJtisKey($sid) |
| 64 | 64 | { |
| 65 | - return $this->subjectNamespace . ':' . $sid . ':jtis'; |
|
| 65 | + return $this->subjectNamespace.':'.$sid.':jtis'; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | protected function getClientJtisKey($cid) |
| 73 | 73 | { |
| 74 | - return $this->clientNamespace . ':' . $cid . ':jtis'; |
|
| 74 | + return $this->clientNamespace.':'.$cid.':jtis'; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | protected function getJtiListKey() |
| 81 | 81 | { |
| 82 | - return $this->namespace . ':keys'; |
|
| 82 | + return $this->namespace.':keys'; |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | protected function getSubjectListKey() |
| 89 | 89 | { |
| 90 | - return $this->subjectNamespace . ':keys'; |
|
| 90 | + return $this->subjectNamespace.':keys'; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | //check if record exists |
| 134 | 134 | $entityStatus = (int)$this->db->executeCommand('EXISTS', [$jtiKey]); |
| 135 | 135 | if ($entityStatus === 1) { |
| 136 | - throw new DuplicateKeyException('Duplicate key "' . $jtiKey . '"'); |
|
| 136 | + throw new DuplicateKeyException('Duplicate key "'.$jtiKey.'"'); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | $values = $jti->getDirtyAttributes($attributes); |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $newJtiKey = $this->getJtiKey($values[$modelKey]); |
| 214 | 214 | $entityStatus = (int)$this->db->executeCommand('EXISTS', [$newJtiKey]); |
| 215 | 215 | if ($entityStatus === 1) { |
| 216 | - throw new DuplicateKeyException('Duplicate key "' . $newJtiKey . '"'); |
|
| 216 | + throw new DuplicateKeyException('Duplicate key "'.$newJtiKey.'"'); |
|
| 217 | 217 | } |
| 218 | 218 | } |
| 219 | 219 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | protected function getAccessTokenKey($aid) |
| 57 | 57 | { |
| 58 | - return $this->namespace . ':' . $aid; |
|
| 58 | + return $this->namespace.':'.$aid; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | protected function getUserAccessTokensKey($uid) |
| 67 | 67 | { |
| 68 | - return $this->userNamespace . ':' . $uid . ':accessTokens'; |
|
| 68 | + return $this->userNamespace.':'.$uid.':accessTokens'; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | protected function getClientAccessTokensKey($cid) |
| 77 | 77 | { |
| 78 | - return $this->clientNamespace . ':' . $cid . ':accessTokens'; |
|
| 78 | + return $this->clientNamespace.':'.$cid.':accessTokens'; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | protected function getAccessTokenListKey() |
| 85 | 85 | { |
| 86 | - return $this->namespace . ':keys'; |
|
| 86 | + return $this->namespace.':keys'; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | protected function getUserListKey() |
| 93 | 93 | { |
| 94 | - return $this->userNamespace . ':keys'; |
|
| 94 | + return $this->userNamespace.':keys'; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | //check if record exists |
| 138 | 138 | $entityStatus = (int)$this->db->executeCommand('EXISTS', [$accessTokenKey]); |
| 139 | 139 | if ($entityStatus === 1) { |
| 140 | - throw new DuplicateKeyException('Duplicate key "' . $accessTokenKey . '"'); |
|
| 140 | + throw new DuplicateKeyException('Duplicate key "'.$accessTokenKey.'"'); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | $values = $accessToken->getDirtyAttributes($attributes); |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $newAccessTokenKey = $this->getAccessTokenKey($values[$modelKey]); |
| 218 | 218 | $entityStatus = (int)$this->db->executeCommand('EXISTS', [$newAccessTokenKey]); |
| 219 | 219 | if ($entityStatus === 1) { |
| 220 | - throw new DuplicateKeyException('Duplicate key "' . $newAccessTokenKey . '"'); |
|
| 220 | + throw new DuplicateKeyException('Duplicate key "'.$newAccessTokenKey.'"'); |
|
| 221 | 221 | } |
| 222 | 222 | } |
| 223 | 223 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | protected function getClientKey($cid) |
| 52 | 52 | { |
| 53 | - return $this->namespace . ':' . $cid; |
|
| 53 | + return $this->namespace.':'.$cid; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | protected function getClientUsersListKey($cid) |
| 62 | 62 | { |
| 63 | - return $this->namespace . ':' . $cid . ':users'; |
|
| 63 | + return $this->namespace.':'.$cid.':users'; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | protected function getUserClientsListKey($uid) |
| 72 | 72 | { |
| 73 | - return $this->userNamespace . ':' . $uid . ':clients'; |
|
| 73 | + return $this->userNamespace.':'.$uid.':clients'; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | protected function getClientListKey() |
| 80 | 80 | { |
| 81 | - return $this->namespace . ':keys'; |
|
| 81 | + return $this->namespace.':keys'; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | //check if record exists |
| 116 | 116 | $entityStatus = (int)$this->db->executeCommand('EXISTS', [$clientKey]); |
| 117 | 117 | if ($entityStatus === 1) { |
| 118 | - throw new DuplicateKeyException('Duplicate key "' . $clientKey . '"'); |
|
| 118 | + throw new DuplicateKeyException('Duplicate key "'.$clientKey.'"'); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | $values = $client->getDirtyAttributes($attributes); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $newClientKey = $this->getClientKey($values[$modelKey]); |
| 176 | 176 | $entityStatus = (int)$this->db->executeCommand('EXISTS', [$newClientKey]); |
| 177 | 177 | if ($entityStatus === 1) { |
| 178 | - throw new DuplicateKeyException('Duplicate key "' . $newClientKey . '"'); |
|
| 178 | + throw new DuplicateKeyException('Duplicate key "'.$newClientKey.'"'); |
|
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | |