Skip to content

Commit

Permalink
Merge branch 'main' into assistant-apps
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch authored Sep 20, 2024
2 parents cd48315 + c442278 commit 65353a5
Show file tree
Hide file tree
Showing 58 changed files with 1,535 additions and 77 deletions.
4 changes: 2 additions & 2 deletions bolt-aws-lambda/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<parent>
<groupId>com.slack.api</groupId>
<artifactId>slack-sdk-parent</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
</parent>

<properties>
<aws-lambda-core.version>1.2.3</aws-lambda-core.version>
</properties>

<artifactId>bolt-aws-lambda</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion bolt-docker-examples/echo-command-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories {
dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("com.slack.api:bolt-jetty:1.43.0")
implementation("com.slack.api:bolt-jetty:1.43.1")
implementation("ch.qos.logback:logback-classic:1.5.6")
implementation('net.logstash.logback:logstash-logback-encoder:7.4')
}
Expand Down
4 changes: 2 additions & 2 deletions bolt-google-cloud-functions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.slack.api</groupId>
<artifactId>slack-sdk-parent</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
</parent>

<properties>
Expand All @@ -17,7 +17,7 @@
</properties>

<artifactId>bolt-google-cloud-functions</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions bolt-helidon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.slack.api</groupId>
<artifactId>slack-sdk-parent</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
</parent>

<properties>
Expand All @@ -18,7 +18,7 @@
</properties>

<artifactId>bolt-helidon</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
6 changes: 3 additions & 3 deletions bolt-http4k/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
<parent>
<groupId>com.slack.api</groupId>
<artifactId>slack-sdk-parent</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
</parent>

<properties>
<http4k.version>5.30.0.0</http4k.version>
<http4k.version>5.31.0.0</http4k.version>
<!-- http4k 5.26+ no longer supports Java 1.8 -->
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>

<artifactId>bolt-http4k</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencyManagement>
Expand Down
4 changes: 2 additions & 2 deletions bolt-jakarta-jetty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<groupId>com.slack.api</groupId>
<artifactId>slack-sdk-parent</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
</parent>

<artifactId>bolt-jakarta-jetty</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions bolt-jakarta-servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<groupId>com.slack.api</groupId>
<artifactId>slack-sdk-parent</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
</parent>

<artifactId>bolt-jakarta-servlet</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions bolt-jakarta-socket-mode/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.slack.api</groupId>
<artifactId>slack-sdk-parent</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
</parent>

<properties>
Expand All @@ -15,7 +15,7 @@
</properties>

<artifactId>bolt-jakarta-socket-mode</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions bolt-jetty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<parent>
<groupId>com.slack.api</groupId>
<artifactId>slack-sdk-parent</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
</parent>

<properties>
<jetty.version>9.4.53.v20231009</jetty.version>
</properties>

<artifactId>bolt-jetty</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions bolt-kotlin-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<groupId>com.slack.api</groupId>
<artifactId>slack-sdk-parent</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
</parent>

<artifactId>bolt-kotlin-examples</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions bolt-ktor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>com.slack.api</groupId>
<artifactId>slack-sdk-parent</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
</parent>

<artifactId>bolt-ktor</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
Expand Down
4 changes: 2 additions & 2 deletions bolt-micronaut/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.slack.api</groupId>
<artifactId>slack-sdk-parent</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
</parent>

<properties>
Expand All @@ -26,7 +26,7 @@
</properties>

<artifactId>bolt-micronaut</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions bolt-quarkus-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.slack.api</groupId>
<artifactId>slack-sdk-parent</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
</parent>

<properties>
Expand All @@ -24,7 +24,7 @@
</properties>

<artifactId>bolt-quarkus-examples</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencyManagement>
Expand Down
4 changes: 2 additions & 2 deletions bolt-servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.slack.api</groupId>
<artifactId>slack-sdk-parent</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
</parent>

<properties>
Expand All @@ -15,7 +15,7 @@
</properties>

<artifactId>bolt-servlet</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions bolt-socket-mode/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.slack.api</groupId>
<artifactId>slack-sdk-parent</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
</parent>

<properties>
Expand All @@ -17,7 +17,7 @@
</properties>

<artifactId>bolt-socket-mode</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions bolt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<groupId>com.slack.api</groupId>
<artifactId>slack-sdk-parent</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
</parent>

<artifactId>bolt</artifactId>
<version>1.43.1-SNAPSHOT</version>
<version>1.44.0-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ private BoltLibraryVersion() {
}

public static final String get() {
return "1.43.1-SNAPSHOT";
return "1.44.0-SNAPSHOT";
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public EventRequest(
}
this.getContext().setEnterpriseId(enterpriseId);
this.getContext().setTeamId(teamId);
this.getContext().setRequestUserId(extractRequestUserId(payload));

// set retry related header values to the context
if (this.headers != null && this.headers.getNames().size() > 0) {
for (String name : this.headers.getNames()) {
Expand Down Expand Up @@ -153,7 +155,35 @@ public EventRequest(
}
}

private EventContext context = new EventContext();
private static String extractRequestUserId(JsonObject payload) {
if (payload.get("user") != null) {
if (payload.get("user").isJsonPrimitive()) {
return payload.get("user").getAsString();
} else if (payload.get("user").isJsonObject()) {
JsonElement userId = payload.get("user").getAsJsonObject().get("id");
if (userId != null) {
return userId.getAsString();
}
}
}
if (payload.get("user_id") != null) {
return payload.get("user_id").getAsString();
}
if (payload.get("event") != null) {
return extractRequestUserId(payload.get("event").getAsJsonObject());
}
if (payload.get("message") != null) {
// message_changed: body["event"]["message"]
return extractRequestUserId(payload.get("message").getAsJsonObject());
}
if (payload.get("previous_message") != null) {
// message_deleted: body["event"]["previous_message"]
return extractRequestUserId(payload.get("previous_message").getAsJsonObject());
}
return null;
}

private final EventContext context = new EventContext();

@Override
public EventContext getContext() {
Expand Down
Loading

0 comments on commit 65353a5

Please sign in to comment.