Skip to content

Commit

Permalink
[PHP] fix use of isBasic condition (#15520)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffmaelite committed May 20, 2023
1 parent b7a9373 commit 7eeb7f6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ No model defined in this package
{{/-last}}
{{/authMethods}}
{{#authMethods}}
{{#isBasic}}
{{#isBasicBasic}}
### Security schema `{{name}}`
> Important! To make Basic authentication work you need to extend [\{{authPackage}}\{{abstractNamePrefix}}Authenticator{{abstractNameSuffix}}]({{authSrcPath}}/{{abstractNamePrefix}}Authenticator{{abstractNameSuffix}}.php) class by [\{{authPackage}}\BasicAuthenticator](./src/Auth/BasicAuthenticator.php) class.

{{/isBasic}}
{{/isBasicBasic}}
{{#isApiKey}}
### Security schema `{{name}}`
> Important! To make ApiKey authentication work you need to extend [\{{authPackage}}\{{abstractNamePrefix}}Authenticator{{abstractNameSuffix}}]({{authSrcPath}}/{{abstractNamePrefix}}Authenticator{{abstractNameSuffix}}.php) class by [\{{authPackage}}\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ No model defined in this package
{{/-last}}
{{/authMethods}}
{{#authMethods}}
{{#isBasic}}
{{#isBasicBasic}}
### Security schema `{{name}}`
> Important! To make Basic authentication work you need to extend [\{{authPackage}}\{{abstractNamePrefix}}Authenticator{{abstractNameSuffix}}]({{authSrcPath}}/{{abstractNamePrefix}}Authenticator{{abstractNameSuffix}}.php) class by [\{{authPackage}}\BasicAuthenticator](./src/Auth/BasicAuthenticator.php) class.

{{/isBasic}}
{{/isBasicBasic}}
{{#isApiKey}}
### Security schema `{{name}}`
> Important! To make ApiKey authentication work you need to extend [\{{authPackage}}\{{abstractNamePrefix}}Authenticator{{abstractNameSuffix}}]({{authSrcPath}}/{{abstractNamePrefix}}Authenticator{{abstractNameSuffix}}.php) class by [\{{authPackage}}\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,12 @@ Class | Method | HTTP request | Description
- **API key parameter name**: {{{keyParamName}}}
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
{{/isApiKey}}
{{#isBasic}}- **Type**: HTTP basic authentication
{{/isBasic}}
{{#isBasicBasic}}- **Type**: HTTP basic authentication
{{/isBasicBasic}}
{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}
{{/isBasicBearer}}
{{#isHttpSignature}}- **Type**: HTTP signature authentication
{{/isHttpSignature}}
{{#isOAuth}}- **Type**: OAuth
- **Flow**: {{{flow}}}
- **Authorization URL**: {{{authorizationUrl}}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ class {{controllerName}} extends Controller
$security{{name}} = $request->cookies->get('{{keyParamName}}');
{{/isKeyInCookie}}
{{/isApiKey}}
{{#isBasic}}
{{#isBasicBasic}}
// HTTP basic authentication required
$security{{name}} = $request->headers->get('authorization');
{{/isBasic}}
{{/isBasicBasic}}
{{#isOAuth}}
// Oauth required
$security{{name}} = $request->headers->get('authorization');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ Class | Method | HTTP request | Description

- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}
{{/isBasicBearer}}
{{#isHttpSignature}}

- **Type**: HTTP signature authentication
{{/isHttpSignature}}
{{/isBasic}}
{{#isOAuth}}

Expand Down
2 changes: 2 additions & 0 deletions samples/client/petstore/php/OpenAPIClient-php/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ Authentication schemes defined for the API:

### http_signature_test

- **Type**: HTTP signature authentication

## Tests

To run the tests, use:
Expand Down

0 comments on commit 7eeb7f6

Please sign in to comment.