Skip to content

Commit

Permalink
version 1.16.1
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Dec 19, 2022
1 parent 8ed4912 commit c99c23f
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 20 deletions.
44 changes: 34 additions & 10 deletions docs/api-docs/slack_bolt/adapter/pyramid/handler.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,37 @@ <h1 class="title">Module <code>slack_bolt.adapter.pyramid.handler</code></h1>
if self.app.oauth_flow is not None:
oauth_flow: OAuthFlow = self.app.oauth_flow
if request.path == oauth_flow.install_path:
bolt_resp = oauth_flow.handle_installation(to_bolt_request(request))
bolt_req = _attach_pyramid_request_to_context(to_bolt_request(request), request)
bolt_resp = oauth_flow.handle_installation(bolt_req)
return to_pyramid_response(bolt_resp)
elif request.path == oauth_flow.redirect_uri_path:
bolt_resp = oauth_flow.handle_callback(to_bolt_request(request))
bolt_req = _attach_pyramid_request_to_context(to_bolt_request(request), request)
bolt_resp = oauth_flow.handle_callback(bolt_req)
return to_pyramid_response(bolt_resp)
elif request.method == &#34;POST&#34;:
bolt_req = to_bolt_request(request)
bolt_req = _attach_pyramid_request_to_context(to_bolt_request(request), request)
bolt_resp = self.app.dispatch(bolt_req)
return to_pyramid_response(bolt_resp)

return Response(status=404, body=&#34;Not found&#34;)</code></pre>
return Response(status=404, body=&#34;Not found&#34;)


def _attach_pyramid_request_to_context(
bolt_req: BoltRequest,
request: Request,
) -&gt; BoltRequest:
# To enable developers to access request-scope attributes such as dbsession,
# this adapter exposes the underlying pyramid_request object to Bolt listeners
#
# Developers can access request props this way:
# @app.event(&#34;app_mention&#34;)
# def handle_app_mention_events(context, logger):
# req = context[&#34;pyramid_request&#34;]
# all = req.dbsession.query(MyModel).all()
# logger.info(all)
#
bolt_req.context[&#34;pyramid_request&#34;] = request
return bolt_req</code></pre>
</details>
</section>
<section>
Expand Down Expand Up @@ -164,13 +184,15 @@ <h2 class="section-title" id="header-classes">Classes</h2>
if self.app.oauth_flow is not None:
oauth_flow: OAuthFlow = self.app.oauth_flow
if request.path == oauth_flow.install_path:
bolt_resp = oauth_flow.handle_installation(to_bolt_request(request))
bolt_req = _attach_pyramid_request_to_context(to_bolt_request(request), request)
bolt_resp = oauth_flow.handle_installation(bolt_req)
return to_pyramid_response(bolt_resp)
elif request.path == oauth_flow.redirect_uri_path:
bolt_resp = oauth_flow.handle_callback(to_bolt_request(request))
bolt_req = _attach_pyramid_request_to_context(to_bolt_request(request), request)
bolt_resp = oauth_flow.handle_callback(bolt_req)
return to_pyramid_response(bolt_resp)
elif request.method == &#34;POST&#34;:
bolt_req = to_bolt_request(request)
bolt_req = _attach_pyramid_request_to_context(to_bolt_request(request), request)
bolt_resp = self.app.dispatch(bolt_req)
return to_pyramid_response(bolt_resp)

Expand All @@ -192,13 +214,15 @@ <h3>Methods</h3>
if self.app.oauth_flow is not None:
oauth_flow: OAuthFlow = self.app.oauth_flow
if request.path == oauth_flow.install_path:
bolt_resp = oauth_flow.handle_installation(to_bolt_request(request))
bolt_req = _attach_pyramid_request_to_context(to_bolt_request(request), request)
bolt_resp = oauth_flow.handle_installation(bolt_req)
return to_pyramid_response(bolt_resp)
elif request.path == oauth_flow.redirect_uri_path:
bolt_resp = oauth_flow.handle_callback(to_bolt_request(request))
bolt_req = _attach_pyramid_request_to_context(to_bolt_request(request), request)
bolt_resp = oauth_flow.handle_callback(bolt_req)
return to_pyramid_response(bolt_resp)
elif request.method == &#34;POST&#34;:
bolt_req = to_bolt_request(request)
bolt_req = _attach_pyramid_request_to_context(to_bolt_request(request), request)
bolt_resp = self.app.dispatch(bolt_req)
return to_pyramid_response(bolt_resp)

Expand Down
16 changes: 10 additions & 6 deletions docs/api-docs/slack_bolt/adapter/pyramid/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ <h2 class="section-title" id="header-classes">Classes</h2>
if self.app.oauth_flow is not None:
oauth_flow: OAuthFlow = self.app.oauth_flow
if request.path == oauth_flow.install_path:
bolt_resp = oauth_flow.handle_installation(to_bolt_request(request))
bolt_req = _attach_pyramid_request_to_context(to_bolt_request(request), request)
bolt_resp = oauth_flow.handle_installation(bolt_req)
return to_pyramid_response(bolt_resp)
elif request.path == oauth_flow.redirect_uri_path:
bolt_resp = oauth_flow.handle_callback(to_bolt_request(request))
bolt_req = _attach_pyramid_request_to_context(to_bolt_request(request), request)
bolt_resp = oauth_flow.handle_callback(bolt_req)
return to_pyramid_response(bolt_resp)
elif request.method == &#34;POST&#34;:
bolt_req = to_bolt_request(request)
bolt_req = _attach_pyramid_request_to_context(to_bolt_request(request), request)
bolt_resp = self.app.dispatch(bolt_req)
return to_pyramid_response(bolt_resp)

Expand All @@ -96,13 +98,15 @@ <h3>Methods</h3>
if self.app.oauth_flow is not None:
oauth_flow: OAuthFlow = self.app.oauth_flow
if request.path == oauth_flow.install_path:
bolt_resp = oauth_flow.handle_installation(to_bolt_request(request))
bolt_req = _attach_pyramid_request_to_context(to_bolt_request(request), request)
bolt_resp = oauth_flow.handle_installation(bolt_req)
return to_pyramid_response(bolt_resp)
elif request.path == oauth_flow.redirect_uri_path:
bolt_resp = oauth_flow.handle_callback(to_bolt_request(request))
bolt_req = _attach_pyramid_request_to_context(to_bolt_request(request), request)
bolt_resp = oauth_flow.handle_callback(bolt_req)
return to_pyramid_response(bolt_resp)
elif request.method == &#34;POST&#34;:
bolt_req = to_bolt_request(request)
bolt_req = _attach_pyramid_request_to_context(to_bolt_request(request), request)
bolt_resp = self.app.dispatch(bolt_req)
return to_pyramid_response(bolt_resp)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h1 class="title">Module <code>slack_bolt.middleware.middleware_error_handler</c
request: BoltRequest,
response: Optional[BoltResponse],
):
message = f&#34;Failed to run a middleware middleware (error: {error})&#34;
message = f&#34;Failed to run a middleware (error: {error})&#34;
self.logger.exception(message)</code></pre>
</details>
</section>
Expand Down Expand Up @@ -173,7 +173,7 @@ <h3>Inherited members</h3>
request: BoltRequest,
response: Optional[BoltResponse],
):
message = f&#34;Failed to run a middleware middleware (error: {error})&#34;
message = f&#34;Failed to run a middleware (error: {error})&#34;
self.logger.exception(message)</code></pre>
</details>
<h3>Ancestors</h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/api-docs/slack_bolt/version.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1 class="title">Module <code>slack_bolt.version</code></h1>
<span>Expand source code</span>
</summary>
<pre><code class="python">&#34;&#34;&#34;Check the latest version at https://pypi.org/project/slack-bolt/&#34;&#34;&#34;
__version__ = &#34;1.16.0&#34;</code></pre>
__version__ = &#34;1.16.1&#34;</code></pre>
</details>
</section>
<section>
Expand Down
2 changes: 1 addition & 1 deletion slack_bolt/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Check the latest version at https://pypi.org/project/slack-bolt/"""
__version__ = "1.16.0"
__version__ = "1.16.1"

0 comments on commit c99c23f

Please sign in to comment.