Skip to content
Open
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions bin/commands/admin_apps_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions bin/commands/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions bin/commands/oauth_v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
1 change: 1 addition & 0 deletions bin/commands/slackLists_items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/slack/web/api/endpoints/admin_apps_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {})
Expand Down
2 changes: 2 additions & 0 deletions lib/slack/web/api/endpoints/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {})
Expand Down
33 changes: 33 additions & 0 deletions lib/slack/web/api/endpoints/oauth_v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
2 changes: 2 additions & 0 deletions lib/slack/web/api/endpoints/slackLists_items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {})
Expand Down
8 changes: 8 additions & 0 deletions lib/slack/web/api/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/slack-api-ref
Submodule slack-api-ref updated 27 files
+4 −0 docs.slack.dev/methods/admin.apps.config.set.json
+3 −0 docs.slack.dev/methods/admin.apps.permissions.add.json
+3 −0 docs.slack.dev/methods/admin.apps.permissions.remove.json
+3 −0 docs.slack.dev/methods/admin.apps.permissions.set.json
+10 −5 docs.slack.dev/methods/agents.sessions.setStatus.json
+3 −0 docs.slack.dev/methods/apps.user.connection.update.json
+27 −3 docs.slack.dev/methods/chat.startStream.json
+14 −1 docs.slack.dev/methods/chat.stopStream.json
+21 −2 docs.slack.dev/methods/files.completeUploadExternal.json
+3 −0 docs.slack.dev/methods/files.getUploadURLExternal.json
+14 −0 docs.slack.dev/methods/methods.json
+72 −0 docs.slack.dev/methods/oauth.v2.beginShortTokenRotation.json
+89 −0 docs.slack.dev/methods/oauth.v2.completeShortTokenRotation.json
+3 −0 docs.slack.dev/methods/oauth.v2.user.access.json
+10 −0 docs.slack.dev/methods/slackLists.items.list.json
+5 −0 methods/admin/admin.apps.config.set.json
+1 −0 methods/admin/admin.apps.permissions.add.json
+1 −0 methods/admin/admin.apps.permissions.remove.json
+1 −0 methods/admin/admin.apps.permissions.set.json
+1 −0 methods/apps/apps.user.connection.update.json
+6 −0 methods/chat/chat.stopStream.json
+2 −1 methods/files/files.completeUploadExternal.json
+2 −1 methods/files/files.getUploadURLExternal.json
+6 −0 methods/lists/slackLists.items.list.json
+60 −0 methods/oauth/oauth.v2.beginShortTokenRotation.json
+68 −0 methods/oauth/oauth.v2.completeShortTokenRotation.json
+2 −1 methods/oauth/oauth.v2.user.access.json
19 changes: 19 additions & 0 deletions spec/slack/web/api/endpoints/oauth_v2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down