diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 0e78ed28..b6b9de3f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -3,7 +3,10 @@
Thank you for considering a contribution to Atlassian Slack Integration for Server project! Pull requests, issues and
comments are welcome. For pull requests, please:
-* Use `dev` as base branch for your changes and target branch for your PRs
+> `dev` branch contains plugins compatible with Confluence 9+, Bitbucket 9+ and Jira 10+ products
+> `release-1.x` compatible with older products versions (Confluence 7, 8; Bitbucket 8 and Jira 8, 9)
+
+* Use `dev`/`release-1.x` as base branch for your changes and target branch for your PRs
* Add tests for new features and bug fixes
* Follow the existing style
* Separate unrelated changes into multiple pull requests
diff --git a/README.md b/README.md
index 14165e89..1f17b4b5 100644
--- a/README.md
+++ b/README.md
@@ -14,10 +14,16 @@ or by manually downloading plugin JAR files from Marketplace pages for [Jira](ht
or [Bitbucket](https://marketplace.atlassian.com/apps/1220729/bitbucket-server-for-slack-official?hosting=datacenter&tab=overview) plugins.
Links to the official documentation are specified on Marketplace pages.
-Supported products (on 10th Feb, 2023). See [EOL policy](https://confluence.atlassian.com/support/atlassian-support-end-of-life-policy-201851003.html).
-* Jira: 8.15.0 (EOL date: 2 Feb 2023) JDK 8, 11 - 9.5.0 (EOL date: 6 Dec 2024) on JDK 8, 11, 17.
-* Confluence: 7.10 (EOL date: Dec 15, 2022) JDK 8, 11 - 8.0.0-m90 (EOL date: TBD - end of 2024) JDK 8, 11.
-* Bitbucket: 7.6.0 (EOL date: Q1 calendar year 2023) on JDK 8, 11 - 8.8.0 (EOL date: 7 Feb 2025) on JDK 8, 11, 17.
+Supported products. See [EOL policy](https://confluence.atlassian.com/support/atlassian-support-end-of-life-policy-201851003.html).
+* `master`/`dev` branch
+ * Jira: 10+ (not released yet) on JDK 17.
+ * Confluence: 9+ (not released yet) on JDK 17.
+ * Bitbucket: 9+ (not released yet) on JDK 17.
+
+* `release-1.x` branch
+ * Jira: 8.15.0 (EOL date: 2 Feb 2023) JDK 8, 11 - 9.5.0 (EOL date: 6 Dec 2024) on JDK 8, 11, 17.
+ * Confluence: 7.10 (EOL date: Dec 15, 2022) JDK 8, 11 - 8.0.0-m90 (EOL date: TBD - end of 2024) JDK 8, 11.
+ * Bitbucket: 7.6.0 (EOL date: Q1 calendar year 2023) on JDK 8, 11 - 8.8.0 (EOL date: 7 Feb 2025) on JDK 8, 11, 17.
## A note on future development plans
@@ -27,10 +33,12 @@ When Jira, Confluence, or Bitbucket Data Center release new versions, we will va
# Installation
-1. Download and install [JDK 8](https://www.oracle.com/java/technologies/javase-downloads.html). After installation `
+1. Download and install [JDK 17](https://adoptium.net/en-GB/temurin/releases/?version=17). After installation `
java` command should be available in the terminal and `JAVA_HOME` environment variable should point to JDK installation directory.
Running `$JAVA_HOME/bin/java -version` should print a JDK version.
-*Note*: Plugin can be compiled and run using **JDK 11**, but some old products may not support it.
+> **Note:** Use [JDK 8](https://adoptium.net/en-GB/temurin/releases/?version=8) / [JDK 11](https://adoptium.net/en-GB/temurin/releases/?version=11) if working with the `release-1.x` branch
+>
+> **Note:** Plugin can be compiled and run using **JDK 11**, but some old products may not support it.
2. Download and install [Atlassian Plugin SDK](https://developer.atlassian.com/server/framework/atlassian-sdk/install-the-atlassian-sdk-on-a-linux-or-mac-system/).
After successful installation running `atlas-version` should print SDK version.
3. (Optional) Install [ngrok](https://ngrok.com/) to enable Slack -> product features (slash commands, unfurling).
diff --git a/bin/build/install-common-modules.sh b/bin/build/install-common-modules.sh
index 95049be0..af11d3ee 100755
--- a/bin/build/install-common-modules.sh
+++ b/bin/build/install-common-modules.sh
@@ -11,8 +11,5 @@ jira-slack-server-integration/jira-service-desk-compat/jira-service-desk-compat-
jira-slack-server-integration/jira-service-desk-compat/jira-service-desk-4-compat,\
jira-slack-server-integration/jira-service-desk-compat/jira-service-desk-compat-main,\
confluence-slack-integration,\
-confluence-slack-integration/confluence-compat-common,\
-confluence-slack-integration/confluence-7-compat,\
-confluence-slack-integration/confluence-8-compat,\
slack-server-integration-test-common \
-Dmaven.test.skip=true
diff --git a/bin/build/java-product-matrix.json b/bin/build/java-product-matrix.json
index 781228e1..8f381ad1 100644
--- a/bin/build/java-product-matrix.json
+++ b/bin/build/java-product-matrix.json
@@ -9,7 +9,7 @@
},
"confluence-it": {
"java-version": ["17"],
- "confluence-version": ["9.0.0-m81"]
+ "confluence-version": ["9.0.0-m72"]
},
"bitbucket-it": {
"java-version": ["17"],
@@ -55,4 +55,4 @@
]
}
}
-}
\ No newline at end of file
+}
diff --git a/bin/build/run-confluence-its.sh b/bin/build/run-confluence-its.sh
index 6d9e05eb..15f1c3c7 100755
--- a/bin/build/run-confluence-its.sh
+++ b/bin/build/run-confluence-its.sh
@@ -8,6 +8,8 @@ if [[ ${XVFB_ENABLE} != false ]] ; then
export DISPLAY=:20
fi
+# TODO: Remove -Denforcer.skip=true after moving from milestone versions
+
atlas-mvn --batch-mode verify \
${VERSION_ARG} \
-Dut.test.skip=true \
@@ -18,5 +20,6 @@ atlas-mvn --batch-mode verify \
-Dfailsafe.rerunFailingTestsCount=${RETRY_COUNT:-2} \
-Dfailsafe.forkedProcessExitTimeoutInSeconds=360 \
-Dfailsafe.exitTimeout=360 \
+ -Denforcer.skip=true \
-pl confluence-slack-integration/confluence-slack-server-integration-plugin \
"$@"
diff --git a/bin/build/run-unit-tests.sh b/bin/build/run-unit-tests.sh
index f990a377..bac3be84 100755
--- a/bin/build/run-unit-tests.sh
+++ b/bin/build/run-unit-tests.sh
@@ -2,5 +2,7 @@
set -ex
trap 'set +ex' EXIT
+# TODO: Remove -Denforcer.skip=true after moving from milestone versions
+
atlas-version
-atlas-mvn --batch-mode verify -P jacoco
+atlas-mvn --batch-mode verify -P jacoco -Denforcer.skip=true
diff --git a/bin/pack-compat-confluence.sh b/bin/pack-compat-confluence.sh
deleted file mode 100755
index f8f151a7..00000000
--- a/bin/pack-compat-confluence.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env bash
-
-(
- cd "$( dirname "${BASH_SOURCE[0]}")/.." ;
- atlas-mvn install --batch-mode -Dmaven.test.skip=true "$@" -pl \
-com.atlassian.plugins:confluence-compat-common,\
-com.atlassian.plugins:confluence-7-compat,\
-com.atlassian.plugins:confluence-8-compat && \
- rm -rf confluence-slack-integration/confluence-slack-server-integration-plugin/target/classes/com/atlassian/confluence/plugins/slack/util/compat && \
- rm -f confluence-slack-integration/confluence-slack-server-integration-plugin/target/dependency-maven-plugin-markers/com.atlassian.plugins-confluence-compat-common-jar-*
- rm -f confluence-slack-integration/confluence-slack-server-integration-plugin/target/dependency-maven-plugin-markers/com.atlassian.plugins-confluence-7-compat-jar-*
- rm -f confluence-slack-integration/confluence-slack-server-integration-plugin/target/dependency-maven-plugin-markers/com.atlassian.plugins-confluence-8-compat-jar-*
-)
diff --git a/bin/run-bitbucket.sh b/bin/run-bitbucket.sh
index 4c42b219..5e00524b 100755
--- a/bin/run-bitbucket.sh
+++ b/bin/run-bitbucket.sh
@@ -7,12 +7,15 @@ trap 'set +ex' EXIT
BB_NGROK="$(curl -s "http://127.0.0.1:4040/api/tunnels" | \
jq -r '.tunnels[] | select(.proto == "https") | select (.config.addr|endswith("'"7990"'")) | .public_url[8:]')"
+# TODO: Remove -Denforcer.skip=true after moving from milestone versions
+
(
cd "$( dirname "${BASH_SOURCE[0]}")/.." ;
# set env var BB_NGROK to enable HTTPS
atlas-mvn bitbucket:debug \
+ -Denforcer.skip=true \
-Datlassian.dev.mode=true \
-Dmaven.test.skip=true \
-Dlogging.level.com.atlassian.bitbucket.plugins.slack=TRACE \
diff --git a/bin/run-confluence.sh b/bin/run-confluence.sh
index b01116b4..82e5f771 100755
--- a/bin/run-confluence.sh
+++ b/bin/run-confluence.sh
@@ -1,8 +1,11 @@
#!/usr/bin/env bash
+# TODO: Remove -Denforcer.skip=true after moving from milestone versions
+
(
cd "$( dirname "${BASH_SOURCE[0]}")/.." ;
atlas-mvn confluence:debug \
+ -Denforcer.skip=true \
-Datlassian.dev.mode=true \
-Dmaven.test.skip=true \
"$@" \
diff --git a/bitbucket-slack-server-integration-plugin/pom.xml b/bitbucket-slack-server-integration-plugin/pom.xml
index 1ffe4f89..9be8bcc1 100644
--- a/bitbucket-slack-server-integration-plugin/pom.xml
+++ b/bitbucket-slack-server-integration-plugin/pom.xml
@@ -5,7 +5,7 @@
com.atlassian.bitbucket.plugins
bitbucket-slack-server-integration-plugin
atlassian-plugin
- 4.0.11-SNAPSHOT
+ 5.0.0-SNAPSHOT
Slack for Bitbucket Data Center
This is the Slack integration for Bitbucket Data Center
@@ -18,8 +18,8 @@
UTF-8
UTF-8
- 1.8
- 1.8
+ 17
+ 17
@@ -35,36 +35,41 @@
github
- 2.1.7
+ 5.0.0
5.7.1
2.25.0
3.0.0
- 0.9
- 3.0.0
1.11
- 1.1.13
+ 2.0.0
${project.groupId}.${project.artifactId}
- 7.6.0
- 7.6.0
+ 9.0.0-plat-7-m20
+ 9.0.0-plat-7-m20
${bitbucket.version}
8.2.2
- 5.0.0
+ 7.0.0
- com.atlassian.platform
- platform
+ com.atlassian.platform.dependencies
+ platform-public-api
${platform.version}
pom
import
- com.atlassian.platform
- third-party
+ com.atlassian.platform.dependencies
+ platform-test-resources
+ ${platform.version}
+ pom
+ import
+
+
+ com.atlassian.platform.dependencies
+ platform-internal-api
${platform.version}
pom
import
@@ -156,7 +161,6 @@
com.atlassian.json
atlassian-json-api
- ${atlassian-json-api.version}
provided
@@ -166,7 +170,23 @@
com.atlassian.plugins.rest
- atlassian-rest-common
+ atlassian-rest-v2-api
+ provided
+
+
+ javax.inject
+ javax.inject
+ 1
+ provided
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ provided
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
provided
@@ -205,7 +225,6 @@
com.atlassian.util.concurrent
atlassian-util-concurrent
- ${atlassian-concurrent.version}
provided
@@ -223,6 +242,11 @@
fugue
provided
+
+ com.atlassian.analytics
+ analytics-api
+ provided
+
@@ -230,6 +254,11 @@
spring-context
provided
+
+ org.springframework
+ spring-web
+ provided
+
commons-codec
commons-codec
@@ -242,14 +271,13 @@
provided
- javax.ws.rs
- jsr311-api
- 1.1.1
+ jakarta.ws.rs
+ jakarta.ws.rs-api
provided
- javax.servlet
- javax.servlet-api
+ jakarta.servlet
+ jakarta.servlet-api
provided
@@ -313,11 +341,13 @@
org.hamcrest
hamcrest-library
+ 2.2
test
org.hamcrest
hamcrest-core
+ 2.2
test
@@ -369,6 +399,34 @@
bitbucket-it-common
${bitbucket.version}
test
+
+
+ com.sun.jersey
+ jersey-core
+
+
+ com.sun.jersey
+ jersey-server
+
+
+ com.sun.jersey
+ jersey-servlet
+
+
+ com.sun.jersey
+ jersey-client
+
+
+ com.sun.jersey
+ jersey-json
+
+
+
+
+ org.glassfish.jersey.core
+ jersey-common
+ 2.42
+ test
commons-lang
diff --git a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/ComponentImports.java b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/ComponentImports.java
index 691882b4..77c4b3e6 100644
--- a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/ComponentImports.java
+++ b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/ComponentImports.java
@@ -22,7 +22,6 @@
import com.atlassian.plugin.module.ModuleFactory;
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
import com.atlassian.plugin.web.WebInterfaceManager;
-import com.atlassian.plugin.webresource.WebResourceUrlProvider;
import com.atlassian.sal.api.ApplicationProperties;
import com.atlassian.sal.api.auth.LoginUriProvider;
import com.atlassian.sal.api.executor.ThreadLocalDelegateExecutorFactory;
@@ -35,6 +34,7 @@
import com.atlassian.sal.api.web.context.HttpContext;
import com.atlassian.soy.renderer.SoyTemplateRenderer;
import com.atlassian.templaterenderer.TemplateRenderer;
+import com.atlassian.webresource.api.WebResourceUrlProvider;
import com.atlassian.webresource.api.assembler.PageBuilderService;
@SuppressWarnings("unused")
diff --git a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/listener/SlackActionEventListener.java b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/listener/SlackActionEventListener.java
index a8282b79..3bd5bba0 100644
--- a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/listener/SlackActionEventListener.java
+++ b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/listener/SlackActionEventListener.java
@@ -14,10 +14,10 @@
import com.atlassian.plugins.slack.util.AsyncExecutor;
import com.atlassian.plugins.slack.util.ErrorResponse;
import com.atlassian.sal.api.message.I18nResolver;
+import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.seratch.jslack.api.model.dialog.Dialog;
import com.github.seratch.jslack.api.model.dialog.DialogElement;
import com.github.seratch.jslack.api.model.dialog.DialogTextAreaElement;
-import org.codehaus.jackson.map.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/listener/UnfurlLinkExtractor.java b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/listener/UnfurlLinkExtractor.java
index 53857010..ef0dad74 100644
--- a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/listener/UnfurlLinkExtractor.java
+++ b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/listener/UnfurlLinkExtractor.java
@@ -22,18 +22,19 @@
import com.atlassian.sal.api.ApplicationProperties;
import com.atlassian.sal.api.UrlMode;
import com.google.common.primitives.Ints;
-import com.sun.jersey.api.uri.UriComponent;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.util.UriComponentsBuilder;
-import javax.ws.rs.core.MultivaluedMap;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@@ -98,21 +99,15 @@ private Optional findContentFrom(final String url, final Set ded
final URI link = URI.create(url);
// it should contain only the path after the context path
final URI relativeLink = getContentPath(link);
- final MultivaluedMap queryParams = UriComponent.decodeQuery(link, true);
+ final MultiValueMap queryParams = UriComponentsBuilder.fromHttpUrl(decodeValue(url))
+ .build().getQueryParams();
try {
final Comment comment = tryComment(queryParams).orElse(null);
final String commentKey = comment != null ? String.valueOf(comment.getId()) : "";
- final List segments = UriComponent
- .decodePath(relativeLink, false)
+ final List segments = UriComponentsBuilder.fromUri(relativeLink).build().getPathSegments()
.stream()
- .map(path -> {
- try {
- return URLDecoder.decode(path.getPath(), "UTF-8");
- } catch (UnsupportedEncodingException e) {
- return path.getPath();
- }
- })
+ .map(this::decodeValue)
.collect(Collectors.toList());
final String fragment = StringUtils.defaultString(relativeLink.getFragment());
@@ -183,11 +178,19 @@ private Optional findContentFrom(final String url, final Set ded
return Optional.empty();
}
+ private String decodeValue(String value) {
+ try {
+ return URLDecoder.decode(value, StandardCharsets.UTF_8.name());
+ } catch (UnsupportedEncodingException e) {
+ return value;
+ }
+ }
+
/**
* /projects/HC/repos/webcore-next/pull-requests/3586/overview?commentId=1223781
* /projects/HC/repos/webcore-next/commits/428cf995f290c9601df043dbb6748bb641bb6b10?commentId=1582891
*/
- private Optional tryComment(final MultivaluedMap queryParams) {
+ private Optional tryComment(final MultiValueMap queryParams) {
return queryParams.entrySet().stream()
.filter(param -> "commentId".equals(param.getKey()))
.map(param -> getCommentById(param.getValue().get(0)))
@@ -213,7 +216,7 @@ private Optional getCommentById(final String idStr) {
* /projects/PROJECT_1/repos/rep_1/browse/add_file/add_file.txt?at=basic_branching
*/
private Optional[ tryBranchOrTag(final Repository repository,
- final MultivaluedMap queryParams,
+ final MultiValueMap queryParams,
final List segments) {
if (segments.size() == 5 && "browse".equals(segments.get(4))) {
return getBranchOrTag(repository, queryParams);
@@ -221,7 +224,7 @@ private Optional][ tryBranchOrTag(final Repository repository,
return Optional.empty();
}
- private Optional][ getBranchOrTag(final Repository repository, final MultivaluedMap queryParams) {
+ private Optional][ getBranchOrTag(final Repository repository, final MultiValueMap queryParams) {
return queryParams.entrySet().stream()
.filter(param -> "at".equals(param.getKey()))
.map(param -> getBranchOrTag(repository, param.getValue().get(0)))
@@ -265,7 +268,7 @@ private Optional tryCommit(final Repository repository, final List findCommit(final Repository repository, final MultivaluedMap queryParams) {
+ private Optional findCommit(final Repository repository, final MultiValueMap queryParams) {
return queryParams.entrySet().stream()
.filter(param -> "at".equals(param.getKey()))
.map(param -> findCommit(repository, param.getValue().get(0)))
@@ -317,7 +320,7 @@ private Optional tryFile(final Repository repository,
final Optional commitFromPath,
final Optional pullRequest,
final List segments,
- final MultivaluedMap queryParams,
+ final MultiValueMap queryParams,
final String fragment) {
// file in default or custom branch/tag, or in "commit from pr" view
if (segments.size() >= 6 && "browse".equals(segments.get(4))) {
@@ -343,7 +346,7 @@ private Optional tryFile(final Repository repository,
}
private Optional parseFileForKnownRef(final Repository repository,
- final MultivaluedMap queryParams,
+ final MultiValueMap queryParams,
final String fragment,
final String filePath) {
Commit commit;
diff --git a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/model/ReplyToCommentPayload.java b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/model/ReplyToCommentPayload.java
index bbf57ade..3d8ec742 100644
--- a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/model/ReplyToCommentPayload.java
+++ b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/model/ReplyToCommentPayload.java
@@ -1,7 +1,7 @@
package com.atlassian.bitbucket.plugins.slack.model;
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
public class ReplyToCommentPayload {
public static final String TYPE_PULL_REQUEST = "pullRequest";
diff --git a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/model/RepositoryDto.java b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/model/RepositoryDto.java
index a38bb612..4dba28ff 100644
--- a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/model/RepositoryDto.java
+++ b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/model/RepositoryDto.java
@@ -1,9 +1,9 @@
package com.atlassian.bitbucket.plugins.slack.model;
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
import lombok.Value;
-import org.codehaus.jackson.annotate.JsonAutoDetect;
-import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONLY;
+import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;
@JsonAutoDetect(fieldVisibility = PUBLIC_ONLY)
@Value
diff --git a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/notification/renderer/SlackNotificationRenderer.java b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/notification/renderer/SlackNotificationRenderer.java
index d57a058e..2c450b10 100644
--- a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/notification/renderer/SlackNotificationRenderer.java
+++ b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/notification/renderer/SlackNotificationRenderer.java
@@ -38,6 +38,7 @@
import com.atlassian.plugins.slack.api.notification.Verbosity;
import com.atlassian.plugins.slack.settings.SlackSettingService;
import com.atlassian.sal.api.message.I18nResolver;
+import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.seratch.jslack.api.methods.request.chat.ChatPostMessageRequest;
import com.github.seratch.jslack.api.methods.request.chat.ChatPostMessageRequest.ChatPostMessageRequestBuilder;
import com.github.seratch.jslack.api.model.block.ActionsBlock;
@@ -48,7 +49,6 @@
import com.github.seratch.jslack.api.model.block.element.BlockElement;
import com.github.seratch.jslack.api.model.block.element.ButtonElement;
import com.google.common.base.Preconditions;
-import org.codehaus.jackson.map.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/rest/RepositoryToChannelConfigurationResource.java b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/rest/RepositoryToChannelConfigurationResource.java
index c382c466..77b3d99f 100644
--- a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/rest/RepositoryToChannelConfigurationResource.java
+++ b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/rest/RepositoryToChannelConfigurationResource.java
@@ -19,6 +19,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
+import javax.inject.Inject;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.PUT;
@@ -35,7 +36,7 @@
*/
@Path("/config/{repositoryId}")
@Slf4j
-@RequiredArgsConstructor
+@RequiredArgsConstructor(onConstructor_ = @Inject)
public class RepositoryToChannelConfigurationResource {
private final RepositoryService repositoryService;
private final PermissionValidationService permissionValidationService;
diff --git a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/rest/RepositoryToChannelResource.java b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/rest/RepositoryToChannelResource.java
index a66d733c..6334030b 100644
--- a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/rest/RepositoryToChannelResource.java
+++ b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/rest/RepositoryToChannelResource.java
@@ -9,6 +9,7 @@
import com.atlassian.bitbucket.util.PageUtils;
import org.apache.commons.lang3.StringUtils;
+import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
@@ -26,6 +27,7 @@ public class RepositoryToChannelResource {
private final RepositoryService repositoryService;
+ @Inject
public RepositoryToChannelResource(final RepositoryService repositoryService) {
this.repositoryService = repositoryService;
}
diff --git a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/spi/impl/BitbucketSlackPluginResourceProvider.java b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/spi/impl/BitbucketSlackPluginResourceProvider.java
index 7afd47c2..d98a5282 100644
--- a/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/spi/impl/BitbucketSlackPluginResourceProvider.java
+++ b/bitbucket-slack-server-integration-plugin/src/main/java/com/atlassian/bitbucket/plugins/slack/spi/impl/BitbucketSlackPluginResourceProvider.java
@@ -1,9 +1,9 @@
package com.atlassian.bitbucket.plugins.slack.spi.impl;
import com.atlassian.bitbucket.plugins.slack.notification.BitbucketPersonalNotificationTypes;
-import com.atlassian.plugin.webresource.UrlMode;
-import com.atlassian.plugin.webresource.WebResourceUrlProvider;
import com.atlassian.plugins.slack.spi.SlackPluginResourceProvider;
+import com.atlassian.webresource.api.UrlMode;
+import com.atlassian.webresource.api.WebResourceUrlProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
diff --git a/bitbucket-slack-server-integration-plugin/src/main/resources/atlassian-plugin.xml b/bitbucket-slack-server-integration-plugin/src/main/resources/atlassian-plugin.xml
index a06a0791..a2732a95 100644
--- a/bitbucket-slack-server-integration-plugin/src/main/resources/atlassian-plugin.xml
+++ b/bitbucket-slack-server-integration-plugin/src/main/resources/atlassian-plugin.xml
@@ -185,6 +185,12 @@
+
+
+
+
+
+
REQUEST
FORWARD
diff --git a/bitbucket-slack-server-integration-plugin/src/test/java/com/atlassian/bitbucket/plugins/slack/notification/renderer/SlackLinkRendererTest.java b/bitbucket-slack-server-integration-plugin/src/test/java/com/atlassian/bitbucket/plugins/slack/notification/renderer/SlackLinkRendererTest.java
index e1546674..ac235fdb 100644
--- a/bitbucket-slack-server-integration-plugin/src/test/java/com/atlassian/bitbucket/plugins/slack/notification/renderer/SlackLinkRendererTest.java
+++ b/bitbucket-slack-server-integration-plugin/src/test/java/com/atlassian/bitbucket/plugins/slack/notification/renderer/SlackLinkRendererTest.java
@@ -32,6 +32,9 @@
import static org.hamcrest.Matchers.is;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@ExtendWith(MockitoExtension.class)
@@ -262,13 +265,18 @@ public void oAuthSessionsPageUrl_shouldReturnExpectedValue() {
@Test
public void adminConfigurationPage_shouldReturnExpectedValue() {
- String result = renderer.adminConfigurationPage("T");
-
- assertThat(result, is(navBuilder
- .pluginServlets()
- .path(SLACK_PATH, CONFIGURE_PATH)
- .withParam("teamId", "T")
- .buildAbsolute()));
+ // DummyNavBuilder fails to mock `withParam(name, value)` so that mocking manually
+ NavBuilder.PluginServlets pluginServlets = mock(NavBuilder.PluginServlets.class);
+ doReturn(pluginServlets).when(navBuilder).pluginServlets();
+ when(pluginServlets.path(SLACK_PATH, CONFIGURE_PATH)).thenReturn(pluginServlets);
+ when(pluginServlets.withParam("teamId", "T")).thenReturn(pluginServlets);
+
+ renderer.adminConfigurationPage("T");
+
+ verify(navBuilder).pluginServlets();
+ verify(pluginServlets).path(SLACK_PATH, CONFIGURE_PATH);
+ verify(pluginServlets).withParam("teamId", "T");
+ verify(pluginServlets).buildAbsolute();
}
@Test
diff --git a/confluence-slack-integration/confluence-7-compat/pom.xml b/confluence-slack-integration/confluence-7-compat/pom.xml
deleted file mode 100644
index e82acc7b..00000000
--- a/confluence-slack-integration/confluence-7-compat/pom.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
- 4.0.0
-
- confluence-slack-integration
- com.atlassian.plugins
- 1.1.13
-
-
- confluence-7-compat
- jar
- Confluence Data Center 7 Compatibility Package
-
-
-
- com.atlassian.confluence
- confluence
- ${confluence.7.version}
- provided
-
-
- com.atlassian.plugins
- confluence-compat-common
-
-
-
diff --git a/confluence-slack-integration/confluence-7-compat/src/main/java/com/atlassian/confluence/plugins/slack/util/compat/Confluence7CompatibilityHandler.java b/confluence-slack-integration/confluence-7-compat/src/main/java/com/atlassian/confluence/plugins/slack/util/compat/Confluence7CompatibilityHandler.java
deleted file mode 100644
index a1731d9c..00000000
--- a/confluence-slack-integration/confluence-7-compat/src/main/java/com/atlassian/confluence/plugins/slack/util/compat/Confluence7CompatibilityHandler.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.atlassian.confluence.plugins.slack.util.compat;
-
-import com.atlassian.confluence.search.v2.ContentSearch;
-import com.atlassian.confluence.search.v2.ISearch;
-import com.atlassian.confluence.search.v2.SearchFilter;
-import com.atlassian.confluence.search.v2.query.TextQuery;
-import com.atlassian.confluence.search.v2.searchfilter.ArchivedSpacesSearchFilter;
-import com.atlassian.confluence.search.v2.searchfilter.ContentPermissionsSearchFilter;
-import com.atlassian.confluence.search.v2.searchfilter.SpacePermissionsSearchFilter;
-import com.atlassian.confluence.search.v2.sort.RelevanceSort;
-import com.atlassian.confluence.user.ConfluenceUser;
-
-import javax.annotation.Nullable;
-
-public class Confluence7CompatibilityHandler extends BaseConfluenceCompatibilityHandler
- implements ConfluenceCompatibilityHandler {
- public static final Confluence7CompatibilityHandler INSTANCE = new Confluence7CompatibilityHandler();
-
- private Confluence7CompatibilityHandler() {}
-
- @Override
- public ISearch buildSearch(final String query, @Nullable final ConfluenceUser confluenceUser, final int offset,
- final int limit) {
- TextQuery textQuery = new TextQuery(query);
- SearchFilter filter = ContentPermissionsSearchFilter.getInstance()
- .and(new ArchivedSpacesSearchFilter(false, getSpaceManager()))
- .and(new SpacePermissionsSearchFilter(null, null));
- RelevanceSort sort = new RelevanceSort();
- ISearch searchConfig = new ContentSearch(textQuery, sort, filter, offset, limit);
-
- return searchConfig;
- }
-}
diff --git a/confluence-slack-integration/confluence-8-compat/pom.xml b/confluence-slack-integration/confluence-8-compat/pom.xml
deleted file mode 100644
index 732ff62e..00000000
--- a/confluence-slack-integration/confluence-8-compat/pom.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- 4.0.0
-
- confluence-slack-integration
- com.atlassian.plugins
- 1.1.13
-
-
- confluence-8-compat
- jar
- Confluence Data Center 8 Compatibility Package
-
-
-
- com.atlassian.confluence
- confluence
- 7.20.0
- provided
-
-
- com.atlassian.plugin
- atlassian-spring-scanner-annotation
- provided
-
-
- com.atlassian.plugins
- confluence-compat-common
-
-
-
diff --git a/confluence-slack-integration/confluence-compat-common/pom.xml b/confluence-slack-integration/confluence-compat-common/pom.xml
deleted file mode 100644
index f0610119..00000000
--- a/confluence-slack-integration/confluence-compat-common/pom.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
- 4.0.0
-
- confluence-slack-integration
- com.atlassian.plugins
- 1.1.13
-
-
- confluence-compat-common
- jar
- Confluence Data Center Compatibility Common Package
-
-
-
- com.atlassian.confluence
- confluence
- ${confluence.7.version}
- provided
-
-
-
diff --git a/confluence-slack-integration/confluence-compat-common/src/main/java/com/atlassian/confluence/plugins/slack/util/compat/BaseConfluenceCompatibilityHandler.java b/confluence-slack-integration/confluence-compat-common/src/main/java/com/atlassian/confluence/plugins/slack/util/compat/BaseConfluenceCompatibilityHandler.java
deleted file mode 100644
index 825e219b..00000000
--- a/confluence-slack-integration/confluence-compat-common/src/main/java/com/atlassian/confluence/plugins/slack/util/compat/BaseConfluenceCompatibilityHandler.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.atlassian.confluence.plugins.slack.util.compat;
-
-import com.atlassian.confluence.spaces.SpaceManager;
-import com.atlassian.sal.api.component.ComponentLocator;
-
-public class BaseConfluenceCompatibilityHandler {
- private SpaceManager spaceManager;
-
- protected SpaceManager getSpaceManager() {
- if (spaceManager == null) {
- spaceManager = ComponentLocator.getComponent(SpaceManager.class);
- }
- return spaceManager;
- }
-}
diff --git a/confluence-slack-integration/confluence-compat-common/src/main/java/com/atlassian/confluence/plugins/slack/util/compat/ConfluenceCompatibilityHandler.java b/confluence-slack-integration/confluence-compat-common/src/main/java/com/atlassian/confluence/plugins/slack/util/compat/ConfluenceCompatibilityHandler.java
deleted file mode 100644
index 6344dc06..00000000
--- a/confluence-slack-integration/confluence-compat-common/src/main/java/com/atlassian/confluence/plugins/slack/util/compat/ConfluenceCompatibilityHandler.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.atlassian.confluence.plugins.slack.util.compat;
-
-import com.atlassian.confluence.search.v2.ISearch;
-import com.atlassian.confluence.user.ConfluenceUser;
-
-import javax.annotation.Nullable;
-
-public interface ConfluenceCompatibilityHandler {
- ISearch buildSearch(String query, @Nullable ConfluenceUser confluenceUser, int offset, int limit);
-}
diff --git a/confluence-slack-integration/confluence-slack-server-integration-plugin/pom.xml b/confluence-slack-integration/confluence-slack-server-integration-plugin/pom.xml
index 8f0522e2..b964051c 100755
--- a/confluence-slack-integration/confluence-slack-server-integration-plugin/pom.xml
+++ b/confluence-slack-integration/confluence-slack-server-integration-plugin/pom.xml
@@ -4,14 +4,14 @@
com.atlassian.plugins
confluence-slack-integration
- 1.1.13
+ 2.0.0
com.atlassian.confluence.plugins
confluence-slack-server-integration-plugin
atlassian-plugin
Slack for Confluence Data Center
- 3.0.6-SNAPSHOT
+ 4.0.0-SNAPSHOT
This is the Slack integration for Confluence Data Center
@@ -22,13 +22,13 @@
${project.basedir}/..
- 7.10.0
+ 9.0.0-m81
- 7.10.0
+ 9.0.0-m81
${confluence.version}
- 8.6.0
+ 8.9.2
@@ -43,16 +43,6 @@
]
-
- com.atlassian.plugins
- confluence-8-compat
- ${slack.common.version}
-
-
- com.atlassian.plugins
- confluence-7-compat
- ${slack.common.version}
-
@@ -65,6 +55,33 @@
lombok
provided
+
+ org.hibernate
+ hibernate-core
+ 5.6.15.Final
+
+
+ javax.persistence
+ javax.persistence-api
+ 2.2
+
+
+ commons-beanutils
+ commons-beanutils
+ 1.9.4
+
+
+ commons-collections
+ commons-collections
+
+
+
+
+ opensymphony
+ xwork
+ 1.0.3.6
+
+
@@ -72,12 +89,6 @@
confluence
${confluence.api.version}
provided
-
-
- daisydiff
- org.outerj.daisy
-
-
com.atlassian.analytics
@@ -87,6 +98,7 @@
com.atlassian.cache
atlassian-cache-api
+ provided
org.apache.commons
@@ -104,15 +116,13 @@
provided
- org.codehaus.jackson
- jackson-core-asl
- 1.9.13-atlassian-1
+ com.fasterxml.jackson.core
+ jackson-annotations
provided
- org.codehaus.jackson
- jackson-mapper-asl
- 1.9.13-atlassian-1
+ com.fasterxml.jackson.core
+ jackson-databind
provided
@@ -121,8 +131,19 @@
provided
- javax.servlet
- javax.servlet-api
+ jakarta.servlet
+ jakarta.servlet-api
+ provided
+
+
+ javax.inject
+ javax.inject
+ 1
+ provided
+
+
+ jakarta.ws.rs
+ jakarta.ws.rs-api
provided
@@ -152,7 +173,12 @@
com.atlassian.plugins.rest
- atlassian-rest-common
+ atlassian-rest-v2-api
+ provided
+
+
+ io.atlassian.fugue
+ fugue
provided
@@ -209,10 +235,17 @@
atlassian-test-categories
test
+
+ org.glassfish.jersey.core
+ jersey-common
+ 2.42
+ test
+
com.atlassian.plugin
atlassian-spring-scanner-annotation
+ provided
@@ -230,7 +263,7 @@
com.atlassian.confluence
confluence-webdriver-pageobjects
- 11.4.5
+ 11.5.2
test
@@ -241,6 +274,22 @@
junit-dep
junit
+
+ javax.ws.rs
+ jsr311-api
+
+
+ com.sun.jersey
+ jersey-client
+
+
+ com.sun.jersey
+ jersey-core
+
+
+ com.atlassian.plugins
+ atlassian-plugins-api
+
@@ -251,7 +300,6 @@
org.slf4j
slf4j-simple
- ${slf4j.version}
test
@@ -326,14 +374,13 @@
com.atlassian.html.encode,
com.atlassian.json.marshal,
com.atlassian.plugin,
+ com.atlassian.plugin.module,
+ com.atlassian.plugin.elements,
com.atlassian.plugin.osgi.factory,
+ com.atlassian.plugin.osgi.module,
com.atlassian.plugin.web,
- com.atlassian.plugin.webresource,
- com.atlassian.plugin.webresource.condition,
- com.atlassian.plugin.webresource.transformer,
- com.atlassian.plugin.webresource.url,
com.atlassian.plugin.servlet,
- com.atlassian.plugins.rest.common.security,
+ com.atlassian.plugins.rest.api*,
com.atlassian.sal.api,
com.atlassian.sal.api.executor,
com.atlassian.sal.api.lifecycle,
@@ -347,12 +394,10 @@
com.atlassian.templaterenderer,
com.atlassian.util.concurrent,
com.atlassian.webresource.api,
- com.atlassian.webresource.api.prebake,
+ com.atlassian.webresource.spi,
com.google.common.base,
com.google.common.collect,
- com.sun.jersey.api.view,
- com.sun.jersey.api.uri,
javax.annotation,
javax.inject,
javax.naming,
@@ -361,12 +406,11 @@
javax.security.auth.x500,
javax.servlet,
javax.servlet.http,
- javax.ws.rs,
- javax.ws.rs.core,
- javax.ws.rs.ext,
+ javax.ws.rs*;version="[2.0.0,3.0.0)",
javax.xml.bind.annotation,
javax.xml.stream,
javax.xml.transform,
+ javax.persistence,
org.apache.commons.lang3,
org.apache.commons.lang3.text,
org.apache.commons.lang3.tuple,
@@ -374,7 +418,6 @@
org.apache.velocity,
org.apache.velocity.runtime,
org.apache.velocity.app.event,
- org.codehaus.jackson.annotate,
org.springframework.aop.support,
org.springframework.beans,
org.springframework.beans.factory,
@@ -476,7 +519,7 @@
com.atlassian.plugin
atlassian-spring-scanner-maven-plugin
- ${atlassian.spring.scanner.version}
+ 5.0.0
diff --git a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/ComponentImports.java b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/ComponentImports.java
index a99d4192..5e42af5e 100644
--- a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/ComponentImports.java
+++ b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/ComponentImports.java
@@ -25,7 +25,6 @@
import com.atlassian.plugin.module.ModuleFactory;
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
import com.atlassian.plugin.web.WebInterfaceManager;
-import com.atlassian.plugin.webresource.WebResourceUrlProvider;
import com.atlassian.sal.api.ApplicationProperties;
import com.atlassian.sal.api.auth.LoginUriProvider;
import com.atlassian.sal.api.executor.ThreadLocalDelegateExecutorFactory;
@@ -38,6 +37,7 @@
import com.atlassian.sal.api.web.context.HttpContext;
import com.atlassian.soy.renderer.SoyTemplateRenderer;
import com.atlassian.templaterenderer.TemplateRenderer;
+import com.atlassian.webresource.api.WebResourceUrlProvider;
import com.atlassian.webresource.api.assembler.PageBuilderService;
@SuppressWarnings("unused")
diff --git a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/actions/SlackViewSpaceConfigurationAction.java b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/actions/SlackViewSpaceConfigurationAction.java
index bf9b80df..fa123287 100644
--- a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/actions/SlackViewSpaceConfigurationAction.java
+++ b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/actions/SlackViewSpaceConfigurationAction.java
@@ -16,6 +16,7 @@
import com.atlassian.plugins.slack.link.SlackLinkManager;
import com.atlassian.plugins.slack.spi.SlackRoutesProviderFactory;
import com.atlassian.plugins.slack.user.SlackUserManager;
+import com.atlassian.xwork.PermittedMethods;
import com.github.seratch.jslack.api.model.User;
import com.google.common.collect.ImmutableMap;
import com.opensymphony.xwork.Action;
@@ -23,6 +24,7 @@
import java.util.List;
+import static com.atlassian.xwork.HttpMethod.GET;
import static com.google.common.collect.Lists.newArrayList;
@RequiredArgsConstructor
@@ -42,6 +44,7 @@ public class SlackViewSpaceConfigurationAction extends AbstractSpaceAdminAction
private SlackRoutesProvider routesProvider;
private String teamId;
+ @PermittedMethods(GET)
@Override
public String execute() {
List links = slackLinkManager.getLinks();
diff --git a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/actions/SlackViewSpaceInstallationAction.java b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/actions/SlackViewSpaceInstallationAction.java
index a8a4e2f0..9fdb4f6b 100644
--- a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/actions/SlackViewSpaceInstallationAction.java
+++ b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/actions/SlackViewSpaceInstallationAction.java
@@ -1,26 +1,31 @@
package com.atlassian.confluence.plugins.slack.spacetochannel.actions;
import com.atlassian.confluence.spaces.actions.AbstractSpaceAdminAction;
+import com.atlassian.xwork.PermittedMethods;
import com.opensymphony.xwork.Action;
+import javax.servlet.http.HttpSession;
import java.util.Map;
import static com.atlassian.confluence.plugins.slack.spi.impl.ConfluenceConfigurationRedirectionManager.FROM_SPACE_ATTRIBUTE_KEY;
import static com.atlassian.confluence.plugins.slack.spi.impl.ConfluenceConfigurationRedirectionManager.SPACE_ATTRIBUTE_KEY;
+import static com.atlassian.xwork.HttpMethod.GET;
public class SlackViewSpaceInstallationAction extends AbstractSpaceAdminAction {
static final String CONTEXT_ATTRIBUTE_LABEL = "context";
+ @PermittedMethods(GET)
@Override
public String execute() {
+ HttpSession session = getCurrentRequest().getSession();
@SuppressWarnings("unchecked")
- final Map contextFromSession = (Map) getCurrentSession().getAttribute(CONTEXT_ATTRIBUTE_LABEL);
+ final Map contextFromSession = (Map) session.getAttribute(CONTEXT_ATTRIBUTE_LABEL);
if (contextFromSession != null) {
- getCurrentSession().removeAttribute(CONTEXT_ATTRIBUTE_LABEL);
+ session.removeAttribute(CONTEXT_ATTRIBUTE_LABEL);
}
- getCurrentSession().setAttribute(FROM_SPACE_ATTRIBUTE_KEY, true);
- getCurrentSession().setAttribute(SPACE_ATTRIBUTE_KEY, getSpaceKey());
+ session.setAttribute(FROM_SPACE_ATTRIBUTE_KEY, true);
+ session.setAttribute(SPACE_ATTRIBUTE_KEY, getSpaceKey());
return Action.SUCCESS;
}
diff --git a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/configuration/SlackChannelDefinition.java b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/configuration/SlackChannelDefinition.java
index bd816961..6d0fa552 100644
--- a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/configuration/SlackChannelDefinition.java
+++ b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/configuration/SlackChannelDefinition.java
@@ -1,9 +1,9 @@
package com.atlassian.confluence.plugins.slack.spacetochannel.configuration;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Preconditions;
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
import java.util.Comparator;
import java.util.Objects;
diff --git a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/listener/SlackMessageEventListener.java b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/listener/SlackMessageEventListener.java
index fb3b1137..ca911aa5 100644
--- a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/listener/SlackMessageEventListener.java
+++ b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/listener/SlackMessageEventListener.java
@@ -15,9 +15,8 @@
import com.atlassian.confluence.plugins.slack.spacetochannel.model.PageType;
import com.atlassian.confluence.plugins.slack.spacetochannel.model.QuestionType;
import com.atlassian.confluence.plugins.slack.util.ConfluenceUserImpersonator;
+import com.atlassian.confluence.plugins.slack.util.SearchBuilder;
import com.atlassian.confluence.plugins.slack.util.TinyLinkHelper;
-import com.atlassian.confluence.plugins.slack.util.compat.ConfluenceCompatibilityDispatcher;
-import com.atlassian.confluence.plugins.slack.util.compat.ConfluenceCompatibilityHandler;
import com.atlassian.confluence.search.v2.ISearch;
import com.atlassian.confluence.search.v2.InvalidSearchException;
import com.atlassian.confluence.search.v2.SearchManager;
@@ -47,12 +46,12 @@
import com.github.seratch.jslack.api.methods.request.chat.ChatPostEphemeralRequest;
import com.github.seratch.jslack.api.methods.request.chat.ChatPostMessageRequest;
import com.github.seratch.jslack.api.model.Attachment;
-import com.sun.jersey.api.uri.UriComponent;
import io.atlassian.fugue.Pair;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import org.springframework.web.util.UriComponentsBuilder;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -95,7 +94,7 @@ public class SlackMessageEventListener extends AutoSubscribingEventListener {
private final SearchManager searchManager;
private final AnalyticsContextProvider analyticsContextProvider;
private final ConfluenceUserImpersonator confluenceUserImpersonator;
- private final ConfluenceCompatibilityDispatcher confluenceCompatibilityDispatcher;
+ private final SearchBuilder searchBuilder;
private final int maxSearchResultsToShow;
@@ -113,7 +112,7 @@ public SlackMessageEventListener(final EventPublisher eventPublisher,
final SearchManager searchManager,
final AnalyticsContextProvider analyticsContextProvider,
final ConfluenceUserImpersonator confluenceUserImpersonator,
- final ConfluenceCompatibilityDispatcher confluenceCompatibilityDispatcher) {
+ final SearchBuilder searchBuilder) {
super(eventPublisher);
this.eventPublisher = eventPublisher;
this.attachmentBuilder = attachmentBuilder;
@@ -128,7 +127,7 @@ public SlackMessageEventListener(final EventPublisher eventPublisher,
this.searchManager = searchManager;
this.analyticsContextProvider = analyticsContextProvider;
this.confluenceUserImpersonator = confluenceUserImpersonator;
- this.confluenceCompatibilityDispatcher = confluenceCompatibilityDispatcher;
+ this.searchBuilder = searchBuilder;
this.maxSearchResultsToShow = Integer.getInteger("slack.search.max.results", DEFAULT_MAX_SEARCH_RESULT_TO_SHOW);
}
@@ -330,7 +329,7 @@ private boolean userHasAccessToPage(final SpaceContentEntityObject page, final C
private Optional extends SpaceContentEntityObject> findContentFrom(final String url) {
final URI link = URI.create(url);
- final Optional byPageId = tryPageId(link);
+ final Optional byPageId = tryPageId(url);
if (byPageId.isPresent()) {
return byPageId;
}
@@ -338,16 +337,9 @@ private Optional extends SpaceContentEntityObject> findContentFrom(final Strin
// it should contain the path after the context path
final URI relativeLink = getContentPath(link);
try {
- final List segments = UriComponent
- .decodePath(relativeLink, false)
+ final List segments = UriComponentsBuilder.fromUri(relativeLink).build().getPathSegments()
.stream()
- .map(path -> {
- try {
- return URLDecoder.decode(path.getPath(), StandardCharsets.UTF_8.name());
- } catch (UnsupportedEncodingException e) {
- return path.getPath();
- }
- })
+ .map(this::decodeValue)
.collect(Collectors.toList());
final Optional byTinyUrl = tryTinyUrl(segments);
if (byTinyUrl.isPresent()) {
@@ -371,6 +363,14 @@ private Optional extends SpaceContentEntityObject> findContentFrom(final Strin
return Optional.empty();
}
+ private String decodeValue(String value) {
+ try {
+ return URLDecoder.decode(value, StandardCharsets.UTF_8.name());
+ } catch (UnsupportedEncodingException e) {
+ return value;
+ }
+ }
+
/**
* http://localhost:1990/confluence/display/TEAM/2019/02/06/Simple+blog
*/
@@ -428,8 +428,8 @@ private Optional tryTinyUrl(final List segments) {
* Pages and blogs are the same:
* http://localhost:1990/confluence/pages/viewpage.action?pageId=851986
*/
- private Optional tryPageId(final URI link) {
- return UriComponent.decodeQuery(link, true).entrySet().stream()
+ private Optional tryPageId(final String url) {
+ return UriComponentsBuilder.fromHttpUrl(decodeValue(url)).build().getQueryParams().entrySet().stream()
.filter(param -> "pageId".equals(param.getKey()))
.map(param -> getContentById(param.getValue().get(0)))
.filter(Optional::isPresent)
@@ -550,8 +550,7 @@ private List searchAtMostThatManyPagesOrBlogs(final St
@Nullable final ConfluenceUser confluenceUser,
final int pagesOrBlogsToSearch) {
List pagesOrBlogs = Collections.emptyList();
- ConfluenceCompatibilityHandler compatibilityHandler = confluenceCompatibilityDispatcher.getHandler();
- ISearch searchConfig = compatibilityHandler.buildSearch(query, confluenceUser, 0, pagesOrBlogsToSearch);
+ ISearch searchConfig = searchBuilder.buildSearch(query, confluenceUser, 0, pagesOrBlogsToSearch);
try {
SearchResults searchResults = searchManager.search(searchConfig);
diff --git a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/model/SpaceResult.java b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/model/SpaceResult.java
index 275dda21..e800886c 100644
--- a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/model/SpaceResult.java
+++ b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/model/SpaceResult.java
@@ -1,8 +1,9 @@
package com.atlassian.confluence.plugins.slack.spacetochannel.model;
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
diff --git a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/rest/SpaceToChannelConfigurationResource.java b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/rest/SpaceToChannelConfigurationResource.java
index f8f6b9c8..3eb7271d 100644
--- a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/rest/SpaceToChannelConfigurationResource.java
+++ b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/rest/SpaceToChannelConfigurationResource.java
@@ -25,6 +25,7 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
+import javax.inject.Inject;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.PUT;
@@ -47,7 +48,7 @@
@ReadOnlyAccessAllowed
@Path("/config/{spaceKey}")
@Slf4j
-@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RequiredArgsConstructor(onConstructor_ = {@Autowired, @Inject})
public class SpaceToChannelConfigurationResource {
private final SpaceManager spaceManager;
private final PermissionManager permissionManager;
diff --git a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/rest/SpaceToChannelSpaceResource.java b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/rest/SpaceToChannelSpaceResource.java
index 7780e0ca..c03ec250 100644
--- a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/rest/SpaceToChannelSpaceResource.java
+++ b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spacetochannel/rest/SpaceToChannelSpaceResource.java
@@ -5,6 +5,7 @@
import com.atlassian.confluence.user.ConfluenceUser;
import org.apache.commons.lang3.StringUtils;
+import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
@@ -19,6 +20,7 @@ public class SpaceToChannelSpaceResource {
private final SpacesWithAdminPermissionProvider defaultSpacesWithAdminPermissionProvider;
+ @Inject
public SpaceToChannelSpaceResource(final SpacesWithAdminPermissionProvider defaultSpacesWithAdminPermissionProvider) {
this.defaultSpacesWithAdminPermissionProvider = defaultSpacesWithAdminPermissionProvider;
}
diff --git a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spi/impl/ConfluenceSlackLinkAccessManager.java b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spi/impl/ConfluenceSlackLinkAccessManager.java
index 6a17f87a..f5200672 100644
--- a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spi/impl/ConfluenceSlackLinkAccessManager.java
+++ b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spi/impl/ConfluenceSlackLinkAccessManager.java
@@ -8,13 +8,13 @@
import com.atlassian.sal.api.user.UserManager;
import com.atlassian.sal.api.user.UserProfile;
import com.atlassian.user.User;
-import com.sun.jersey.spi.container.ContainerRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
+import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.core.MultivaluedMap;
import java.util.Optional;
@@ -50,7 +50,7 @@ private boolean hasAccess(UserProfile userProfile, Optional space) {
}
@Override
- public boolean hasAccess(UserProfile userProfile, ContainerRequest request) {
+ public boolean hasAccess(UserProfile userProfile, ContainerRequestContext request) {
if (super.hasAccess(userProfile, request)) {
return true;
}
@@ -70,8 +70,8 @@ public boolean hasAccess(UserProfile userProfile, HttpServletRequest request) {
return hasAccess(userProfile, space);
}
- private Optional getSpace(ContainerRequest request) {
- MultivaluedMap params = request.getQueryParameters();
+ private Optional getSpace(ContainerRequestContext request) {
+ MultivaluedMap params = request.getUriInfo().getQueryParameters();
String spaceKey = params.getFirst("key");
return getSpaceFromKey(spaceKey);
diff --git a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spi/impl/ConfluenceSlackPluginResourceProvider.java b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spi/impl/ConfluenceSlackPluginResourceProvider.java
index 27977765..44b9e2e3 100644
--- a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spi/impl/ConfluenceSlackPluginResourceProvider.java
+++ b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spi/impl/ConfluenceSlackPluginResourceProvider.java
@@ -1,9 +1,9 @@
package com.atlassian.confluence.plugins.slack.spi.impl;
import com.atlassian.confluence.plugins.slack.spacetochannel.notifications.ConfluencePersonalNotificationTypes;
-import com.atlassian.plugin.webresource.UrlMode;
-import com.atlassian.plugin.webresource.WebResourceUrlProvider;
import com.atlassian.plugins.slack.spi.SlackPluginResourceProvider;
+import com.atlassian.webresource.api.UrlMode;
+import com.atlassian.webresource.api.WebResourceUrlProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
diff --git a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spi/impl/SpaceAwareSlackRoutesProvider.java b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spi/impl/SpaceAwareSlackRoutesProvider.java
index bd9312d7..3c0ca1b6 100644
--- a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spi/impl/SpaceAwareSlackRoutesProvider.java
+++ b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/spi/impl/SpaceAwareSlackRoutesProvider.java
@@ -33,6 +33,6 @@ public URI baseUrl() {
public URI getAdminConfigurationPage() {
return UriBuilder.fromPath(SLACK_SPACE_ADMIN)
.queryParam("key", spaceKey)
- .build(baseUrl());
+ .build(new Object[]{baseUrl()}, false);
}
}
diff --git a/confluence-slack-integration/confluence-8-compat/src/main/java/com/atlassian/confluence/plugins/slack/util/compat/Confluence8CompatibilityHandler.java b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/util/SearchBuilder.java
similarity index 68%
rename from confluence-slack-integration/confluence-8-compat/src/main/java/com/atlassian/confluence/plugins/slack/util/compat/Confluence8CompatibilityHandler.java
rename to confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/util/SearchBuilder.java
index b3d6aaab..e1d6c74c 100644
--- a/confluence-slack-integration/confluence-8-compat/src/main/java/com/atlassian/confluence/plugins/slack/util/compat/Confluence8CompatibilityHandler.java
+++ b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/util/SearchBuilder.java
@@ -1,4 +1,4 @@
-package com.atlassian.confluence.plugins.slack.util.compat;
+package com.atlassian.confluence.plugins.slack.util;
import com.atlassian.confluence.search.v2.ContentSearch;
import com.atlassian.confluence.search.v2.ISearch;
@@ -9,26 +9,25 @@
import com.atlassian.confluence.search.v2.query.ContentPermissionsQuery;
import com.atlassian.confluence.search.v2.query.TextQuery;
import com.atlassian.confluence.search.v2.sort.RelevanceSort;
+import com.atlassian.confluence.spaces.SpaceManager;
import com.atlassian.confluence.user.ConfluenceUser;
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
import com.atlassian.sal.api.component.ComponentLocator;
+import org.springframework.stereotype.Component;
import javax.annotation.Nullable;
import java.util.HashSet;
import java.util.Set;
-public class Confluence8CompatibilityHandler extends BaseConfluenceCompatibilityHandler
- implements ConfluenceCompatibilityHandler {
- public static final Confluence8CompatibilityHandler INSTANCE = new Confluence8CompatibilityHandler();
-
- // component is imported here instead of ComponentImports class intentionally because SpacePermissionQueryFactory
- // is only available since Confluence 7.17, while ComponentImports are compiled against libraries of older Confluence
+@Component
+public class SearchBuilder {
@ComponentImport
private SpacePermissionQueryFactory spacePermissionQueryFactory;
+ private SpaceManager spaceManager;
- private Confluence8CompatibilityHandler() {}
+ private SearchBuilder() {
+ }
- @Override
public ISearch buildSearch(final String query, @Nullable final ConfluenceUser confluenceUser, final int offset,
final int limit) {
Set searchQueries = new HashSet<>();
@@ -42,11 +41,20 @@ public ISearch buildSearch(final String query, @Nullable final ConfluenceUser co
.build());
searchQueries.add(getSpacePermissionQueryFactory().create(confluenceUser));
}
- SearchQuery searchQuery = BooleanQuery.composeAndQuery(searchQueries);
- RelevanceSort sort = new RelevanceSort();
- ISearch searchConfig = new ContentSearch(searchQuery, sort, offset, limit);
- return searchConfig;
+ return ContentSearch.builder()
+ .query(BooleanQuery.composeAndQuery(searchQueries))
+ .sort(new RelevanceSort())
+ .startOffset(offset)
+ .limit(limit)
+ .build();
+ }
+
+ protected SpaceManager getSpaceManager() {
+ if (spaceManager == null) {
+ spaceManager = ComponentLocator.getComponent(SpaceManager.class);
+ }
+ return spaceManager;
}
private SpacePermissionQueryFactory getSpacePermissionQueryFactory() {
diff --git a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/util/compat/ConfluenceCompatibilityDispatcher.java b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/util/compat/ConfluenceCompatibilityDispatcher.java
deleted file mode 100644
index 445f2fd5..00000000
--- a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/java/com/atlassian/confluence/plugins/slack/util/compat/ConfluenceCompatibilityDispatcher.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.atlassian.confluence.plugins.slack.util.compat;
-
-import com.atlassian.confluence.util.GeneralUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Component;
-
-@Slf4j
-@Component
-public class ConfluenceCompatibilityDispatcher {
- private ConfluenceCompatibilityHandler handler;
-
- public ConfluenceCompatibilityHandler getHandler() {
- if (handler == null) {
- String versionNumber = GeneralUtil.getVersionNumber();
- log.debug("Detected product version: {}", versionNumber);
-
- String[] versionParts = versionNumber.split("\\.");
- if (versionParts.length < 1) {
- throw new IllegalStateException("Version number is empty: " + versionNumber);
- }
-
- String majorVersionString = versionParts[0];
- try {
- int majorVersion = Integer.parseUnsignedInt(majorVersionString);
- handler = majorVersion > 7
- ? Confluence8CompatibilityHandler.INSTANCE
- : Confluence7CompatibilityHandler.INSTANCE;
- } catch (NumberFormatException e) {
- throw new IllegalStateException("Major version is not an integer: " + majorVersionString, e);
- }
- }
-
- return handler;
- }
-}
diff --git a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/resources/atlassian-plugin.xml b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/resources/atlassian-plugin.xml
index 001e08cc..8ee9f1d0 100644
--- a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/resources/atlassian-plugin.xml
+++ b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/main/resources/atlassian-plugin.xml
@@ -170,7 +170,7 @@
weight="0">
Slack Space Configuration
- /spaces/slack2.action?key=$generalUtil.urlEncode($space.key)
+ /spaces/slack2.action?key=$htmlUtil.urlEncode($space.key)
$webResourceManager.getStaticPluginResource("com.atlassian.confluence.plugins.confluence-slack-server-integration-plugin:slack-image-resources",
@@ -190,7 +190,7 @@
weight="0">
Slack Space Configuration
- /spaces/slack2.action?key=$generalUtil.urlEncode($space.key)
+ /spaces/slack2.action?key=$htmlUtil.urlEncode($space.key)
$webResourceManager.getStaticPluginResource("com.atlassian.confluence.plugins.confluence-slack-server-integration-plugin:slack-image-resources",
@@ -205,6 +205,12 @@
+
+
+
+
+
+
REQUEST
FORWARD
@@ -490,7 +496,7 @@
-
+
diff --git a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/test/java/com/atlassian/confluence/plugins/slack/spacetochannel/actions/SlackViewSpaceConfigurationActionTest.java b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/test/java/com/atlassian/confluence/plugins/slack/spacetochannel/actions/SlackViewSpaceConfigurationActionTest.java
index aafceafe..09c230cb 100644
--- a/confluence-slack-integration/confluence-slack-server-integration-plugin/src/test/java/com/atlassian/confluence/plugins/slack/spacetochannel/actions/SlackViewSpaceConfigurationActionTest.java
+++ b/confluence-slack-integration/confluence-slack-server-integration-plugin/src/test/java/com/atlassian/confluence/plugins/slack/spacetochannel/actions/SlackViewSpaceConfigurationActionTest.java
@@ -28,7 +28,6 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
-import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
@@ -105,12 +104,34 @@ public class SlackViewSpaceConfigurationActionTest {
@Captor
private ArgumentCaptor
diff --git a/pom.xml b/pom.xml
index 7aa90742..b68b694e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,9 +1,10 @@
-
+
4.0.0
com.atlassian.plugins
atlassian-slack-server-integration-parent
- 1.1.13
+ 2.0.0
pom
Atlassian Slack Integration for Server Project
@@ -23,8 +24,8 @@
UTF-8
UTF-8
- 1.8
- 1.8
+ 17
+ 17
${project.basedir}
${project.root.directory}
@@ -45,41 +46,22 @@
github
- 2.1.7
- 3.15
- 1.7.25
- 3.1.0
2.25.0
4.13.2
5.7.1
- 2.9.2
2.3
- 4.7.2
3.8
1.11
- 2.9.2
- 2.1.0
- 4.0.0
- 1.3.0
+ 6.0.0
4.10.0
- 3.0.1
- 5.3.18
- 5.3.19
- 3.0.15
- 3.0.1
3.0
- 2.1.0
1.3
- 3.0.0
- 0.9
2.0.2
- 2.1.1
- 3.5.39
- 3.2.0
-
- 1.1.13
+ 2.0.0
+ 7.0.0
+
@@ -91,9 +73,12 @@
1.0-alpha-2
- org.apache.maven.surefire
+ org.apache.maven.plugins
maven-surefire-plugin
2.22.1
+
+ ${jvm17.opens}
+
org.apache.maven.plugins
@@ -117,10 +102,25 @@
- javax.ws.rs
- jsr311-api
- 1.1.1
- provided
+ com.atlassian.platform.dependencies
+ platform-public-api
+ ${platform.version}
+ pom
+ import
+
+
+ com.atlassian.platform.dependencies
+ platform-test-resources
+ ${platform.version}
+ pom
+ import
+
+
+ com.atlassian.platform.dependencies
+ platform-internal-api
+ ${platform.version}
+ pom
+ import
com.github.seratch
@@ -140,19 +140,6 @@
2.8.9
-
- com.atlassian.plugin
- atlassian-spring-scanner-annotation
- ${atlassian.spring.scanner.version}
- provided
-
-
-
- com.atlassian.soy
- soy-template-renderer-api
- ${soy-template-renderer.version}
-
-
com.atlassian.plugins
slack-server-integration-common
@@ -165,33 +152,12 @@
test
-
- org.slf4j
- slf4j-api
- ${slf4j.version}
- provided
-
-
- org.slf4j
- slf4j-simple
- ${slf4j.version}
- provided
-
joda-time
joda-time
${joda-time.version}
-
- com.atlassian.analytics
- analytics-api
- ${analytics-api.version}
-
-
- com.atlassian.sal
- sal-api
- ${sal.api.version}
-
+
com.atlassian.user
atlassian-user
@@ -220,16 +186,6 @@
${hamcrest-core.version}
test
-
- javax.servlet
- javax.servlet-api
- ${servlet.version}
-
-
- javax.annotation
- javax.annotation-api
- 1.3.2
-
com.atlassian.ozymandias
atlassian-plugin-point-safety
@@ -274,11 +230,6 @@
2.25.0
test
-
- com.atlassian.templaterenderer
- atlassian-template-renderer-api
- ${template.renderer.version}
-
org.mockito
mockito-core
@@ -291,80 +242,7 @@
test
-
- com.atlassian.plugins.rest
- atlassian-rest-common
- ${rest.version}
-
-
- fugue
- com.atlassian.fugue
-
-
- jackson-core-asl
- org.codehaus.jackson
-
-
- jackson-jaxrs
- org.codehaus.jackson
-
-
- jackson-mapper-asl
- org.codehaus.jackson
-
-
- jackson-xc
- org.codehaus.jackson
-
-
- provided
-
-
- com.atlassian.plugins.rest
- atlassian-rest-module
- ${rest.version}
-
-
- com.atlassian.plugins
- atlassian-plugins-core
- ${atlassian-plugins-core.version}
-
-
- com.atlassian.plugins
- atlassian-plugins-webfragment
- ${atlassian-plugins-webfragment.version}
-
-
- com.atlassian.plugins
- atlassian-plugins-webresource
- ${webresource.version}
-
-
- fugue
- com.atlassian.fugue
-
-
-
-
- org.springframework
- spring-test
- ${spring-test.version}
-
-
- org.springframework
- spring-beans
- ${spring-beans.version}
-
-
- org.springframework
- spring-webmvc
- ${spring-beans.version}
-
-
- org.springframework
- spring-context
- ${spring-beans.version}
-
+
com.atlassian.activeobjects
activeobjects-plugin
@@ -376,11 +254,6 @@
-
- io.atlassian.fugue
- fugue
- ${io.fugue.version}
-
org.apache.commons
commons-lang3
@@ -402,26 +275,6 @@
commons-codec
${commons-codec.version}
-
- com.atlassian.annotations
- atlassian-annotations
- ${atlassian-annotations.version}
-
-
- com.atlassian.event
- atlassian-event
- ${atlassian-event.version}
-
-
- com.atlassian.util.concurrent
- atlassian-util-concurrent
- ${atlassian-concurrent.version}
-
-
- com.atlassian.json
- atlassian-json-api
- ${atlassian-json-api.version}
-
org.powermock
powermock-api-mockito2
@@ -454,22 +307,7 @@
-
- com.atlassian.applinks
- applinks-host
- 4.1.1
-
-
- com.atlassian.applinks
- applinks-api
- 4.2.3
-
-
- com.atlassian.cache
- atlassian-cache-api
- ${atlassian-cache.version}
- provided
-
+
com.atlassian
@@ -490,41 +328,18 @@
${okhttp.version}
test
-
-
-
- org.codehaus.jackson
- jackson-core-asl
- 1.9.1
- provided
-
-
- org.codehaus.jackson
- jackson-mapper-asl
- 1.9.1
- provided
-
-
+
+ --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.ref=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.jar=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-opens=java.base/sun.util.locale=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-exports=java.base/sun.security.action=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-exports=java.xml/com.sun.org.apache.xml.internal.utils=ALL-UNNAMED --add-exports=java.desktop/sun.font=ALL-UNNAMED --add-exports=java.base/sun.security.util=ALL-UNNAMED
+
+
jacoco
diff --git a/slack-server-integration-common/pom.xml b/slack-server-integration-common/pom.xml
index 6da4dd6d..a382d880 100644
--- a/slack-server-integration-common/pom.xml
+++ b/slack-server-integration-common/pom.xml
@@ -4,7 +4,7 @@
com.atlassian.plugins
atlassian-slack-server-integration-parent
- 1.1.13
+ 2.0.0
slack-server-integration-common
@@ -12,14 +12,19 @@
Provides resources and functionality for linking Atlassian products with slack.
-
- org.codehaus.jackson
- jackson-core-asl
+ com.fasterxml.jackson.core
+ jackson-annotations
+ provided
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ provided
- org.codehaus.jackson
- jackson-mapper-asl
+ com.atlassian.security
+ atlassian-secure-random
@@ -38,19 +43,11 @@
com.atlassian.plugins
atlassian-plugins-api
- 4.5.1
provided
-
-
- fugue
- com.atlassian.fugue
-
-
com.atlassian.fugue
fugue
- 1.2.0
provided
@@ -83,24 +80,35 @@
atlassian-template-renderer-api
provided
+
+ com.atlassian.velocity.htmlsafe
+ velocity-htmlsafe
+ provided
+
commons-codec
commons-codec
provided
- javax.ws.rs
- jsr311-api
+ jakarta.ws.rs
+ jakarta.ws.rs-api
provided
- javax.servlet
- javax.servlet-api
+ javax.inject
+ javax.inject
+ 1
provided
- javax.annotation
- javax.annotation-api
+ jakarta.servlet
+ jakarta.servlet-api
+ provided
+
+
+ jakarta.annotation
+ jakarta.annotation-api
provided
@@ -140,7 +148,7 @@
com.atlassian.plugins.rest
- atlassian-rest-common
+ atlassian-rest-v2-api
provided
@@ -179,6 +187,16 @@
atlassian-spring-scanner-annotation
provided
+
+ com.atlassian.plugins
+ atlassian-plugins-core
+ provided
+
+
+ com.atlassian.util.concurrent
+ atlassian-util-concurrent
+ provided
+
@@ -216,6 +234,11 @@
mockito-core
test
+
+ net.bytebuddy
+ byte-buddy
+ 1.11.22
+
joda-time
joda-time
@@ -237,6 +260,12 @@
atlassian-json-api
provided
+
+ org.glassfish.jersey.core
+ jersey-common
+ 2.42
+ test
+
diff --git a/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/admin/InstallationCompletionData.java b/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/admin/InstallationCompletionData.java
index 9d25ef55..684daace 100644
--- a/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/admin/InstallationCompletionData.java
+++ b/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/admin/InstallationCompletionData.java
@@ -1,6 +1,6 @@
package com.atlassian.plugins.slack.admin;
-import org.codehaus.jackson.annotate.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
diff --git a/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/ao/AOSlackUser.java b/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/ao/AOSlackUser.java
index c0268576..6f56461e 100644
--- a/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/ao/AOSlackUser.java
+++ b/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/ao/AOSlackUser.java
@@ -1,13 +1,13 @@
package com.atlassian.plugins.slack.ao;
import com.atlassian.plugins.slack.api.SlackUser;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import net.java.ao.Preload;
import net.java.ao.RawEntity;
import net.java.ao.schema.Indexed;
import net.java.ao.schema.NotNull;
import net.java.ao.schema.PrimaryKey;
import net.java.ao.schema.Table;
-import org.codehaus.jackson.annotate.JsonIgnore;
@Table("AOSLACK_USER")
@Preload
diff --git a/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/DelayedSlackMessage.java b/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/DelayedSlackMessage.java
index 2cb3f544..8e236bfb 100644
--- a/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/DelayedSlackMessage.java
+++ b/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/DelayedSlackMessage.java
@@ -1,8 +1,8 @@
package com.atlassian.plugins.slack.api;
+import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.seratch.jslack.api.model.Attachment;
import com.github.seratch.jslack.api.model.block.LayoutBlock;
-import org.codehaus.jackson.annotate.JsonProperty;
import java.util.ArrayList;
import java.util.List;
diff --git a/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/condition/IsSlackEnabledUrlReadingCondition.java b/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/condition/IsSlackEnabledUrlReadingCondition.java
index d83cca99..f650309e 100644
--- a/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/condition/IsSlackEnabledUrlReadingCondition.java
+++ b/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/condition/IsSlackEnabledUrlReadingCondition.java
@@ -2,12 +2,12 @@
import com.atlassian.plugin.PluginParseException;
import com.atlassian.plugin.web.Condition;
-import com.atlassian.plugin.webresource.condition.SimpleUrlReadingCondition;
import com.atlassian.plugins.slack.link.SlackLinkManager;
+import com.atlassian.webresource.spi.condition.AbstractBooleanUrlReadingCondition;
import java.util.Map;
-public class IsSlackEnabledUrlReadingCondition extends SimpleUrlReadingCondition implements Condition {
+public class IsSlackEnabledUrlReadingCondition extends AbstractBooleanUrlReadingCondition implements Condition {
private static final String SLACK_ENABLED_PARAM = "slack-enabled";
private final SlackLinkManager slackLinkManager;
diff --git a/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/descriptor/SlackNotificationContextDescriptor.java b/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/descriptor/SlackNotificationContextDescriptor.java
index 524579d2..96ba1870 100644
--- a/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/descriptor/SlackNotificationContextDescriptor.java
+++ b/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/descriptor/SlackNotificationContextDescriptor.java
@@ -3,15 +3,15 @@
import com.atlassian.plugin.Plugin;
import com.atlassian.plugin.PluginParseException;
import com.atlassian.plugin.descriptors.AbstractModuleDescriptor;
+import com.atlassian.plugin.module.Element;
import com.atlassian.plugin.module.ModuleFactory;
import com.atlassian.plugins.slack.api.notification.SlackNotificationContext;
import com.atlassian.util.concurrent.ResettableLazyReference;
-import org.dom4j.Element;
public class SlackNotificationContextDescriptor extends AbstractModuleDescriptor {
private String value;
- private final ResettableLazyReference moduleReference = new ResettableLazyReference() {
+ private final ResettableLazyReference moduleReference = new ResettableLazyReference<>() {
@Override
protected SlackNotificationContext create() {
return createModule();
diff --git a/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/descriptor/SlackNotificationDescriptor.java b/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/descriptor/SlackNotificationDescriptor.java
index 23e95628..1e636909 100644
--- a/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/descriptor/SlackNotificationDescriptor.java
+++ b/slack-server-integration-common/src/main/java/com/atlassian/plugins/slack/api/descriptor/SlackNotificationDescriptor.java
@@ -3,10 +3,10 @@
import com.atlassian.plugin.Plugin;
import com.atlassian.plugin.PluginParseException;
import com.atlassian.plugin.descriptors.AbstractModuleDescriptor;
+import com.atlassian.plugin.module.Element;
import com.atlassian.plugin.module.ModuleFactory;
import com.atlassian.plugins.slack.api.notification.SlackNotification;
import com.atlassian.util.concurrent.ResettableLazyReference;
-import org.dom4j.Element;
public class SlackNotificationDescriptor extends AbstractModuleDescriptor> {
private String value;
@@ -15,7 +15,7 @@ public class SlackNotificationDescriptor extends AbstractModuleDescriptor> moduleReference = new ResettableLazyReference>() {
+ private final ResettableLazyReference> moduleReference = new ResettableLazyReference<>() {
@Override
protected SlackNotification