-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the default OAuth page renderers not to embed any params without escaping them #882
Conversation
…out escaping them
b634ba9
to
bc61768
Compare
@@ -58,7 +58,7 @@ | |||
), | |||
include_package_data=True, # MANIFEST.in | |||
install_requires=[ | |||
"slack_sdk>=3.20.2,<4", | |||
"slack_sdk>=3.21.1,<4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set the version to use slackapi/python-slack-sdk#1352 for sure
@@ -32,7 +33,7 @@ def _build_callback_success_response( # type: ignore | |||
debug_message = f"Handling an OAuth callback success (request: {request.query})" | |||
self._logger.debug(debug_message) | |||
|
|||
html = self._redirect_uri_page_renderer.render_success_page( | |||
page_content = self._redirect_uri_page_renderer.render_success_page( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed the variable to avoid the name conflict with the module
@@ -142,4 +142,4 @@ def build_detailed_error(reason: str) -> str: | |||
elif reason == "storage_error": | |||
return f"{reason}: The app's server encountered an issue. Contact the app developer." | |||
else: | |||
return f"{reason}: This error code is returned from Slack. Refer to the documents for details." | |||
return f"{html.escape(reason)}: This error code is returned from Slack. Refer to the documents for details." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for safety of custom renderers by developers
Codecov Report
@@ Coverage Diff @@
## main #882 +/- ##
=======================================
Coverage 91.74% 91.74%
=======================================
Files 181 181
Lines 6285 6285
=======================================
Hits 5766 5766
Misses 519 519
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
In the same way with slackapi/python-slack-sdk#1352 , this pull request improves the default OAuth page renderers to escape any parameters when generating the page content.
Category (place an
x
in each of the[ ]
)slack_bolt.App
and/or its core componentsslack_bolt.async_app.AsyncApp
and/or its core componentsslack_bolt.adapter
/docs
Requirements (place an
x
in each[ ]
)Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
./scripts/install_all_and_run_tests.sh
after making the changes.