Back to Bolt Python

slack_bolt.middleware.ssl_check.async_ssl_check API documentation

docs/reference/middleware/ssl_check/async_ssl_check.html

1.28.01.9 KB
Original Source

Classes

class AsyncSslCheck (verification_token: str | None = None,base_logger: logging.Logger | None = None)#Expand source code

class AsyncSslCheck(SslCheck, AsyncMiddleware):
    async def async_process(
        self,
        *,
        req: AsyncBoltRequest,
        resp: BoltResponse,
        # As this method is not supposed to be invoked by bolt-python users,
        # the naming conflict with the built-in one affects
        # only the internals of this method
        next: Callable[[], Awaitable[BoltResponse]],
    ) -> BoltResponse:
        if self._is_ssl_check_request(req.body):
            if self._verify_token_if_needed(req.body):
                return self._build_error_response()
            return self._build_success_response()
        else:
            return await next()

A middleware can process request data before other middleware and listener functions.

Handles ssl_check requests. Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details.

Args

verification_token The verification token to check (optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack/#deprecation) base_logger The base logger

Ancestors

Inherited members

  • SslCheck:

    • logger
    • name
    • process
    • verification_token
  • AsyncMiddleware:

    • async_process