From 3fc7686fd97818fec72d68cf70fd7a9122a15f25 Mon Sep 17 00:00:00 2001 From: Tiffany Marrel Date: Fri, 14 Apr 2023 10:59:48 +0200 Subject: [PATCH] [bash] fix use of isBasic condition --- .../src/main/resources/bash/Dockerfile.mustache | 4 ++-- .../src/main/resources/bash/README.mustache | 14 ++++++++++++-- .../src/main/resources/bash/client.mustache | 6 +++--- samples/client/petstore/bash/README.md | 1 + 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/bash/Dockerfile.mustache b/modules/openapi-generator/src/main/resources/bash/Dockerfile.mustache index d7398be47e66..aee05a87bd5d 100644 --- a/modules/openapi-generator/src/main/resources/bash/Dockerfile.mustache +++ b/modules/openapi-generator/src/main/resources/bash/Dockerfile.mustache @@ -39,9 +39,9 @@ For convenience, you can export the following environment variables:\n\ {{#x-codegen-host-env}}$(tput setaf 3){{x-codegen-host-env}}$(tput sgr0) - server URL, e.g. https://example.com:8080\n\{{/x-codegen-host-env}} {{#hasAuthMethods}} {{#authMethods}} -{{#isBasic}} +{{#isBasicBasic}} {{#x-codegen-basicauth-env}}$(tput setaf 3){{x-codegen-basicauth-env}}$(tput sgr0) - basic authentication credentials, e.g.: "username:password"\n\{{/x-codegen-basicauth-env}} -{{/isBasic}} +{{/isBasicBasic}} {{#isApiKey}} {{#x-codegen-apikey-env}}$(tput setaf 3){{x-codegen-apikey-env}}$(tput sgr0) - access token, e.g. "ASDASHJDG63456asdASSD"\n\{{/x-codegen-apikey-env}} {{/isApiKey}} diff --git a/modules/openapi-generator/src/main/resources/bash/README.mustache b/modules/openapi-generator/src/main/resources/bash/README.mustache index 73754bf67740..59b9746b9850 100644 --- a/modules/openapi-generator/src/main/resources/bash/README.mustache +++ b/modules/openapi-generator/src/main/resources/bash/README.mustache @@ -123,8 +123,18 @@ 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 diff --git a/modules/openapi-generator/src/main/resources/bash/client.mustache b/modules/openapi-generator/src/main/resources/bash/client.mustache index 5ea0327e2591..35d77892c098 100644 --- a/modules/openapi-generator/src/main/resources/bash/client.mustache +++ b/modules/openapi-generator/src/main/resources/bash/client.mustache @@ -587,10 +587,10 @@ EOF echo -e "${BOLD}${WHITE}Authentication methods${OFF}" echo -e "" {{#authMethods}} -{{#isBasic}} +{{#isBasicBasic}} echo -e " - ${BLUE}Basic AUTH${OFF} - add '-u :' before ${YELLOW}${OFF}" {{#x-codegen-basicauth-env}}echo -e " or export ${RED}{{x-codegen-basicauth-env}}=':'${OFF}"{{/x-codegen-basicauth-env}} -{{/isBasic}} +{{/isBasicBasic}} {{#isApiKey}} {{#isKeyInHeader}} echo -e " - ${BLUE}Api-key${OFF} - add '${RED}{{keyParamName}}:${OFF}' after ${YELLOW}${OFF}" @@ -693,7 +693,7 @@ print_version() { ############################################################################## print_{{operationId}}_help() { echo "" - echo -e "${BOLD}${WHITE}{{operationId}} - {{{summary}}}{{#authMethods}}${OFF}${BLUE}(AUTH - {{#isBasic}}BASIC{{/isBasic}}{{#isApiKey}}{{#isKeyInHeader}}HEADER{{/isKeyInHeader}}{{#isKeyInQuery}}QUERY{{/isKeyInQuery}}{{/isApiKey}}{{#isOAuth}}OAuth2{{/isOAuth}}){{/authMethods}}${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e "${BOLD}${WHITE}{{operationId}} - {{{summary}}}{{#authMethods}}${OFF}${BLUE}(AUTH - {{#isBasicBasic}}BASIC{{/isBasicBasic}}{{#isApiKey}}{{#isKeyInHeader}}HEADER{{/isKeyInHeader}}{{#isKeyInQuery}}QUERY{{/isKeyInQuery}}{{/isApiKey}}{{#isOAuth}}OAuth2{{/isOAuth}}){{/authMethods}}${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo -e "" {{#vendorExtensions}} {{#x-bash-codegen-description}} diff --git a/samples/client/petstore/bash/README.md b/samples/client/petstore/bash/README.md index 2cd5ff4badd7..fb9aa0dbd427 100644 --- a/samples/client/petstore/bash/README.md +++ b/samples/client/petstore/bash/README.md @@ -226,5 +226,6 @@ Class | Method | HTTP request | Description ## http_basic_test + - **Type**: HTTP basic authentication