Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHP] fix use of isBasic condition #15520

Merged
merged 1 commit into from
May 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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