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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ All released versions are available on the Maven Central repositories. The lates
| groupId:artifactId | Description |
|------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [**com.slack.api:bolt**](https://search.maven.org/search?q=g:com.slack.api%20AND%20a:bolt) | Bolt is a framework that offers an abstraction layer to build Slack apps safely and quickly. The most commonly used Servlet environment is supported out-of-the-box. |
| [**com.slack.api:bolt-socket-mode**](https://search.maven.org/search?q=g:com.slack.api%20AND%20a:bolt-socket-mode) | This module offers a handy way to run Bolt apps through [Socket Mode](https://api.slack.com/) connections. |
| [**com.slack.api:bolt-socket-mode**](https://search.maven.org/search?q=g:com.slack.api%20AND%20a:bolt-socket-mode) | This module offers a handy way to run Bolt apps through [Socket Mode](https://docs.slack.dev/apis/events-api/using-socket-mode) connections. |
| [**com.slack.api:bolt-jetty**](https://search.maven.org/search?q=g:com.slack.api%20AND%20a:bolt-jetty) | This module offers a handy way to run Bolt apps on the [Java EE compatible Jetty HTTP server (9.x)](https://www.eclipse.org/jetty/). |
| [**com.slack.api:bolt-jakarta-jetty**](https://search.maven.org/search?q=g:com.slack.api%20AND%20a:bolt-jakarta-jetty) | This module offers a handy way to run Bolt apps on the [Jakarta EE compatible Jetty HTTP server](https://www.eclipse.org/jetty/). |
| [**com.slack.api:bolt-aws-lambda**](https://search.maven.org/search?q=g:com.slack.api%20AND%20a:bolt-aws-lambda) | This module offers a handy way to run Bolt apps on AWS [API Gateway](https://aws.amazon.com/api-gateway/) + [Lambda](https://aws.amazon.com/lambda/). |
Expand All @@ -100,7 +100,7 @@ All released versions are available on the Maven Central repositories. The lates

|groupId:artifactId|Description|
|---|---|
|[**com.slack.api:slack-api-model**](https://search.maven.org/search?q=g:com.slack.api%20AND%20a:slack-api-model)|This is a collection of the classes representing the [Slack core objects](https://api.slack.com/types) such as conversations, messages, users, blocks, and surfaces. As this is an essential part of the SDK, all other modules depend on this.|
|[**com.slack.api:slack-api-model**](https://search.maven.org/search?q=g:com.slack.api%20AND%20a:slack-api-model)|This is a collection of the classes representing the [Slack core objects](https://docs.slack.dev/reference/objects) such as conversations, messages, users, blocks, and surfaces. As this is an essential part of the SDK, all other modules depend on this.|
|[**com.slack.api:slack-api-model-kotlin-extension**](https://search.maven.org/search?q=g:com.slack.api%20AND%20a:slack-api-model-kotlin-extension)|This contains the Block Kit Kotlin DSL builder, which allows you to define block kit structures via a Kotlin-native DSL.|
|[**com.slack.api:slack-api-client**](https://search.maven.org/search?q=g:com.slack.api%20AND%20a:slack-api-client)|This is a collection of the Slack API clients. The supported are Basic API Methods, Socket Mode, RTM (Real Time Messaging) API, SCIM API, Audit Logs API, and Status API.|
|[**com.slack.api:slack-api-client-kotlin-extension**](https://search.maven.org/search?q=g:com.slack.api%20AND%20a:slack-api-client-kotlin-extension)|This contains extension methods for various slack client message builders so you can seamlessly use the Block Kit Kotlin DSL directly on the Java message builders.|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class InvalidRequestPatternTest {

@Before
public void setUp() {
// https://api.slack.com/docs/verifying-requests-from-slack
// https://docs.slack.dev/authentication/verifying-requests-from-slack
String signingSecret = appConfig.getSigningSecret();
if (signingSecret == null || signingSecret.trim().isEmpty()) {
// This is just a random value to avoid SlackSignature.Generator's initialization error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void weather() throws Exception {
ServletTester tester = TestUtils.getServletTester(webApp);
HttpTester.Request request = TestUtils.prepareRequest();

// https://api.slack.com/slash-commands
// https://docs.slack.dev/interactivity/implementing-slash-commands
request.setContent("token=gIkuvaNzQIHg97ATvDxqgjtO" +
"&team_id=T0001" +
"&team_domain=example" +
Expand Down Expand Up @@ -122,7 +122,7 @@ public void echo() throws Exception {
ServletTester tester = TestUtils.getServletTester(webApp);
HttpTester.Request request = TestUtils.prepareRequest();

// https://api.slack.com/slash-commands
// https://docs.slack.dev/interactivity/implementing-slash-commands
request.setContent("token=gIkuvaNzQIHg97ATvDxqgjtO" +
"&team_id=T0001" +
"&team_domain=example" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fun main() {
.singleTeamBotToken("xoxb-xxx")
.build())

// https://api.slack.com/events/app_home_opened
// https://docs.slack.dev/reference/events/app_home_opened
app.event(AppHomeOpenedEvent::class.java) { event, ctx ->
// Build a Home tab view
val now = ZonedDateTime.now()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fun main() {
}

val oauthConfig = ResourceLoader.loadAppConfig()
// https://api.slack.com/authentication/migration
// https://docs.slack.dev/legacy/legacy-app-migration/migrating-classic-apps
oauthConfig.isClassicAppPermissionsEnabled = true
val oauthApp = App(oauthConfig).asOAuthApp(true)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fun main() {
}

val oauthConfig = ResourceLoader.loadAppConfig()
// https://api.slack.com/authentication/migration
// https://docs.slack.dev/legacy/legacy-app-migration/migrating-classic-apps
oauthConfig.isClassicAppPermissionsEnabled = true
val oauthApp = App(oauthConfig).asOAuthApp(true)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class InvalidRequestPatternTest {

@Before
public void setUp() {
// https://api.slack.com/docs/verifying-requests-from-slack
// https://docs.slack.dev/authentication/verifying-requests-from-slack
String signingSecret = appConfig.getSigningSecret();
if (signingSecret == null || signingSecret.trim().isEmpty()) {
// This is just a random value to avoid SlackSignature.Generator's initialization error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void weather() throws Exception {
ServletTester tester = TestUtils.getServletTester(webApp);
HttpTester.Request request = TestUtils.prepareRequest();

// https://api.slack.com/slash-commands
// https://docs.slack.dev/interactivity/implementing-slash-commands
request.setContent("token=gIkuvaNzQIHg97ATvDxqgjtO" +
"&team_id=T0001" +
"&team_domain=example" +
Expand Down Expand Up @@ -121,7 +121,7 @@ public void echo() throws Exception {
ServletTester tester = TestUtils.getServletTester(webApp);
HttpTester.Request request = TestUtils.prepareRequest();

// https://api.slack.com/slash-commands
// https://docs.slack.dev/interactivity/implementing-slash-commands
request.setContent("token=gIkuvaNzQIHg97ATvDxqgjtO" +
"&team_id=T0001" +
"&team_domain=example" +
Expand Down
58 changes: 29 additions & 29 deletions bolt/src/main/java/com/slack/api/bolt/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected List<Middleware> buildDefaultMiddlewareList(AppConfig config) {

// request verification
if (config.isRequestVerificationEnabled()) {
// https://api.slack.com/docs/verifying-requests-from-slack
// https://docs.slack.dev/authentication/verifying-requests-from-slack
String signingSecret = config.getSigningSecret();
if (signingSecret == null || signingSecret.trim().isEmpty()) {
// This is just a random value to avoid SlackSignature.Generator's initialization error.
Expand Down Expand Up @@ -161,7 +161,7 @@ public enum Status {

// -------------------------------------
// Slash Commands
// https://api.slack.com/interactivity/slash-commands
// https://docs.slack.dev/interactivity/implementing-slash-commands
// -------------------------------------

/**
Expand All @@ -171,7 +171,7 @@ public enum Status {

// -------------------------------------
// Events API
// https://api.slack.com/events-api
// https://docs.slack.dev/apis/events-api
// -------------------------------------

/**
Expand All @@ -188,7 +188,7 @@ public enum Status {

// -------------------------------------
// Block Kit
// https://api.slack.com/block-kit
// https://docs.slack.dev/block-kit
// -------------------------------------

/**
Expand All @@ -202,7 +202,7 @@ public enum Status {

// -------------------------------------
// Modal Views
// https://api.slack.com/surfaces/modals/using
// https://docs.slack.dev/surfaces/modals
// -------------------------------------

/**
Expand All @@ -216,7 +216,7 @@ public enum Status {

// -------------------------------------
// Shortcuts
// https://api.slack.com/interactivity
// https://docs.slack.dev/interactivity/implementing-shortcuts
// -------------------------------------

/**
Expand All @@ -231,7 +231,7 @@ public enum Status {

// -------------------------------------
// Workflow Steps
// https://api.slack.com/workflows/steps
// https://docs.slack.dev/legacy/legacy-steps-from-apps
// -------------------------------------

/**
Expand All @@ -243,7 +243,7 @@ public enum Status {

// -------------------------------------
// Attachments
// https://api.slack.com/messaging/composing/layouts#attachments
// https://docs.slack.dev/legacy/legacy-dialogs
// -------------------------------------

/**
Expand All @@ -253,7 +253,7 @@ public enum Status {

// -------------------------------------
// Dialogs
// https://api.slack.com/dialogs
// https://docs.slack.dev/legacy/legacy-dialogs
// -------------------------------------

/**
Expand Down Expand Up @@ -357,7 +357,7 @@ public String buildAuthorizeUrl(String state, String nonce) {
AppConfig config = config();
if (config.getClientId() == null) {
log.warn("To enable th Slack OAuth flow, set config#clientId and so on properly. " +
"Refer to https://api.slack.com/authentication for more information.");
"Refer to https://docs.slack.dev/authentication for more information.");
return null;
}
if (config.isStateValidationEnabled() && state == null) {
Expand All @@ -366,7 +366,7 @@ public String buildAuthorizeUrl(String state, String nonce) {
}
if (config.isOpenIDConnectEnabled() && config.getUserScope() == null) {
log.warn("For OpenID Connect authorization, set config#userScope properly. " +
"Refer to https://api.slack.com/authentication/sign-in-with-slack for more information.");
"Refer to https://docs.slack.dev/authentication/sign-in-with-slack for more information.");
return null;
}
if (config.isOpenIDConnectEnabled() && config.getScope() != null) {
Expand All @@ -378,7 +378,7 @@ public String buildAuthorizeUrl(String state, String nonce) {
String redirectUriParam = redirectUriQueryParam(appConfig);

if (config.isClassicAppPermissionsEnabled()) {
// https://api.slack.com/authentication/migration
// https://docs.slack.dev/legacy/legacy-app-migration/migrating-classic-apps
return "https://slack.com/oauth/authorize" +
"?client_id=" + config.getClientId() +
"&scope=" + scope +
Expand Down Expand Up @@ -622,7 +622,7 @@ public App assistant(Assistant assistant) {

// -------------
// Events API
// https://api.slack.com/events-api
// https://docs.slack.dev/apis/events-api

public <E extends Event> App event(
Class<E> eventClass, BoltEventHandler<E> handler) {
Expand Down Expand Up @@ -706,7 +706,7 @@ public App message(Pattern pattern, BoltEventHandler<MessageEvent> messageHandle

// -------------
// Slash Commands
// https://api.slack.com/interactivity/slash-commands
// https://docs.slack.dev/interactivity/implementing-slash-commands

public App command(String command, SlashCommandHandler handler) {
return command(Pattern.compile("^" + Pattern.quote(command) + "$"), handler);
Expand All @@ -722,7 +722,7 @@ public App command(Pattern command, SlashCommandHandler handler) {

// -------------
// Block Kit
// https://api.slack.com/block-kit
// https://docs.slack.dev/block-kit

public App blockAction(String actionId, BlockActionHandler handler) {
return blockAction(Pattern.compile("^" + Pattern.quote(actionId) + "$"), handler);
Expand Down Expand Up @@ -750,8 +750,8 @@ public App blockSuggestion(Pattern actionId, BlockSuggestionHandler handler) {

// -------------
// Shortcuts
// https://api.slack.com/interactivity
// https://api.slack.com/interactivity/actions
// https://docs.slack.dev/interactivity
// https://docs.slack.dev/interactivity/implementing-shortcuts

public App globalShortcut(String callbackId, GlobalShortcutHandler handler) {
return globalShortcut(Pattern.compile("^" + Pattern.quote(callbackId) + "$"), handler);
Expand Down Expand Up @@ -779,7 +779,7 @@ public App messageShortcut(Pattern callbackId, MessageShortcutHandler handler) {

// -------------
// Modal Views
// https://api.slack.com/surfaces/modals/using
// https://docs.slack.dev/surfaces/modals

public App viewSubmission(String callbackId, ViewSubmissionHandler handler) {
return viewSubmission(Pattern.compile("^" + Pattern.quote(callbackId) + "$"), handler);
Expand Down Expand Up @@ -807,26 +807,26 @@ public App viewClosed(Pattern callbackId, ViewClosedHandler handler) {

// -------------
// Workflows: Steps from Apps
// https://api.slack.com/workflows/steps
// https://docs.slack.dev/legacy/legacy-steps-from-apps

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
* @deprecated Use new custom steps: https://docs.slack.dev/workflows/workflow-steps
*/
@Deprecated
public App step(WorkflowStep step) {
return this.use(step);
}

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
* @deprecated Use new custom steps: https://docs.slack.dev/workflows/workflow-steps
*/
@Deprecated
public App workflowStepEdit(String callbackId, WorkflowStepEditHandler handler) {
return workflowStepEdit(Pattern.compile("^" + Pattern.quote(callbackId) + "$"), handler);
}

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
* @deprecated Use new custom steps: https://docs.slack.dev/workflows/workflow-steps
*/
@Deprecated
public App workflowStepEdit(Pattern callbackId, WorkflowStepEditHandler handler) {
Expand All @@ -838,15 +838,15 @@ public App workflowStepEdit(Pattern callbackId, WorkflowStepEditHandler handler)
}

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
* @deprecated Use new custom steps: https://docs.slack.dev/workflows/workflow-steps
*/
@Deprecated
public App workflowStepSave(String callbackId, WorkflowStepSaveHandler handler) {
return workflowStepSave(Pattern.compile("^" + Pattern.quote(callbackId) + "$"), handler);
}

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
* @deprecated Use new custom steps: https://docs.slack.dev/workflows/workflow-steps
*/
@Deprecated
public App workflowStepSave(Pattern callbackId, WorkflowStepSaveHandler handler) {
Expand All @@ -858,15 +858,15 @@ public App workflowStepSave(Pattern callbackId, WorkflowStepSaveHandler handler)
}

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
* @deprecated Use new custom steps: https://docs.slack.dev/workflows/workflow-steps
*/
@Deprecated
public App workflowStepExecute(String pattern, WorkflowStepExecuteHandler handler) {
return workflowStepExecute(Pattern.compile("^.*" + Pattern.quote(pattern) + ".*$"), handler);
}

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
* @deprecated Use new custom steps: https://docs.slack.dev/workflows/workflow-steps
*/
@Deprecated
public App workflowStepExecute(Pattern pattern, WorkflowStepExecuteHandler handler) {
Expand All @@ -879,7 +879,7 @@ public App workflowStepExecute(Pattern pattern, WorkflowStepExecuteHandler handl

// -------------
// Attachments
// https://api.slack.com/messaging/composing/layouts#attachments
// https://docs.slack.dev/messaging/formatting-message-text#building-attachments

public App attachmentAction(String callbackId, AttachmentActionHandler handler) {
return attachmentAction(Pattern.compile("^" + Pattern.quote(callbackId) + "$"), handler);
Expand All @@ -895,7 +895,7 @@ public App attachmentAction(Pattern callbackId, AttachmentActionHandler handler)

// -------------
// Dialogs
// https://api.slack.com/dialogs
// https://docs.slack.dev/legacy/legacy-dialogs

public App dialogSubmission(String callbackId, DialogSubmissionHandler handler) {
return dialogSubmission(Pattern.compile("^" + Pattern.quote(callbackId) + "$"), handler);
Expand Down Expand Up @@ -1221,7 +1221,7 @@ protected Response runHandler(Request slackRequest) throws IOException, SlackApi
break;
}
case UrlVerification: {
// https://api.slack.com/events/url_verification
// https://docs.slack.dev/reference/events/url_verification
return Response.builder()
.statusCode(200)
.contentType("text/plain")
Expand Down
6 changes: 3 additions & 3 deletions bolt/src/main/java/com/slack/api/bolt/AppConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private static SlackHttpClient buildSlackHttpClient() {
@Builder.Default
private String verificationToken = System.getenv(EnvVariableName.SLACK_VERIFICATION_TOKEN);

// https://api.slack.com/docs/oauth
// https://docs.slack.dev/authentication/installing-with-oauth

public boolean isDistributedApp() {
return clientId != null && clientSecret != null;
Expand Down Expand Up @@ -195,7 +195,7 @@ public void setOAuthCallbackEnabled(boolean enabled) {
private long authTestCacheExpirationMillis = 600_000L;

@Builder.Default
// https://api.slack.com/authentication/migration
// https://docs.slack.dev/legacy/legacy-app-migration/migrating-classic-apps
private boolean classicAppPermissionsEnabled = false;

/**
Expand Down Expand Up @@ -368,7 +368,7 @@ public void setOauthRedirectUriPath(String oauthRedirectUriPath) {

/**
* Automatically acknowledge message events that have subtype if true.
* Find the list of available subtypes at https://api.slack.com/events/message#subtypes
* Find the list of available subtypes at https://docs.slack.dev/reference/events/message#subtypes
*/
@Builder.Default
private boolean subtypedMessageEventsAutoAckEnabled = false;
Expand Down
Loading