[lua] fix use of isBasic condition (#15529)

This commit is contained in:
Tiffany Marrel
2023-05-20 14:06:34 +02:00
committed by GitHub
parent f0d439fbce
commit 7443c95d48
2 changed files with 8 additions and 4 deletions

View File

@@ -53,7 +53,7 @@ Example
r, err := client.Service.Operation(auth, args)
```
{{/isApiKey}}
{{#isBasic}}- **Type**: HTTP basic authentication
{{#isBasicBasic}}- **Type**: HTTP basic authentication
Example
```
@@ -63,7 +63,11 @@ Example
})
r, err := client.Service.Operation(auth, args)
```
{{/isBasic}}
{{/isBasicBasic}}
{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}
{{/isBasicBearer}}
{{#isHttpSignature}}- **Type**: HTTP signature authentication
{{/isHttpSignature}}
{{#isOAuth}}- **Type**: OAuth
- **Flow**: {{{flow}}}
- **Authorization URL**: {{{authorizationUrl}}}

View File

@@ -92,10 +92,10 @@ function {{classname}}:{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{
-- TODO: api key in query '{{keyParamName}}'
{{/isKeyInQuery}}
{{/isApiKey}}
{{#isBasic}}
{{#isBasicBasic}}
-- HTTP basic auth
req.readers:upsert("authorization", "Basic " .. basexx.to_base64(self.http_username .. " " .. self.http_password))
{{/isBasic}}
{{/isBasicBasic}}
{{#isOAuth}}
-- oAuth
if self.access_token then