Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion slack_bolt/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
error_authorize_conflicts,
warning_bot_only_conflicts,
debug_return_listener_middleware_response,
info_default_oauth_settings_loaded,
)
from slack_bolt.middleware import (
Middleware,
Expand Down Expand Up @@ -174,7 +175,11 @@ def __init__(
# initialize with the default settings
oauth_settings = OAuthSettings()

if oauth_flow:
if oauth_flow is None and installation_store is None:
# show info-level log for avoiding confusions
self._framework_logger.info(info_default_oauth_settings_loaded())

if oauth_flow is not None:
self._oauth_flow = oauth_flow
installation_store = select_consistent_installation_store(
client_id=self._oauth_flow.client_id,
Expand Down
5 changes: 5 additions & 0 deletions slack_bolt/app/async_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
error_oauth_flow_invalid_type_async,
warning_bot_only_conflicts,
debug_return_listener_middleware_response,
info_default_oauth_settings_loaded,
)
from slack_bolt.lazy_listener.asyncio_runner import AsyncioLazyListenerRunner
from slack_bolt.listener.async_listener import AsyncListener, AsyncCustomListener
Expand Down Expand Up @@ -184,6 +185,10 @@ def __init__(
# initialize with the default settings
oauth_settings = AsyncOAuthSettings()

if oauth_flow is None and installation_store is None:
# show info-level log for avoiding confusions
self._framework_logger.info(info_default_oauth_settings_loaded())

if oauth_flow:
if not isinstance(oauth_flow, AsyncOAuthFlow):
raise BoltError(error_oauth_flow_invalid_type_async())
Expand Down
13 changes: 12 additions & 1 deletion slack_bolt/logger/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def warning_client_prioritized_and_token_skipped() -> str:

def warning_token_skipped() -> str:
return (
"As you gave `installation_store`/`authorize` as well, `token` will be unused."
"As `installation_store` or `authorize` has been used, "
"`token` (or SLACK_BOT_TOKEN env variable) will be ignored."
)


Expand Down Expand Up @@ -104,6 +105,16 @@ def warning_skip_uncommon_arg_name(arg_name: str) -> str:
# -------------------------------


def info_default_oauth_settings_loaded() -> str:
return (
"As you've set SLACK_CLIENT_ID and SLACK_CLIENT_SECRET env variables, "
"Bolt has enabled the file-based InstallationStore/OAuthStateStore for you. "
"Note that these file-based stores are for local development. "
"If you'd like to use a different data store, set the oauth_settings argument in the App constructor. "
"Please refer to https://slack.dev/bolt-python/concepts#authenticating-oauth for more details."
)


# -------------------------------
# Debug
# -------------------------------
Expand Down