Skip to content

Conversation

@Yang-33
Copy link
Contributor

@Yang-33 Yang-33 commented Nov 17, 2023

No description provided.

@Yang-33
Copy link
Contributor Author

Yang-33 commented Nov 17, 2023

(I should replace mustache with pebble...)

Copy link
Contributor

@tokuhirom tokuhirom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I think that's good.
However, I've started to feel that there might be a problem with the OpenAPI definition at the 'module_attach' part.

Only for the 'Attach by operation of the module channel provider', it should be possible to specify Authorization: Basic {base64({Channel ID}:{Channel Secret})}. For other APIs, they should be defined with Authorization Bearer.

But it's not being done that way now. The definition is wrong. The python sdk, unlike other SDKs, is looking at 'isBasicBearer', causing all APIs, including 'Attach by operation of the module channel provider', to become unusable. Because this makes all APIs unusable, I thought it would be better to not look at 'isBasicBearer' for now and merge it first, and then fix the openapi definition.

@tokuhirom
Copy link
Contributor

ah, no. i misunderstood. module-attach.yml only contains the endpoint of the Attach by operation of the module channel provider.

@tokuhirom
Copy link
Contributor

Maybe something like this is even better.

        self.default_headers['Authorization'] = '{% if isBasicBearer %}Basic{% else %}Bearer{% endif %} ' + configuration.access_token

@Yang-33
Copy link
Contributor Author

Yang-33 commented Nov 21, 2023

Thank you for your comment! As you said, I forgot module-attach uses Basic Authentication. I fixed this in https://github.com/line/line-bot-sdk-python/pull/557/files/30f803f7e0d89cb623b0453dd7778e55eb8cc54f..b6cc1aac82143e761c3c03f2b60435044a51a28a. PTAL again!

@Yang-33 Yang-33 requested a review from tokuhirom November 21, 2023 01:33
@Yang-33 Yang-33 merged commit 942c418 into line:master Nov 21, 2023
@Yang-33 Yang-33 deleted the channel-access-token-doesnt-require-auth-token branch November 21, 2023 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants