Slackclient

Latest version: v2.9.4

Safety actively analyzes 639221 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 5

3.9.0rc1

Refer to [the v3.9.0 release note](https://github.com/slackapi/python-slack-sdk/releases/tag/v3.9.0)

3.8.0

New Features

Token Rotation Support

This version includes the token rotation feature support for better security. Refer to [the API document](https://api.slack.com/authentication/rotation) for the general information about the feature.

How to enable token rotation with this SDK

Apart from the column additions for the feature (specifically, refresh token + expiration date time) and the corresponding changes in your app code, no significant code is needed. Checking the example apps using Flask, Sanic in [this directory](https://github.com/slackapi/python-slack-sdk/tree/main/integration_tests/samples/token_rotation) can be helpful to learn what to do.

In a nutshell, you can call the following `rotate_tokens` method before handling every single incoming request from Slack. As long as your `InstallationStore` support the token rotation patterns, the code below should work as-is.

python
from slack_sdk.oauth.token_rotation import TokenRotator
from slack_sdk.oauth.installation_store import FileInstallationStore

This instance can be singleton; thread-safe
token_rotator = TokenRotator(
These are required for refreshing tokens
client_id=client_id,
client_secret=client_secret,
)
Your own InstallationStore here
installation_store = FileInstallationStore()

def rotate_tokens(
enterprise_id: Optional[str] = None,
team_id: Optional[str] = None,
user_id: Optional[str] = None,
is_enterprise_install: Optional[bool] = None,
):
installation = installation_store.find_installation(
enterprise_id=enterprise_id,
team_id=team_id,
user_id=user_id,
is_enterprise_install=is_enterprise_install,
)
if installation is not None:
If rotation does not occur, refreshed_installation is None
refreshed_installation = token_rotator.perform_token_rotation(installation=installation)
if refreshed_installation is not None:
Save the new access token for the following processes
installation_store.save(refreshed_installation)


Migration guide for `SQLAlchemyInstallationStore` users

If your app uses the built-in `SQLAlchemyInstallationStore` for managing Slack app installations, adding the following database columns is required for this version upgrade. Refer to [the code](https://github.com/slackapi/python-slack-sdk/tree/main/slack_sdk/oauth/installation_store/sqlalchemy) to check the complete ones.

Also, since this version, all the table columns for string data have their max length for better compatibility with MySQL. We recommend setting the same ones for your models.

slack_installations

* `Column("bot_refresh_token", String(200)),`
* `Column("bot_token_expires_at", DateTime),`
* `Column("user_refresh_token", String(200)),`
* `Column("user_token_expires_at", DateTime),`

slack_bots

* `Column("bot_refresh_token", String(200)),`
* `Column("bot_token_expires_at", DateTime),`

Changes

* 1060 Add token rotation feature support - Thanks seratch
* 1040 Set max length for string columns in SQLAlchemy models for MySQL compatibility - Thanks tattee
* 1047 Make WebhookClient (sync/async) send method accept link unfurl params - Thanks srajiang
* 1061 WebClient's paginated response iterator does not work for admin.conversations.search API - Thanks seratch
* 1054 1053 conversations_invite() fails with "error: no_user" - Thanks seratch noperator
* 1044 Updates PythOnBoardingBot tutorial sample to use bolt-python - Thanks srajiang
* 1048 Update command in maintainers guide - Thanks srajiang

---
* All issues/pull requests: https://github.com/slackapi/python-slack-sdk/milestone/38?closed=1
* All changes: https://github.com/slackapi/python-slack-sdk/compare/v3.7.0...v3.8.0

3.7.0

Changes

* 1035 IntervalRunner: don't wait for interval_seconds on shutdown - Thanks KostyaEsmukov
* 1036 Add support for IPv6 in the built-in Socket Mode client - Thanks KostyaEsmukov
* 1029 Update Audit Logs API response properties - Thanks seratch
* 1039 Fix 1038 by adding admin.auth.policy.* API support - Thanks seratch
* 1032 Remove confusing warning messages 1030 - Thanks ido-vcita seratch
* 1034 Remove an outdated link from README - Thanks personalcomputer

---
* All issues/pull requests: https://github.com/slackapi/python-slack-sdk/milestone/37?closed=1
* All changes: https://github.com/slackapi/python-slack-sdk/compare/v3.6.0...v3.7.0

3.6.0

Changes

* 1011 Add admin.apps.uninstall support - Thanks seratch
* 876 Add timepicker block element support - Thanks seratch
* 1022 Fix 1021 by updating View constructor to convert state as dict to class object - Thanks rei-0 seratch
* 1026 Fix 1025 websocket_client based SocketModeClient may fail in on_close callback - Thanks seratch
* 1028 [1027] Update websockets package version requirements - Thanks ggml1

---
* All issues/pull requests: https://github.com/slackapi/python-slack-sdk/milestone/35?closed=1
* All changes: https://github.com/slackapi/python-slack-sdk/compare/v3.5.1...v3.6.0

3.5.1

Changes

* 1009 1010 Invalid version spec: websocket-client - Thanks stevengill jj-ookla
* 1008 Fix an error in comment - Thanks lmn

---
* All issues/pull requests: https://github.com/slackapi/python-slack-sdk/milestone/36?closed=1
* All changes: https://github.com/slackapi/python-slack-sdk/compare/v3.5.0...v3.5.1

3.5.0

New Features

Deletion methods in `InstallationStore` / `AsyncInstallationStore`

Since this version, the following methods are available to use for better installation data management.

* delete_bot / async_delete_bot
* delete_installation / async_delete_installation
* delete_all / async_delete_all

All the built-in implementations already support these methods. We recommend subscribing to `tokens_revoked` / `app_uninstalled` bot events and call these methods in the event handlers.

Module document hosting

We recently started hosting the Python module documents at https://slack.dev/python-slack-sdk/api-docs/slack_sdk/

admin.users.session.* APIs support

The new `admin.users.session.*` APIs for Enterprise Grid customers are supported in `WebClient` and `AsyncWebClient`.

Changes

In addition to the new features mentioned above, we've resolved a few issues in the `slack_sdk.models` classes. Also, we've improved the consistency of docstrings in this project.

* 995 Fix 976 Add deletion methods to InstallationStore - Thanks seratch
* 994 Fix 992 Better documentation about `slack_sdk.models` usage in Web APIs - Thanks invokermain seratch
* 993 Fix 990 `slack_sdk.models.blocks.Option`'s description value is invalid in blocks - Thanks seratch
* 988 987 Add Default of None for selected_options for ViewStateValue - Thanks scott-shields-github
* 985 Improve error response body parser in WebClient - Thanks seratch
* 984 Fix 982 Add admin.users.session.* API support - Thanks seratch
* 980 API document hosting - Thanks seratch
* 981 Rewrite reStructuredText docstrings to use Google style - Thanks seratch
* 979 Add fallback argument in BlockAttachment - Thanks eddyg seratch
* 975 Update modal handling documents - Thanks seratch
* 1001 Fix 1000 RTMClient v2 still requires aiohttp installed (even though it's unused) - Thanks seratch
* 1006 Fix 1003 threading.Thread.setDaemon has been deprecated in Python 3.10 - Thanks tirkarthi seratch
* 1004 Fix 1002 ConversationFilter missing new optional field exclude_external_shared_channels - Thanks slushpupie seratch

---
* All issues/pull requests: https://github.com/slackapi/python-slack-sdk/milestone/31?closed=1
* All changes: https://github.com/slackapi/python-slack-sdk/compare/v3.4.2...v3.5.0

Page 4 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.