Skip to content

Releases

v0.36.0

Choose a tag to compare

@nlopes nlopes released this 14 Nov 14:42
e791264

Thanks again to Michal (@akfaew) for another round of fixes in this release.

Breaking changes — read before upgrading

Warning

v0.36.0 includes breaking API, decoding, and serialization changes.

Your code may fail to compile. Code that still compiles may decode or serialize
differently. Events API URL-verification responses now use a different JSON key.

Review every item below before upgrading, including RTM and Events API handlers,
tests that build or compare event payloads, and code that decodes into reused values.

1. RTM group_rename event types have changed

  • slack.GroupRenameEvent gains EventTimestamp. Positional struct literals no
    longer compile. Use keyed literals, such as
    slack.GroupRenameEvent{Type: "group_rename", Group: info, Timestamp: ts}.
    Timestamp keeps its ts JSON key; the new event_ts key is omitted when empty.
  • slack.GroupRenameInfo.Created is now int64. Replace Created: "1360782804"
    with Created: 1360782804. Parse input strings with strconv.ParseInt(value, 10, 64),
    and use strconv.FormatInt(info.Created, 10) where a string is still needed.
    Marshaling now emits a JSON number, and decoding rejects quoted timestamps.

2. URL-verification responses use a lowercase challenge key

slackevents.ChallengeResponse now marshals as {"challenge":"..."} instead of
{"Challenge":"..."}, matching Slack's documented response. Assignments from
untagged anonymous structs no longer compile;
use
slackevents.ChallengeResponse{Challenge: value} instead.

3. slackevents.CallRejectedEvent is flattened

  • Read fields directly from the event. Replace event.Event.CallID with
    event.CallID, and likewise for Type, UserID, ChannelID, and ExternalUniqueID.
  • Envelope fields are removed. Token, TeamID, APIAppID, EventID, and
    AuthedUsers are gone. Decode full callback payloads with slackevents.ParseEvent
    and read envelope metadata from the returned EventsAPIEvent and its
    *EventsAPICallbackEvent data.
  • Type is now call_rejected, not the outer event_callback. Marshaling
    produces the inner event object instead of the complete callback envelope.

4. Decoding into reused values replaces previous contents

  • ActionCallbacks, ContextElements, and BlockObjects replace previous entries
    instead of appending.
    Decoding [A, B] followed by [C] now leaves [C]; [] and
    JSON null clear all entries. The legacy {"elements":null} wrapper remains a no-op
    for ContextElements. To accumulate entries, decode separately and append the slices.
  • Accessory and SlackResponseErrors replace all previous variants on a
    successful decode, instead of retaining fields from earlier decodes. JSON null
    clears accessory variants; it remains a no-op for SlackResponseErrors and for the
    legacy {"accessory":null} wrapper.

A failed decode may clear or partially replace the destination. Do not use it
after a decoding error. To keep the previous value, decode into a separate value and
assign it only after success.

Added

  • Add AdminUsersSetAdmin, AdminUsersSetOwner, and AdminUsersSetRegular, with
    Context variants, to change a user's account type on a workspace or Enterprise org.
    With an org ID, admin.users.setRegular also removes the user's Workspace Owner
    roles (Slack changelog).
    The existing SetRegular still calls the legacy users.admin.setRegular endpoint.
  • Add AdminUsersGetExpiration and AdminUsersSetExpiration, with Context
    variants, to read and set when a guest account is disabled.
    AdminUsersGetExpirationOptionTargetTeam and AdminUsersSetExpirationOptionTeamID
    select a workspace in the org. Slack API reference:
    admin.users.getExpiration,
    admin.users.setExpiration.
  • Add AdminUsersAssign, AdminUsersInvite, and AdminUsersRemove, with Context
    variants and options for guest access, channels, and invite details, to manage
    workspace membership in an Enterprise org. InviteToTeam, InviteGuest, and
    InviteRestricted still call the legacy users.admin.invite endpoint.
  • Add AdminUsersSessionList, AdminUsersSessionReset, AdminUsersSessionResetBulk,
    AdminUsersSessionGetSettings, AdminUsersSessionSetSettings, and
    AdminUsersSessionClearSettings, with Context variants, to list and reset
    member sessions and manage their session settings.
  • Add AdminUsersUnsupportedVersionsExport and its Context variant to have
    Slackbot send a CSV of members on unsupported Slack clients.
  • Add AdminUsersAccessPause and AdminUsersAccessResume, with Context variants
    and a reason option, to queue pausing or resuming org-wide access for frontline
    members. On failed_for_some_users, the returned response lists the rejected
    users in InvalidUsers; Slack still queues the others.

Fixed

  • Expose event_ts in RTM group_rename events as EventTimestamp, preserving
    Timestamp for the separate ts field.
  • Decode numeric creation timestamps in RTM
    group_rename events
    instead of dispatching unmarshalling_error.
  • Use the lowercase challenge JSON key in Events API URL-verification responses.
  • Preserve call and user identifiers when parsing call_rejected Events API events.
  • Replace previous actions, context elements, and composition objects when decoding into reused values.
  • Replace stale accessory and API error variants when decoding into reused values.
  • Stop the Socket Mode handler's event dispatcher when its client returns an error,
    preserving queued events before returning.

Full Changelog: v0.35.0...v0.36.0

v0.35.0

Choose a tag to compare

@nlopes nlopes released this 05 Nov 20:38
819557b

This release fixes interaction payload spoofing, preserves huddle profile data, and corrects several message handling and 32-bit compatibility issues.

Upgrade notes

Warning

slackevents.Profile has three new fields. Positional struct literals no longer compile. Convert them to keyed literals before upgrading.

Events API profiles now preserve huddle state, expiration, and call ID through HuddleState, HuddleStateExpirationTS, and HuddleStateCallID.

Use field names when constructing profiles:

profile := slackevents.Profile{
    DisplayName: "Alex",
    Team:        "T123ABC456",
}

Security

InteractionCallbackParse now reads payload exclusively from the form-encoded request body.

Previously, it could accept an unsigned URL query payload while the application verified a signature covering only the body. An attacker who obtained a valid signed request within the accepted timestamp window could replay it with a forged interaction payload.

Callers must supply payload in an application/x-www-form-urlencoded request body. Form parsing errors are now returned to the caller.

See GHSA-pj2x-fjjr-q84c. Thanks to @jjiang-stripe for reporting the issue and providing the fix.

Fixes

  • Prevent repeated escaping and data races when reusing a MsgOptionText option.
  • Encode context block elements correctly when a block is passed by value.
  • Preserve plus signs and percent signs in slacktest message blocks and attachments.
  • Keep slacktest bot identities independent when generating RTM connection information.
  • Prevent retry jitter panics with large durations on 32-bit platforms.
  • Decode JSONTime timestamps outside the 32-bit integer range on 32-bit platforms.

Full changelog: v0.34.0…v0.35.0

v0.34.0

Choose a tag to compare

@nlopes nlopes released this 03 Nov 18:33
acf69fb

Huge thank you to Michal Mazurek (@akfaew) for submitting a bunch of patches for this
release.

Breaking changes — read before upgrading

Warning

v0.34.0 includes breaking API, decoding, serialization, and event-dispatch changes.

Your code may fail to compile. Code that still compiles may decode, serialize,
or route events differently. Malformed payloads can cause an entire Events API
event to be rejected.

Review every item below before upgrading, including interfaces, mocks, custom
event decoders, and stored payloads.

1. Retired user APIs have been removed

  • SetUserAsActive and SetUserAsActiveContext are gone. Remove these calls.
    SetUserPresence still supports away and auto, but marking user as active is gone.
  • GetUsersOptionPresence is gone. Remove it from GetUsers, GetUsersContext,
    and GetUsersPaginated calls. User-list requests no longer send the retired
    presence parameter. Use GetUserPresence or GetUserPresenceContext for
    individual presence checks.

2. Team-info method signatures have changed

GetTeamInfo, GetTeamInfoContext, GetOtherTeamInfo, and
GetOtherTeamInfoContext now accept ...GetTeamInfoOption. Update interfaces,
mocks, and assigned function types to include the variadic parameter.
Existing
direct calls remain valid.

3. Auth-provider blocks have a new concrete type and lose raw JSON

Note

This is a brand new block. For now experimental as it doesn't yet appear in the slack
docs but is already part of their official node sdk.

  • auth_provider blocks now decode as *AuthProviderBlock, replacing
    *UnknownBlock.
    Update type assertions and type switches.

An unchanged JSON round trip is no longer guaranteed. Marshaling drops unknown
fields, adds zero values for absent required fields, and can omit explicit nulls
or empty optional values. Keep the original payload if you need to preserve its JSON.

4. Stricter decoding can reject whole events or manifests

Values that were previously ignored or accepted can now return errors:

  • Input blocks: malformed input elements fail decoding of the input block and
    its containing Blocks. Missing elements and JSON null input retain their
    previous behavior.
  • Auth-provider blocks: malformed known fields, such as "name":42, fail
    decoding of the containing Blocks.
  • Messages: malformed display_as_bot values, such as "false", 0, [], or
    {}, fail message decoding. Missing and null values remain accepted.
    Marshaling now emits explicit true and false values that were previously
    discarded.

A malformed message or block can cause slackevents.ParseEvent to reject the
entire event, preventing its delivery to your handler.
Check error handling and
any captured payloads you replay.

5. Positional struct literals no longer compile

New fields in Features, TeamInfo, Msg, and Tab break positional literals for
these types. Use keyed literals with field names. Existing keyed literals
remain valid.

6. Built-in user-connection decoders take precedence

The built-in user_connection and user_connection_status_requested decoders take
precedence over custom entries in slack.EventMapping. Register custom decoders
for these events in slackevents.EventsAPIInnerEventMapping.

7. Socket Mode dispatch changes for envelopes without inner events

Empty-string event handlers no longer receive these envelopes. Register
handlers by the outer event type, for example
HandleEvents(slackevents.AppRateLimited, handler) for app_rate_limited.

A matching outer-type handler can now suppress the default handler. Check
applications that relied on the default handler receiving these envelopes.

Added

  • Add GetCanvasContent and GetCanvasContentContext, with optional Markdown or
    HTML output. Slack API reference.

  • Add GetTeamInfoOptionIncludeSlackbotAvailability and
    TeamInfo.SlackbotAvailability for advisory workspace availability.
    Slack API reference.

  • Add RequestUserConnectionAuth, BulkUpdateUserConnections, their context
    variants, and per-user bulk-update failures. Add AuthProviderBlock, the
    user_connection and user_connection_status_requested events, and manifest
    features.user_connections. The authentication APIs, status-requested event,
    and manifest configuration follow the official Node SDK schemas; their standalone
    reference pages were unavailable when added.
    AuthProviderBlock support is experimental: auth_provider is not live in Slack
    yet. This implementation uses the official Node SDK as a guide. Its schema and
    behavior may change when Slack releases the block.
    Node SDK release,
    auth provider schema,
    user connection event.

  • Configure RTM WebSocket handshake headers with RTMOptionDialHeaders.
    Headers are copied and reused on reconnect; existing defaults remain unchanged.

  • Decode data.file_id on channel tabs as Tab.Data.FileID, so the tab that
    shows a given canvas can be identified from conversations.info. Preserve
    absent data and file_id fields when marshaling tabs.

Changed

  • Document the undocumented preference endpoints and authentication limits of
    GetUserPrefs, GetUserPrefsContext, MuteChat, and UnMuteChat. The mute
    helpers use the legacy muted_channels preference, which may differ from the
    current client's notification settings.

Removed

  • Breaking: Remove SetUserAsActive and SetUserAsActiveContext, which called
    the non-functional users.setActive endpoint. Remove these calls from clients;
    SetUserPresence still supports away and auto, but neither forces a user active.
    Slack retired this endpoint in 2018; see its
    retirement notice.

  • Breaking: Remove GetUsersOptionPresence and stop sending the retired
    presence parameter on users.list requests. Remove that option from GetUsers,
    GetUsersContext, and GetUsersPaginated calls. Use GetUserPresence or
    GetUserPresenceContext when individual presence information is needed.
    Slack retired these features in 2018; see its
    retirement notice.

Fixed

  • Remove the requested channel from the legacy muted-channel preference in
    UnMuteChat. Skip updates when the channel is already unmuted, without panicking.

  • Honor ListTeamsParameters.Limit in ListTeams and ListTeamsContext requests.

  • Encode multiple user IDs as a comma-separated list in MigrationExchange requests.

  • Omit unset TimestampTo and Limit parameters in ListRemoteFiles and
    ListRemoteFilesContext, so Slack can apply its defaults.

  • Preserve optional display_as_bot values in messages, including thread
    broadcasts, as Msg.DisplayAsBot. Use a pointer to distinguish false from an
    absent field. The remaining thread-broadcast fields already decode through
    slackevents.MessageEvent.Message.
    Node SDK change.

  • Route Events API envelopes without an inner event, such as app_rate_limited,
    to handlers registered for the outer event type in Socket Mode.

  • Reject request timestamps so far in the future that the duration difference
    overflows, instead of allowing them to pass the five-minute timestamp check.

  • Decode confirmation dialogs, options, and option groups in BlockObjects
    using their documented object and array fields instead of silently dropping them.
    Slack composition objects.

  • Decode internal_team_ids in EKM original connected channel responses instead
    of looking for internal_team_ids_count.
    Slack API reference.

  • Honor the Types filter in ListFiles and ListFilesContext requests.
    Slack API reference.

  • Send the requested Y crop coordinate in user photo uploads.

  • Preserve the initial pagination state after failed conversations and stars
    requests, so a rate-limited first page is retried instead of reporting an
    empty successful result.

  • Return Slack API errors from starred-item pagination rather than silently
    treating them as the end of the list.

  • Synchronize RTM connection-info reads with reconnect updates.

  • Reconnect RTM connections on permanent WebSocket read errors instead of
    retrying until Gorilla WebSocket panics on a truncated stream. Continue
    tolerating empty or incomplete JSON messages on healthy connections.

  • Deliver warnings from user-profile and event-authorization requests.

  • Avoid a nil-pointer panic when decoding a null conversation-kick response.

  • Honor the configured API endpoint in SetUserCustomFields and
    SetUserCustomFieldsContext.

  • Preserve error causes in legacy admin helpers and Events API parsing, and
    recognize wrapped rate-limit, pagination, and RTM errors.

  • Accept valid non-ASCII text in TextBlockObject.Validate by counting Unicode
    code points for the 3000-character limit.

  • Return custom option errors from FunctionCompleteSuccess and
    FunctionCompleteSuccessContext before sending a requ...

Read more

v0.33.0

Choose a tag to compare

@nlopes nlopes released this 30 Oct 14:21
87465ce

This release adds support for Slackbot skills (changelog) and Slack's new block kit layout block (changelog).

  • Slackbot skills: all seven slackbot.skills.* methods are supported. You can create, inspect, update, and delete skills, list them, and also manage your personal library.
  • Admin skills: all admin.slackbot.skills.* are supported as well.
  • Layout blocks: arrange existing blocks into rows and columns, with widths, alignment, borders, whilst allowing fallback for older clients (through blocks).

Full Changelog: v0.32.0...v0.33.0

v0.32.0

Choose a tag to compare

@nlopes nlopes released this 28 Oct 21:02
8968487

This release expands Slack Code support with channel views, context bars, and canvas collaboration, and fixes permission diagnostics, slash-command decoding, and workflow-button validation.

Important

Please read all the notes below, not just the breaking changes. Some changes deserve paying close attention to, like new fields in SlackResponse, and all the new *AgentConversation* methods.

Breaking changes

  • Update interfaces, mocks, and function values that use the old canvas creation
    signatures.
    CreateCanvas and CreateCanvasContext now accept
    options ...CreateCanvasOption. Existing direct calls still compile, but these
    methods no longer satisfy interfaces with the old fixed signatures. Add the
    variadic parameter to interface and mock declarations; adapt stored function
    values or wrap the call in a function with the old signature.
  • Use field names when initializing Properties, SlackResponse,
    KickUserFromConversationSlackResponse, or SlackErrorResponse.
    New fields
    make positional literals fail to compile. Existing keyed literals still work.

Added

  • Show code diffs, HTML reports, Block Kit interfaces, and canvases in Slack Code
    channels.
    Use SetAgentConversationView to publish or update a view,
    ListAgentConversationViews to discover attached views, and
    RemoveAgentConversationView to remove them. All have Context variants.
    Slack documents pull-request views too, but live requests have returned
    invalid_view_type; publish a unified diff with AgentViewTypeDiff if that
    happens.
  • Give a code channel useful context. Set context-bar links, action items,
    a summary message, and external resource details with
    SetAgentConversationProperties or its Context variant. Read session status,
    title, assigned agents, origin message, context-bar ownership, summary, and
    managed views through Properties.AgentSession and Properties.CodeChannel
    in conversation responses.
  • Read and revise canvases attached to code channels.
    GetAgentConversationCanvas retrieves markdown and comment threads, including
    replies and optional resolved threads. SetAgentConversationCanvasContent
    replaces the markdown while preserving section IDs and comment anchors on
    unchanged sections. Both have Context variants.
  • Create a canvas directly in a channel, including in free workspaces that
    require a channel. Pass CreateCanvasOptionChannelID(channelID) to
    CreateCanvas or CreateCanvasContext (#1623).
  • Try the new examples/slack_code CLI for channel
    setup, context bars, views, canvases, commands, metadata inspection, and archival.
    It includes sample HTML, Block Kit, markdown, and unified-diff files.

Fixed

  • See which scopes are missing when an API call fails. Slack's needed and
    provided values are now preserved in responses and SlackErrorResponse, even
    for methods that return only an error. Use errors.As to inspect Needed and
    Provided; the error text is unchanged.
  • Discover code-channel views even when Slack returns an empty legacy views
    array.
    ListAgentConversationViews also preserves session_views, including
    view types, names, and owner IDs.
  • Receive slash commands when Slack omits is_enterprise_install. JSON
    decoding now accepts absent or null values, including observed Slack Code
    context-bar action deliveries over Socket Mode.
  • Send workflow buttons without an action ID. An empty
    WorkflowButtonBlockElement.ActionID is omitted from JSON so the button passes
    Slack's block validation. Populated IDs are preserved.

Documentation and testing

  • Clarify that Slack documents raw_number table cells for publishing. If a
    workspace rejects them with invalid_blocks, send the number as a
    TableRawTextCell. Null cells remain a received-only representation.
  • Add regression coverage for code-channel lifecycle events, Block Kit view
    interactions, and agent slash commands through the existing HTTP and Socket
    Mode parsers and handlers.

Full Changelog: v0.31.0...v0.32.0

v0.31.0

Choose a tag to compare

@nlopes nlopes released this 26 Oct 20:32
50bf75c

Breaking changes

  • ButtonBlockElement is no longer comparable because VisibleToUserIDs is a slice.
    Value comparisons and map keys using it no longer compile; interface comparisons containing button values can panic. Use comparable identifiers as map keys and compare button contents explicitly:

    // Before
    same := a == b
    // After (import "reflect")
    same := reflect.DeepEqual(a, b)
  • If you create these structs without naming their fields, update that code. New fields were added to Block Kit elements, Attachment, File, RemoteFile and Features. Code that supplies values by position now fails to compile. Include the field names, or use the existing New... helper functions where available:

    // Before: values depend on field order.
    element := slack.RichTextSectionBroadcastElement{slack.RTSEBroadcast, "here"}
    // After: each value names its field.
    element := slack.RichTextSectionBroadcastElement{
        Type:  slack.RTSEBroadcast,
        Range: "here",
    }
  • Newly supported rich-text elements decode into concrete types instead of *RichTextSectionUnknownElement. Update type assertions and switches for attachment, workflow, Work Object and message mentions; tags; canvas elements; citations; file and List record references; and Salesforce data fields.

  • Request signature validation is stricter, and mismatch errors have changed. NewSecretsVerifier rejects signatures without the v0= prefix or whose decoded length is not 32 bytes. Update any test fixtures that relied on the previous permissive parsing. SecretsVerifier.Ensure returns ErrInvalidSignature on a mismatch; replace checks of the old error text with errors.Is(err, slack.ErrInvalidSignature).

  • UninstallApp and RotateTokens now use POST, including their Context variants. Update mocks or custom transports that expect GET requests or credentials in the URL to accept form-encoded POST bodies.

  • OptionOnWarning callbacks no longer receive the token parameter in form or query parameter maps. Update callbacks that rely on that field.

Added

  • Add RTMOptionReadLimit and socketmode.OptionReadLimit to limit incoming WebSocket message sizes on every connection, including reconnects. The default remains unlimited; exceeding a configured limit closes the connection and triggers normal reconnect handling. With compression enabled through a custom dialer, the limit counts compressed bytes and does not bound the size after decompression.

  • Block Kit: Add typed Salesforce data fields with record IDs, field metadata, label visibility, and styles. These now decode into RichTextSectionSalesforceDataFieldElement instead of RichTextSectionUnknownElement.

    [!WARNING]
    has_withheld_salesforce_field_names is based on live Slack responses and is absent from the reference and SDK models.

  • Block Kit: Add typed workflow mentions with workflow and trigger IDs, display text, URLs, message locations, and styles. These now decode into RichTextSectionWorkflowMentionElement instead of RichTextSectionUnknownElement.

  • Block Kit: Add typed Work Object mentions with entity and app IDs, display text, URLs, icons, preview settings, product names, and styles. These now decode into RichTextSectionWorkObjectMentionElement instead of RichTextSectionUnknownElement.

  • Block Kit: Add typed attachment mentions with app, entity, icon, message, preview, and product metadata. These now decode into RichTextSectionAttachmentMentionElement instead of RichTextSectionUnknownElement.

  • Block Kit: Add typed rich-text tags with styles and constants for all nine colors. Tags now decode into RichTextSectionTagElement instead of RichTextSectionUnknownElement.

  • Block Kit: Add typed List record references with record and view IDs, display text, URLs, and styles. These now decode into RichTextSectionListRecordElement instead of RichTextSectionUnknownElement.

  • Block Kit: Add typed canvas user mentions and canvas message unfurls, including thread IDs and styles. These now decode into concrete types instead of RichTextSectionUnknownElement.

  • Block Kit: Add typed canvas rich-text elements with labels, section links, title visibility, styles, and skill metadata. These now decode into RichTextSectionCanvasElement instead of RichTextSectionUnknownElement.

  • Block Kit: Add RichTextSectionCitationElement with typed file, external, web, message, and memory details for rich-text citations. Preserve unknown detail variants as raw JSON. Citations now decode into this concrete type instead of RichTextSectionUnknownElement.

  • Block Kit: Add typed file
    and message mention
    rich-text elements, including styles and optional metadata. These now decode into concrete
    types instead of RichTextSectionUnknownElement.

  • Add image alt text, GIF, PDF, 800px and inline thumbnails, audio and transcription metadata, preview truncation, remote file identifiers, canvas and List metadata, title blocks, and sharing and app metadata to File. Preserve sharing and app metadata in RemoteFile responses.

  • Block Kit: Add missing element fields for button accessibility, agent prompts, visibility, conversation selection, rich-text input sizing, and rich-text styles and metadata, including shared emoji URLs.

  • Add IsShare, IsMsgUnfurl and Files to Attachment, so the files of a forwarded message are decoded rather than dropped.

  • Add CreateAgentConversation and ArchiveAgentConversation (plus Context variants) for agents.conversations.create and agents.conversations.archive.

  • Add SetAgentConversationCommands (plus Context variant) and Features.CodeChannels for agent slash commands.

  • Add all 12 Slack Lists API methods, with Context variants and scoped options for lists, access, items, and exports.

  • Block Kit: Add DataTableActionCell for buttons in data_table blocks, with an optional raw_text or raw_number fallback (#1618).

  • Add AdminAppsApprovedList and AdminAppsRestrictedList (plus Context variants) for the admin.apps.approved.list and admin.apps.restricted.list methods, with typed app, scope and pagination responses (#1614).

  • Add AdminAppsRequestsList (plus Context variant) for the admin.apps.requests.list method, with typed request and pagination responses (#1615).

  • File now unmarshals the video fields of the file object: the video thumbnail (ThumbVideo, ThumbVideoW, ThumbVideoH and ThumbVideoTimestamp) and DurationMs, HLS, HLSEmbed, HLSPreview, MediaDisplayType, MP4, MP4Low and VTT.

Fixed

  • RTM: Keep reader errors scoped to their connection and stop the old reader before reconnecting, so stale errors cannot close the next connection.
  • slackevents.ParseEvent returns an error for an event_callback with a missing or null inner event instead of panicking.
  • Release multipart upload writers when a request fails or returns before consuming the request body.

Full Changelog: v0.30.1...v0.31.0

v0.30.1

Choose a tag to compare

@nlopes nlopes released this 04 Oct 18:43
a015532

Important

This is a security release. Upgrade if your app passes file URLs from messages or events to GetFile. Full details are in CHANGELOG.md.

Security

GetFile, GetFileContext and UploadToURL now send the token only to https URLs on slack.com, slack-gov.com and their subdomains, and to the host set with OptionAPIURL. Any other URL returns an error before a request is made.

The url_private of a remote or external file (File.IsExternal) points outside Slack, so GetFile(file.URLPrivate) sent the token to that host. See GHSA-3q3v-34v2-g88f.

A test that points GetFile at an httptest server must also pass that server to OptionAPIURL:

api := slack.New("xoxb-test", slack.OptionAPIURL(ts.URL+"/"))
err := api.GetFile(ts.URL+"/files-pri/T1-F1/a.txt", &buf)

Thanks to @Lordseriouspig (what a handle... 😂) for the report.

Full Changelog: v0.30.0...v0.30.1

v0.30.0

Choose a tag to compare

@nlopes nlopes released this 04 Oct 13:19
39e1829

Warning

This release has breaking changes. It needs Go 1.26 or later, DeleteFileComment takes its arguments in a new order, and four methods have new variadic signatures that break interfaces and mocks. Read Breaking changes before you upgrade. Full details are in CHANGELOG.md.

Breaking changes

DeleteFileComment takes (fileID, commentID)

DeleteFileComment now uses the same argument order as DeleteFileCommentContext (#1611). Swap the arguments of every call:

// Before
err := api.DeleteFileComment(commentID, fileID)
// After
err := api.DeleteFileComment(fileID, commentID)

The compiler cannot catch this because both arguments are strings. A call that still passes a comment ID (Fc…) will return an error in order to try to catch it. YMMV so please raise an issue if you encounter issues

Variadic options on CreateManifest and GetUserInfo

CreateManifest, CreateManifestContext, GetUserInfo and GetUserInfoContext now take variadic options. An interface or mock that declares the old signature needs the new parameter:

// Before
type slackAPI interface {
      GetUserInfo(user string) (*slack.User, error)
      CreateManifest(manifest *slack.Manifest, token string) (*slack.ManifestResponse, error)
}

// After
type slackAPI interface {
      GetUserInfo(user string, options ...slack.GetUserInfoOption) (*slack.User, error)
      CreateManifest(manifest *slack.Manifest, token string, options ...slack.CreateManifestOption) (*slack.ManifestResponse, error)
}

Other

  • The minimum supported Go version is now 1.26 (#1581).
  • UpdateUserGroupsParams has a new slice field, AdditionalChannels, so it can no longer be compared with == or used as a map key (#1599).

Added

  • Agent messaging events (app_context_changed, agent_session_stopped, agent_session_title_changed), AppContext on AppHomeOpenedEvent and MessageEvent, authorizations on EventsAPICallbackEvent, and SetAgentSessionStatus and RenameAgentSession for agents.sessions.* by @rliddler in #1607
  • AppId, Credentials and OAuthAuthorizeUrl in the CreateManifest response by @sivchari in #1587
  • Features.AgentView and Features.AssistantView app manifest settings by @yuya-takeyama in #1589
  • More app manifest keys, so a typed export and update keeps them: Features.UnfurlDomains, Features.RichPreviews, Features.Search, OAuthConfig.PKCEEnabled, OAuthConfig.TokenManagementEnabled, Settings.IsMCPEnabled, Settings.TokenRotationEnabled, Settings.IncomingWebhooks, Settings.FunctionRuntime, Settings.SIWSLinks, EventSubscriptions.MetadataSubscriptions and OutgoingDomains by @nlopes in #1609, #1610 and #1612
  • Attachment.HideColor and Block Kit TaskCardBlock.HideTitle by @mkende in #1590
  • additional_channels and include_count options for usergroups.create and usergroups.update by @JaiminBrahmbhatt in #1599
  • SetAppIcon for apps.icon.set by @JaiminBrahmbhatt in #1597
  • AdminTeamsList for admin.teams.list by @JaiminBrahmbhatt in #1593
  • AdminUsersList for admin.users.list by @JaiminBrahmbhatt in #1595
  • New UserGroup fields: AutoProvision, ChannelCount, EnterpriseSubteamID, IsEditingRestricted, IsIDPGroup, IsMembershipLocked, IsOrgLevel, IsSection, IsSubteam and IsVisible by @JaiminBrahmbhatt in #1605
  • GetUsersOptionIncludeLocale and GetUserInfoOptionIncludeLocale to choose whether users.list and users.info return locale by @JaiminBrahmbhatt in #1603 and @nlopes in #1613
  • CreateManifestRaw, UpdateManifestRaw, ExportManifestRaw and ValidateManifestRaw, which keep manifest keys that Manifest does not model, and CreateManifestOptionTeamID by @JaiminBrahmbhatt in #1601

Changed

  • Go 1.26 is the minimum supported version, and CI covers Go 1.26 and 1.27 by @nlopes in #1581
  • DeleteFileComment takes (fileID, commentID) by @nlopes in #1611

Fixed

  • Socket Mode and RTM reconnects wait at most 5 minutes between attempts, and RetryConfig.BackoffMax caps the Web API retry delay, by @shushenghong in #1586
  • Socket Mode reconnects when the stream ends in the middle of a TLS record instead of panicking by @shushenghong in #1608
  • GetFile returns an error when the token cannot read the file instead of saving the sign-in page by @richardmilles in #1582

Other

  • chore(deps): bump github.com/stretchr/testify from 1.11.1 to 1.12.1 by @dependabot[bot] in #1584

New Contributors

Full Changelog: v0.29.0...v0.30.0

v0.29.0

Choose a tag to compare

@nlopes nlopes released this 15 Aug 19:18
49178c5

Fixed

New Contributors

Full Changelog: v0.28.0...v0.29.0

v0.28.0

Choose a tag to compare

@nlopes nlopes released this 15 Aug 17:04
fef3e74

Added

  • Channels field to share an uploaded file with multiple conversations by @kenta-ja8 in #1579
  • Support for the container block by @jlhawn in #1574
  • Full message object from chat.postMessage responses by @rustycl0ck in #1572

Fixed

Other

  • chore(deps): bump golangci/golangci-lint-action from 9.2.1 to 9.3.0 by @dependabot[bot] in #1569
  • chore(deps): bump actions/stale from 10.3.0 to 10.4.0 by @dependabot[bot] in #1573
  • chore(deps): bump actions/setup-go from 6 to 7 by @dependabot[bot] in #1576
  • chore(deps): bump actions/stale from 10.4.0 to 11.0.0 by @dependabot[bot] in #1578

New Contributors

Full Changelog: v0.27.0...v0.28.0