Skip to content

Bearer auth seems to not work with python codegen #8865

@4c74356b41

Description

@4c74356b41

Bug Report Checklist

my spec has this:

components:
  securitySchemes:
    xxx:
      type: http
      scheme: bearer

  responses:
    GenericApiError:
      description: this object is returned in the cases when an API throws an exception
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/JsonSerializedException'

security:
 - xxx: []

after generating the code, i see this in the code:

configuration.py:
    def get_basic_auth_token(self):
        """Gets HTTP basic authentication header (string).

        :return: The token for basic HTTP authentication.
        """
        return urllib3.util.make_headers(
            basic_auth=self.username + ':' + self.password
        ).get('authorization')

    def auth_settings(self):
        """Gets Auth Settings dict for api client.

        :return: The Auth Settings information dict.
        """
        return {
        }
Description

code doesn't use bearer token in the requests

openapi-generator version
java -jar openapi-generator-cli.jar  version           
5.0.1
OpenAPI declaration file content or url

https://github.com/Telecominfraproject/wlan-cloud-services/blob/master/portal-services/src/main/resources/portal-services-openapi.yaml

Generation Details
java -jar openapi-generator-cli.jar generate -i portal-services-openapi.yaml -g python -o portal_client
Related issues/PRs

#1577

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions