-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
[PHP] Username checks null default value is empty string #1408
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
Comments
@phiamo thanks for reporting the issue. May I know if you've time to contribute a fix to the issue? |
yes, sure, i am just not sure if it would be better to change default values from '' to null, or checking for empty instead would be better? any suggestions? |
I suggest checking for empty as if I remember correctly, that's the approach taken by other clients (e.g. ruby) To be clear, both username and password must be empty in that condition. (there're use cases in which an empty password is sent to the server) |
Sure, so we leave default values empty strings and check for emptyness as
condition...
Am Di., 13. Nov. 2018, 10:29 hat William Cheng <notifications@github.com>
geschrieben:
… I suggest checking for empty as if I remember correctly, that's the
approach taken by other clients (e.g. ruby)
To be clear, both username and password must be empty in that condition.
(there're use cases in which an empty password is sent to the server)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1408 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAMpu6DGQuwLSorEUT86dAeokPLReuXfks5uupEBgaJpZM4YWWl5>
.
|
Right. Ping me in https://gitter.im if you need any help on the PR. Thanks in advance. |
* Reverted path changes. Removed additional files in php petstore-security-test folder. Generated new samples. * Batch and Shell scripts modified to use the same specification files for sample generation. Sample files generated. * Input file path in PHP client batch file equalized with the input path in the shell script file. Samples generated. * Added a missing bracket in the PHP client mustache template. * AbstractPhpCodegen apiDocPath and modelDocPath creation adjusted to always use slash instead of system seperator, since the values will just be used in Markdown files. * Unnecessary samples removed. * Fixed unnecessary diversions between Windows and Linux/Mac paths in PHP codegen. * New samples generated after rebase. * Fixed a sample in TypeScript Angular v2 which caused CI to break.
* master: (758 commits) Add support for free form requests (OpenAPITools#2288) [typescript-rxjs] drop unneeded function wrapping (OpenAPITools#2332) [typescript-fetch] Guard array mapping against undefined on optional array model properties (OpenAPITools#2324) Fix regex in Python server model code (OpenAPITools#2314) Add .travis.yml and Gemfile.lock to ruby security test folder (OpenAPITools#2330) Add a link to CSDN article (OpenAPITools#2331) [Maven] fix Spaces in Windows user path breaks build on test goal (OpenAPITools#2318) [PHP] fix bad links in Model docs (OpenAPITools#2316) [java]: fix datatype for non-multipart file request body (OpenAPITools#2271) Removed JFCote from core team (OpenAPITools#2315) [R sample] fix CircleCI error of outdated sample (OpenAPITools#2313) [Java] Bean Validation for decimalmin/max incorrect when exclusive set (OpenAPITools#2115) Java Spring : fix defaultValue annotation double quoted in api operation (OpenAPITools#2267) Java RESTEASY : fix defaultValue annotation double quoted in api operation (OpenAPITools#2268) [PHP] Username checks OpenAPITools#1408 (OpenAPITools#1892) [typescript-fetch] remove namespaces in enums (OpenAPITools#2123) [java-server-msf4j] fix and upgrade (OpenAPITools#2303) fix test script path in CONTRIBUTING.md (OpenAPITools#2290) Dart queryargs (OpenAPITools#2250) add Blueplanet language (OpenAPITools#2184) ...
Shouldn't this be also applied to the Its default value is empty string as well; when the endpoint supports both bearer and basic auth, first |
@apprme right, please kindly submit a PR to fix the accessToken as well if you've time. Thank you. |
The php generator checks username and password for null, but default values are empty string ''
openapi-generator/modules/openapi-generator/src/main/resources/php/api.mustache
Line 510 in 1522855
openapi-generator/modules/openapi-generator/src/main/resources/php/Configuration.mustache
Line 60 in 1522855
When using e.g. an API which supports Bearer and http auth, the bearer Auth header gets replaced by:
Basic Og==
The text was updated successfully, but these errors were encountered: