| @@ 245-249 (lines=5) @@ | ||
| 242 | ->always() |
|
| 243 | ->then(function ($config) { |
|
| 244 | switch ($config['type']) { |
|
| 245 | case 'basic': |
|
| 246 | if (empty($config['username']) || empty($config['password'])) { |
|
| 247 | throw new InvalidConfigurationException('Authentication "basic" requires both "username" and "password".'); |
|
| 248 | } |
|
| 249 | break; |
|
| 250 | case 'bearer': |
|
| 251 | if (empty($config['token'])) { |
|
| 252 | throw new InvalidConfigurationException('Authentication "bearer" requires a "token".'); |
|
| @@ 260-264 (lines=5) @@ | ||
| 257 | throw new InvalidConfigurationException('Authentication "service" requires a "service".'); |
|
| 258 | } |
|
| 259 | break; |
|
| 260 | case 'wsse': |
|
| 261 | if (empty($config['username']) || empty($config['password'])) { |
|
| 262 | throw new InvalidConfigurationException('Authentication "wsse" requires both "username" and "password".'); |
|
| 263 | } |
|
| 264 | break; |
|
| 265 | } |
|
| 266 | ||
| 267 | return $config; |
|