Skip to content

Commit

Permalink
CTOOLS-297: revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-Storey-Finbourne committed Aug 15, 2024
1 parent 039a1bc commit e1ad7ee
Showing 1 changed file with 15 additions and 40 deletions.
55 changes: 15 additions & 40 deletions generate/default_templates/configuration.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -493,26 +493,15 @@ conf = {{{packageName}}}.Configuration(
{{/isBasicBasic}}
{{#isBasicBearer}}
if self.access_token is not None:
if isinstance(self.access_token, str):
auth['{{name}}'] = {
'type': 'bearer',
'in': 'header',
{{#bearerFormat}}
'format': '{{{.}}}',
{{/bearerFormat}}
'key': 'Authorization',
'value': 'Bearer ' + self.access_token
}
else:
auth['{{name}}'] = {
'type': 'bearer',
'in': 'header',
{{#bearerFormat}}
'format': '{{{.}}}',
{{/bearerFormat}}
'key': 'Authorization',
'value': 'Bearer ' + self.access_token.data
}
auth['{{name}}'] = {
'type': 'bearer',
'in': 'header',
{{#bearerFormat}}
'format': '{{{.}}}',
{{/bearerFormat}}
'key': 'Authorization',
'value': 'Bearer ' + self.access_token
}
{{/isBasicBearer}}
{{#isHttpSignature}}
if self.signing_info is not None:
Expand All @@ -526,26 +515,12 @@ conf = {{{packageName}}}.Configuration(
{{/isBasic}}
{{#isOAuth}}
if self.access_token is not None:
if isinstance(self.access_token, str):
auth['{{name}}'] = {
'type': 'bearer',
'in': 'header',
{{#bearerFormat}}
'format': '{{{.}}}',
{{/bearerFormat}}
'key': 'Authorization',
'value': 'Bearer ' + self.access_token
}
else:
auth['{{name}}'] = {
'type': 'bearer',
'in': 'header',
{{#bearerFormat}}
'format': '{{{.}}}',
{{/bearerFormat}}
'key': 'Authorization',
'value': 'Bearer ' + self.access_token.data
}
auth['{{name}}'] = {
'type': 'oauth2',
'in': 'header',
'key': 'Authorization',
'value': 'Bearer ' + self.access_token
}
{{/isOAuth}}
{{/authMethods}}
return auth
Expand Down

0 comments on commit e1ad7ee

Please sign in to comment.