Skip to content

Commit

Permalink
ChannelAccessToken client doesn't have to require channel access token (
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang-33 committed Nov 21, 2023
1 parent 41efcf9 commit 942c418
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 8 deletions.
Expand Up @@ -67,7 +67,14 @@ class ApiClient(object):
self.default_headers = {}
if header_name is not None:
self.default_headers[header_name] = header_value
self.default_headers['Authorization'] = 'Bearer ' + configuration.access_token
{{#authMethods}}
{{#isBasicBearer}}
self.default_headers['Authorization'] = 'Bearer {{access_token}}' + configuration.access_token
{{/isBasicBearer}}
{{^isBasicBearer}}
self.default_headers['Authorization'] = 'Basic {{access_token}}' + configuration.access_token
{{/isBasicBearer}}
{{/authMethods}}
self.cookie = cookie
# Set default User-Agent.
self.user_agent = f"line-bot-sdk-python/{__version__}"
Expand Down
Expand Up @@ -67,7 +67,14 @@ class AsyncApiClient(object):
self.default_headers = {}
if header_name is not None:
self.default_headers[header_name] = header_value
self.default_headers['Authorization'] = 'Bearer ' + configuration.access_token
{{#authMethods}}
{{#isBasicBearer}}
self.default_headers['Authorization'] = 'Bearer {{access_token}}' + configuration.access_token
{{/isBasicBearer}}
{{^isBasicBearer}}
self.default_headers['Authorization'] = 'Basic {{access_token}}' + configuration.access_token
{{/isBasicBearer}}
{{/authMethods}}
self.cookie = cookie
# Set default User-Agent.
self.user_agent = f"line-bot-sdk-python/{__version__}"
Expand Down
2 changes: 1 addition & 1 deletion linebot/v3/moduleattach/api_client.py
Expand Up @@ -74,7 +74,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers = {}
if header_name is not None:
self.default_headers[header_name] = header_value
self.default_headers['Authorization'] = 'Bearer ' + configuration.access_token
self.default_headers['Authorization'] = 'Basic ' + configuration.access_token
self.cookie = cookie
# Set default User-Agent.
self.user_agent = f"line-bot-sdk-python/{__version__}"
Expand Down
2 changes: 1 addition & 1 deletion linebot/v3/moduleattach/async_api_client.py
Expand Up @@ -74,7 +74,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers = {}
if header_name is not None:
self.default_headers[header_name] = header_value
self.default_headers['Authorization'] = 'Bearer ' + configuration.access_token
self.default_headers['Authorization'] = 'Basic ' + configuration.access_token
self.cookie = cookie
# Set default User-Agent.
self.user_agent = f"line-bot-sdk-python/{__version__}"
Expand Down
1 change: 0 additions & 1 deletion linebot/v3/oauth/api_client.py
Expand Up @@ -74,7 +74,6 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers = {}
if header_name is not None:
self.default_headers[header_name] = header_value
self.default_headers['Authorization'] = 'Bearer ' + configuration.access_token
self.cookie = cookie
# Set default User-Agent.
self.user_agent = f"line-bot-sdk-python/{__version__}"
Expand Down
1 change: 0 additions & 1 deletion linebot/v3/oauth/async_api_client.py
Expand Up @@ -74,7 +74,6 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers = {}
if header_name is not None:
self.default_headers[header_name] = header_value
self.default_headers['Authorization'] = 'Bearer ' + configuration.access_token
self.cookie = cookie
# Set default User-Agent.
self.user_agent = f"line-bot-sdk-python/{__version__}"
Expand Down
1 change: 0 additions & 1 deletion linebot/v3/webhooks/api_client.py
Expand Up @@ -74,7 +74,6 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers = {}
if header_name is not None:
self.default_headers[header_name] = header_value
self.default_headers['Authorization'] = 'Bearer ' + configuration.access_token
self.cookie = cookie
# Set default User-Agent.
self.user_agent = f"line-bot-sdk-python/{__version__}"
Expand Down
1 change: 0 additions & 1 deletion linebot/v3/webhooks/async_api_client.py
Expand Up @@ -74,7 +74,6 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers = {}
if header_name is not None:
self.default_headers[header_name] = header_value
self.default_headers['Authorization'] = 'Bearer ' + configuration.access_token
self.cookie = cookie
# Set default User-Agent.
self.user_agent = f"line-bot-sdk-python/{__version__}"
Expand Down

0 comments on commit 942c418

Please sign in to comment.