From 1d9bb81dfc8c7bec234a0cc456b27aaae4c67be1 Mon Sep 17 00:00:00 2001 From: slack-ruby-ci-bot Date: Mon, 31 Aug 2026 23:21:46 +0000 Subject: [PATCH] Update API from slack-api-ref@d980b88 (2026-08-31) - Add oauth.v2.beginShortTokenRotation and oauth.v2.completeShortTokenRotation methods - Add an is_embedded_preview_enabled argument to admin.apps.config.set - Add a session_status argument to chat.stopStream - Add an include_list argument to slackLists.items.list - Add rotation_not_found, token_too_long, user_is_external_guest, and user_not_authenticated error codes --- CHANGELOG.md | 5 +++ bin/commands/admin_apps_config.rb | 1 + bin/commands/chat.rb | 1 + bin/commands/oauth_v2.rb | 21 ++++++++++++ bin/commands/slackLists_items.rb | 1 + .../web/api/endpoints/admin_apps_config.rb | 2 ++ lib/slack/web/api/endpoints/chat.rb | 2 ++ lib/slack/web/api/endpoints/oauth_v2.rb | 33 +++++++++++++++++++ .../web/api/endpoints/slackLists_items.rb | 2 ++ lib/slack/web/api/errors.rb | 8 +++++ lib/slack/web/api/slack-api-ref | 2 +- spec/slack/web/api/endpoints/oauth_v2_spec.rb | 19 +++++++++++ 12 files changed, 96 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff0e78ba..d9a1688f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,11 @@ * [#597](https://github.com/slack-ruby/slack-ruby-client/pull/597): Add AgentsSessions and AppsManagedPermissions endpoint modules for agents.sessions and apps.managedPermissions methods - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). * [#597](https://github.com/slack-ruby/slack-ruby-client/pull/597): Increase conversations.invite users limit from 100 to 1000 - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). * [#597](https://github.com/slack-ruby/slack-ruby-client/pull/597): Add new Slack API error codes - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#600](https://github.com/slack-ruby/slack-ruby-client/pull/600): Add oauth.v2.beginShortTokenRotation and oauth.v2.completeShortTokenRotation methods - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#600](https://github.com/slack-ruby/slack-ruby-client/pull/600): Add an is_embedded_preview_enabled argument to admin.apps.config.set - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#600](https://github.com/slack-ruby/slack-ruby-client/pull/600): Add a session_status argument to chat.stopStream - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#600](https://github.com/slack-ruby/slack-ruby-client/pull/600): Add an include_list argument to slackLists.items.list - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#600](https://github.com/slack-ruby/slack-ruby-client/pull/600): Add rotation_not_found, token_too_long, user_is_external_guest, and user_not_authenticated error codes - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). * Your contribution here. ### 3.2.0 (2026/07/05) diff --git a/bin/commands/admin_apps_config.rb b/bin/commands/admin_apps_config.rb index 6e77f2b3..caa1afe0 100644 --- a/bin/commands/admin_apps_config.rb +++ b/bin/commands/admin_apps_config.rb @@ -23,6 +23,7 @@ class App c.flag 'workflow_auth_strategy', desc: 'The workflow auth permission. Can be one of builder_choice or end_user_only.' c.flag 'rich_link_preview_type', desc: 'Indicates the app-level override for rich link preview. Unsupported for free teams.' c.flag 'domain_restrictions', desc: 'Domain restrictions for the app. Should be an object with two properties: urls and emails. Each is an array of strings, and each sets the allowed URLs and emails for connector authorization, respectively.' + c.flag 'is_embedded_preview_enabled', desc: 'Whether the app is allowed to render embedded previews of its work objects on this team. Only settable for apps that have declared embed domains, as the setting does not apply to any other app, and only where the embedded preview feature is available to the caller.' c.action do |_global_options, options, _args| puts JSON.dump(@client.admin_apps_config_set(options)) end diff --git a/bin/commands/chat.rb b/bin/commands/chat.rb index f07b8739..84468eb8 100644 --- a/bin/commands/chat.rb +++ b/bin/commands/chat.rb @@ -169,6 +169,7 @@ class App c.flag 'markdown_text', desc: 'Accepts message text formatted in markdown. Limit this field to 12,000 characters.' c.flag 'blocks', desc: 'A list of blocks that will be rendered at the bottom of the finalized message.' c.flag 'metadata', desc: 'JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.' + c.flag 'session_status', desc: 'The session status to set after stopping the stream.' c.action do |_global_options, options, _args| puts JSON.dump(@client.chat_stopStream(options)) end diff --git a/bin/commands/oauth_v2.rb b/bin/commands/oauth_v2.rb index e6659ac5..bab7d7fa 100644 --- a/bin/commands/oauth_v2.rb +++ b/bin/commands/oauth_v2.rb @@ -22,6 +22,27 @@ class App end end + g.desc 'Call this to rotate the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.completeShortTokenRotation to confirm the change.' + g.long_desc %( Call this to rotate the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.completeShortTokenRotation to confirm the change. ) + g.command 'beginShortTokenRotation' do |c| + c.flag 'client_id', desc: 'Issued when you created your application. Must be the app the token being rotated was issued to.' + c.flag 'client_secret', desc: 'Issued when you created your application.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.oauth_v2_beginShortTokenRotation(options)) + end + end + + g.desc 'Call this to finish rotating the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.beginShortTokenRotation to start the process.' + g.long_desc %( Call this to finish rotating the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.beginShortTokenRotation to start the process. ) + g.command 'completeShortTokenRotation' do |c| + c.flag 'client_id', desc: 'Issued when you created your application. Must be the app the token being rotated was issued to.' + c.flag 'client_secret', desc: 'Issued when you created your application.' + c.flag 'new_token', desc: 'The new xoxp token returned by oauth.v2.beginShortTokenRotation.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.oauth_v2_completeShortTokenRotation(options)) + end + end + g.desc 'Exchanges a legacy access token for a new expiring access token and refresh token' g.long_desc %( Exchanges a legacy access token for a new expiring access token and refresh token ) g.command 'exchange' do |c| diff --git a/bin/commands/slackLists_items.rb b/bin/commands/slackLists_items.rb index edfb6da6..3c1ddf78 100644 --- a/bin/commands/slackLists_items.rb +++ b/bin/commands/slackLists_items.rb @@ -56,6 +56,7 @@ class App c.flag 'limit', desc: 'The maximum number of records to return.' c.flag 'cursor', desc: 'Next cursor for pagination.' c.flag 'archived', desc: 'Boolean indicating whether archived items or normal items should be returned.' + c.flag 'include_list', desc: 'Set to true to also return the parent list object, including its title, column schema, and total row count. Defaults to false to keep the response small.' c.action do |_global_options, options, _args| puts JSON.dump(@client.slackLists_items_list(options)) end diff --git a/lib/slack/web/api/endpoints/admin_apps_config.rb b/lib/slack/web/api/endpoints/admin_apps_config.rb index 6bc5fd84..7b2c6d82 100644 --- a/lib/slack/web/api/endpoints/admin_apps_config.rb +++ b/lib/slack/web/api/endpoints/admin_apps_config.rb @@ -30,6 +30,8 @@ def admin_apps_config_lookup(options = {}) # Indicates the app-level override for rich link preview. Unsupported for free teams. # @option options [object] :domain_restrictions # Domain restrictions for the app. Should be an object with two properties: urls and emails. Each is an array of strings, and each sets the allowed URLs and emails for connector authorization, respectively. + # @option options [boolean] :is_embedded_preview_enabled + # Whether the app is allowed to render embedded previews of its work objects on this team. Only settable for apps that have declared embed domains, as the setting does not apply to any other app, and only where the embedded preview feature is available to the caller. # @see https://api.slack.com/methods/admin.apps.config.set # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.config/admin.apps.config.set.json def admin_apps_config_set(options = {}) diff --git a/lib/slack/web/api/endpoints/chat.rb b/lib/slack/web/api/endpoints/chat.rb index 09ff451e..b16fa746 100644 --- a/lib/slack/web/api/endpoints/chat.rb +++ b/lib/slack/web/api/endpoints/chat.rb @@ -293,6 +293,8 @@ def chat_startStream(options = {}) # A list of blocks that will be rendered at the bottom of the finalized message. # @option options [string] :metadata # JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace. + # @option options [enum] :session_status + # The session status to set after stopping the stream. # @see https://api.slack.com/methods/chat.stopStream # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.stopStream.json def chat_stopStream(options = {}) diff --git a/lib/slack/web/api/endpoints/oauth_v2.rb b/lib/slack/web/api/endpoints/oauth_v2.rb index f4af0ce5..afbf5285 100644 --- a/lib/slack/web/api/endpoints/oauth_v2.rb +++ b/lib/slack/web/api/endpoints/oauth_v2.rb @@ -31,6 +31,39 @@ def oauth_v2_access(options = {}) post('oauth.v2.access', options) end + # + # Call this to rotate the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.completeShortTokenRotation to confirm the change. + # + # @option options [string] :client_id + # Issued when you created your application. Must be the app the token being rotated was issued to. + # @option options [string] :client_secret + # Issued when you created your application. + # @see https://api.slack.com/methods/oauth.v2.beginShortTokenRotation + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/oauth.v2/oauth.v2.beginShortTokenRotation.json + def oauth_v2_beginShortTokenRotation(options = {}) + raise ArgumentError, 'Required arguments :client_id missing' if options[:client_id].nil? + raise ArgumentError, 'Required arguments :client_secret missing' if options[:client_secret].nil? + post('oauth.v2.beginShortTokenRotation', options) + end + + # + # Call this to finish rotating the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.beginShortTokenRotation to start the process. + # + # @option options [string] :client_id + # Issued when you created your application. Must be the app the token being rotated was issued to. + # @option options [string] :client_secret + # Issued when you created your application. + # @option options [string] :new_token + # The new xoxp token returned by oauth.v2.beginShortTokenRotation. + # @see https://api.slack.com/methods/oauth.v2.completeShortTokenRotation + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/oauth.v2/oauth.v2.completeShortTokenRotation.json + def oauth_v2_completeShortTokenRotation(options = {}) + raise ArgumentError, 'Required arguments :client_id missing' if options[:client_id].nil? + raise ArgumentError, 'Required arguments :client_secret missing' if options[:client_secret].nil? + raise ArgumentError, 'Required arguments :new_token missing' if options[:new_token].nil? + post('oauth.v2.completeShortTokenRotation', options) + end + # # Exchanges a legacy access token for a new expiring access token and refresh token # diff --git a/lib/slack/web/api/endpoints/slackLists_items.rb b/lib/slack/web/api/endpoints/slackLists_items.rb index c25d82ea..44b2e727 100644 --- a/lib/slack/web/api/endpoints/slackLists_items.rb +++ b/lib/slack/web/api/endpoints/slackLists_items.rb @@ -82,6 +82,8 @@ def slackLists_items_info(options = {}) # Next cursor for pagination. # @option options [boolean] :archived # Boolean indicating whether archived items or normal items should be returned. + # @option options [boolean] :include_list + # Set to true to also return the parent list object, including its title, column schema, and total row count. Defaults to false to keep the response small. # @see https://api.slack.com/methods/slackLists.items.list # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/slackLists.items/slackLists.items.list.json def slackLists_items_list(options = {}) diff --git a/lib/slack/web/api/errors.rb b/lib/slack/web/api/errors.rb index 08aaf01e..2925c8fe 100644 --- a/lib/slack/web/api/errors.rb +++ b/lib/slack/web/api/errors.rb @@ -699,6 +699,7 @@ class RestrictedActionThreadOnlyChannel < SlackError; end class RestrictedPlanLevel < SlackError; end class RestrictedTooMany < SlackError; end class RetentionOverrideNotAllowed < SlackError; end + class RotationNotFound < SlackError; end class RowIdNotProvided < SlackError; end class RowNotFound < SlackError; end class RtmConnectRequired < SlackError; end @@ -754,6 +755,7 @@ class TokenExpired < SlackError; end class TokenNotFound < SlackError; end class TokenRevoked < SlackError; end class TokenRotationNotEnabled < SlackError; end + class TokenTooLong < SlackError; end class TooLarge < SlackError; end class TooLong < SlackError; end class TooManyAttachments < SlackError; end @@ -825,11 +827,13 @@ class UserEmailUnverified < SlackError; end class UserIsAlreadyDeleted < SlackError; end class UserIsBot < SlackError; end class UserIsDeactivated < SlackError; end + class UserIsExternalGuest < SlackError; end class UserIsNotAGuest < SlackError; end class UserIsNotGuest < SlackError; end class UserIsRestricted < SlackError; end class UserMustBeAdmin < SlackError; end class UserMustBeInWorkspace < SlackError; end + class UserNotAuthenticated < SlackError; end class UserNotFound < SlackError; end class UserNotInChannel < SlackError; end class UserNotVisible < SlackError; end @@ -1542,6 +1546,7 @@ class WorkspaceNotEligible < SlackError; end 'restricted_plan_level' => RestrictedPlanLevel, 'restricted_too_many' => RestrictedTooMany, 'retention_override_not_allowed' => RetentionOverrideNotAllowed, + 'rotation_not_found' => RotationNotFound, 'row_id_not_provided' => RowIdNotProvided, 'row_not_found' => RowNotFound, 'rtm_connect_required' => RtmConnectRequired, @@ -1597,6 +1602,7 @@ class WorkspaceNotEligible < SlackError; end 'token_not_found' => TokenNotFound, 'token_revoked' => TokenRevoked, 'token_rotation_not_enabled' => TokenRotationNotEnabled, + 'token_too_long' => TokenTooLong, 'too_large' => TooLarge, 'too_long' => TooLong, 'too_many_attachments' => TooManyAttachments, @@ -1668,11 +1674,13 @@ class WorkspaceNotEligible < SlackError; end 'user_is_already_deleted' => UserIsAlreadyDeleted, 'user_is_bot' => UserIsBot, 'user_is_deactivated' => UserIsDeactivated, + 'user_is_external_guest' => UserIsExternalGuest, 'user_is_not_a_guest' => UserIsNotAGuest, 'user_is_not_guest' => UserIsNotGuest, 'user_is_restricted' => UserIsRestricted, 'user_must_be_admin' => UserMustBeAdmin, 'user_must_be_in_workspace' => UserMustBeInWorkspace, + 'user_not_authenticated' => UserNotAuthenticated, 'user_not_found' => UserNotFound, 'user_not_in_channel' => UserNotInChannel, 'user_not_visible' => UserNotVisible, diff --git a/lib/slack/web/api/slack-api-ref b/lib/slack/web/api/slack-api-ref index d980b887..60c629e9 160000 --- a/lib/slack/web/api/slack-api-ref +++ b/lib/slack/web/api/slack-api-ref @@ -1 +1 @@ -Subproject commit d980b887f601ac588c33f9b682ea11404c3a5d8a +Subproject commit 60c629e9c7a6070f0a15d11080150ebfd3df082e diff --git a/spec/slack/web/api/endpoints/oauth_v2_spec.rb b/spec/slack/web/api/endpoints/oauth_v2_spec.rb index 8d7916f8..c3b977f2 100644 --- a/spec/slack/web/api/endpoints/oauth_v2_spec.rb +++ b/spec/slack/web/api/endpoints/oauth_v2_spec.rb @@ -5,6 +5,25 @@ RSpec.describe Slack::Web::Api::Endpoints::OauthV2 do let(:client) { Slack::Web::Client.new } + context 'oauth.v2_beginShortTokenRotation' do + it 'requires client_id' do + expect { client.oauth_v2_beginShortTokenRotation(client_secret: %q[e1b9e11dfcd19c1982d5de12921e17e8c]) }.to raise_error ArgumentError, /Required arguments :client_id missing/ + end + it 'requires client_secret' do + expect { client.oauth_v2_beginShortTokenRotation(client_id: %q[4123121235.9872358710]) }.to raise_error ArgumentError, /Required arguments :client_secret missing/ + end + end + context 'oauth.v2_completeShortTokenRotation' do + it 'requires client_id' do + expect { client.oauth_v2_completeShortTokenRotation(client_secret: %q[e1b9e11dfcd19c1982d5de12921e17e8c], new_token: %q[xoxp-12345-67890-1928471-qemwiiwglagjacakvqbvbfkmvbsvsuzn]) }.to raise_error ArgumentError, /Required arguments :client_id missing/ + end + it 'requires client_secret' do + expect { client.oauth_v2_completeShortTokenRotation(client_id: %q[4123121235.9872358710], new_token: %q[xoxp-12345-67890-1928471-qemwiiwglagjacakvqbvbfkmvbsvsuzn]) }.to raise_error ArgumentError, /Required arguments :client_secret missing/ + end + it 'requires new_token' do + expect { client.oauth_v2_completeShortTokenRotation(client_id: %q[4123121235.9872358710], client_secret: %q[e1b9e11dfcd19c1982d5de12921e17e8c]) }.to raise_error ArgumentError, /Required arguments :new_token missing/ + end + end context 'oauth.v2_exchange' do it 'requires client_id' do expect { client.oauth_v2_exchange(client_secret: %q[e1b9e11dfcd19c1982d5de12921e17e8c]) }.to raise_error ArgumentError, /Required arguments :client_id missing/