Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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 @@ -680,7 +680,13 @@ class ApiClient:
:param auth_setting: auth settings for the endpoint
"""
if auth_setting['in'] == 'cookie':
headers['Cookie'] = auth_setting['value']
if not 'Cookie' in headers:
headers['Cookie'] = ""
else:
headers['Cookie'] += "; "
# Account for cookie value containing spaces and special characters, excluding base64 delimiters
cookie_value = quote(str(auth_setting['value']), safe='+/=')
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
headers['Cookie'] += f"{auth_setting['key']}={cookie_value}"
elif auth_setting['in'] == 'header':
if auth_setting['type'] != 'http-signature':
headers[auth_setting['key']] = auth_setting['value']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,13 @@ def _apply_auth_params(
:param auth_setting: auth settings for the endpoint
"""
if auth_setting['in'] == 'cookie':
headers['Cookie'] = auth_setting['value']
if not 'Cookie' in headers:
headers['Cookie'] = ""
else:
headers['Cookie'] += "; "
# Account for cookie value containing spaces and special characters, excluding base64 delimiters
cookie_value = quote(str(auth_setting['value']), safe='+/=')
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
headers['Cookie'] += f"{auth_setting['key']}={cookie_value}"
elif auth_setting['in'] == 'header':
if auth_setting['type'] != 'http-signature':
headers[auth_setting['key']] = auth_setting['value']
Expand Down
8 changes: 7 additions & 1 deletion samples/client/echo_api/python/openapi_client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,13 @@ def _apply_auth_params(
:param auth_setting: auth settings for the endpoint
"""
if auth_setting['in'] == 'cookie':
headers['Cookie'] = auth_setting['value']
if not 'Cookie' in headers:
headers['Cookie'] = ""
else:
headers['Cookie'] += "; "
# Account for cookie value containing spaces and special characters, excluding base64 delimiters
cookie_value = quote(str(auth_setting['value']), safe='+/=')
headers['Cookie'] += f"{auth_setting['key']}={cookie_value}"
elif auth_setting['in'] == 'header':
if auth_setting['type'] != 'http-signature':
headers[auth_setting['key']] = auth_setting['value']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,13 @@ def _apply_auth_params(
:param auth_setting: auth settings for the endpoint
"""
if auth_setting['in'] == 'cookie':
headers['Cookie'] = auth_setting['value']
if not 'Cookie' in headers:
headers['Cookie'] = ""
else:
headers['Cookie'] += "; "
# Account for cookie value containing spaces and special characters, excluding base64 delimiters
cookie_value = quote(str(auth_setting['value']), safe='+/=')
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
headers['Cookie'] += f"{auth_setting['key']}={cookie_value}"
elif auth_setting['in'] == 'header':
if auth_setting['type'] != 'http-signature':
headers[auth_setting['key']] = auth_setting['value']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,13 @@ def _apply_auth_params(
:param auth_setting: auth settings for the endpoint
"""
if auth_setting['in'] == 'cookie':
headers['Cookie'] = auth_setting['value']
if not 'Cookie' in headers:
headers['Cookie'] = ""
else:
headers['Cookie'] += "; "
# Account for cookie value containing spaces and special characters, excluding base64 delimiters
cookie_value = quote(str(auth_setting['value']), safe='+/=')
headers['Cookie'] += f"{auth_setting['key']}={cookie_value}"
elif auth_setting['in'] == 'header':
if auth_setting['type'] != 'http-signature':
headers[auth_setting['key']] = auth_setting['value']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,13 @@ def _apply_auth_params(
:param auth_setting: auth settings for the endpoint
"""
if auth_setting['in'] == 'cookie':
headers['Cookie'] = auth_setting['value']
if not 'Cookie' in headers:
headers['Cookie'] = ""
else:
headers['Cookie'] += "; "
# Account for cookie value containing spaces and special characters, excluding base64 delimiters
cookie_value = quote(str(auth_setting['value']), safe='+/=')
headers['Cookie'] += f"{auth_setting['key']}={cookie_value}"
elif auth_setting['in'] == 'header':
if auth_setting['type'] != 'http-signature':
headers[auth_setting['key']] = auth_setting['value']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,13 @@ def _apply_auth_params(
:param auth_setting: auth settings for the endpoint
"""
if auth_setting['in'] == 'cookie':
headers['Cookie'] = auth_setting['value']
if not 'Cookie' in headers:
headers['Cookie'] = ""
else:
headers['Cookie'] += "; "
# Account for cookie value containing spaces and special characters, excluding base64 delimiters
cookie_value = quote(str(auth_setting['value']), safe='+/=')
headers['Cookie'] += f"{auth_setting['key']}={cookie_value}"
elif auth_setting['in'] == 'header':
if auth_setting['type'] != 'http-signature':
headers[auth_setting['key']] = auth_setting['value']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,13 @@ def _apply_auth_params(
:param auth_setting: auth settings for the endpoint
"""
if auth_setting['in'] == 'cookie':
headers['Cookie'] = auth_setting['value']
if not 'Cookie' in headers:
headers['Cookie'] = ""
else:
headers['Cookie'] += "; "
# Account for cookie value containing spaces and special characters, excluding base64 delimiters
cookie_value = quote(str(auth_setting['value']), safe='+/=')
headers['Cookie'] += f"{auth_setting['key']}={cookie_value}"
elif auth_setting['in'] == 'header':
if auth_setting['type'] != 'http-signature':
headers[auth_setting['key']] = auth_setting['value']
Expand Down
Loading