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

[javascript] fix use of isBasicBasic and isBasicBearer conditions #15522

Merged
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 @@ -204,11 +204,17 @@ Class | Method | HTTP request | Description
{{/isApiKey}}
{{#isBasic}}
{{#isBasicBasic}}

- **Type**: HTTP basic authentication
{{/isBasicBasic}}
{{#isBasicBearer}}

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur
}
{{/isKeyInQuery}}
{{/isApiKey}}
{{#isBasic}}
{{#isBasicBasic}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wing328 note: this is not only about documentation: it fixes the fact that the below lines would be generated in case of operations with bearer or signature auth

// http basic authentication required
if (configuration && (configuration.username || configuration.password)) {
localVarHeaderParameter["Authorization"] = "Basic " + btoa(configuration.username + ":" + configuration.password);
}
{{/isBasic}}
{{/isBasicBasic}}
{{#isOAuth}}
// oauth required
if (configuration && configuration.accessToken) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ Class | Method | HTTP request | Description
{{#isBasicBearer}}
- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}
{{/isBasicBearer}}
{{#isHttpSignature}}
- **Type**: HTTP signature authentication
{{/isHttpSignature}}
{{/isBasic}}
{{#isOAuth}}

Expand Down
1 change: 1 addition & 0 deletions samples/client/petstore/javascript-apollo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,5 @@ Authentication schemes defined for the API:

### http_signature_test

- **Type**: HTTP signature authentication

1 change: 1 addition & 0 deletions samples/client/petstore/javascript-es6/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,5 @@ Authentication schemes defined for the API:

### http_signature_test

- **Type**: HTTP signature authentication

1 change: 1 addition & 0 deletions samples/client/petstore/javascript-promise-es6/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,5 @@ Authentication schemes defined for the API:

### http_signature_test

- **Type**: HTTP signature authentication