mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-10-13 16:03:43 +00:00
update php samples
This commit is contained in:
parent
ec0edf433a
commit
a55525c634
@ -905,25 +905,25 @@ class RegisterRoutes
|
||||
$authenticatorConfig = [
|
||||
'path' => '/',
|
||||
'authenticator' => new ApiKeyAuthenticator,
|
||||
'regex' => '/\s+(.*)$/i',
|
||||
'regex' => '/\s*(.*)$/i',
|
||||
'argument' => null,
|
||||
'attribute' => 'authorization_token',
|
||||
'error' => ['OpenAPIServer\Auth\ApiKeyAuthenticator', 'handleUnauthorized'],
|
||||
];
|
||||
if ($authMethod['isKeyInHeader']) {
|
||||
$authenticatorConfig = [
|
||||
$authenticatorConfig += [
|
||||
'header' => $authMethod['keyParamName'],
|
||||
'parameter' => null,
|
||||
'cookie' => null,
|
||||
];
|
||||
} else if ($authMethod['isKeyInQuery']) {
|
||||
$authenticatorConfig = [
|
||||
$authenticatorConfig += [
|
||||
'header' => null,
|
||||
'parameter' => $authMethod['keyParamName'],
|
||||
'cookie' => null,
|
||||
];
|
||||
} else if ($authMethod['isKeyInCookie']) {
|
||||
$authenticatorConfig = [
|
||||
$authenticatorConfig += [
|
||||
'header' => null,
|
||||
'parameter' => null,
|
||||
'cookie' => $authMethod['keyParamName'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user