Skip to content

Commit 8129af3

Browse files
authored
Merge pull request #438 from kbase/develop
0.7.1 release (develop -> master)
2 parents cdbecfd + b93fdd8 commit 8129af3

14 files changed

Lines changed: 57 additions & 53 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ jobs:
5858
- name: Upload coverage to Codecov
5959
uses: codecov/codecov-action@v3
6060
with:
61+
token: ${{ secrets.CODECOV_TOKEN }}
6162
fail_ci_if_error: true

RELEASE_NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Authentication Service MKII release notes
22

3+
## 0.7.1
4+
5+
* Publishes a shadow jar on jitpack.io for supporting tests in other repos.
6+
37
## 0.7.0
48

59
* BACKWARDS INCOMPATIBILITY - the auth server now logs to stdout vs. syslog.

build.gradle

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,24 @@ plugins {
66
id 'java'
77
id 'war'
88
id 'jacoco'
9+
id 'maven-publish'
910
id 'org.ajoberstar.grgit' version '4.1.1'
1011
id 'com.github.johnrengelman.shadow' version '8.1.1'
1112
}
1213

14+
group = 'com.github.kbase'
15+
1316
repositories {
1417
mavenCentral()
18+
19+
maven {
20+
name = "Clojars"
21+
url = "https://repo.clojars.org/"
22+
}
23+
maven {
24+
name = "JitPack"
25+
url = 'https://jitpack.io'
26+
}
1527
}
1628
// Warning - these values are hard coded in AuthController.java
1729
def JAR_TEMPLATE_DIR = 'kbase_auth2_templates'
@@ -26,13 +38,9 @@ task buildGitCommitFile {
2638
}
2739

2840
compileJava {
29-
if (JavaVersion.current() <= JavaVersion.VERSION_1_8) {
30-
// TODO BUILD remove when we no longer support java 8
31-
java.sourceCompatibility = JavaVersion.VERSION_1_8
32-
java.targetCompatibility = JavaVersion.VERSION_1_8
33-
} else {
34-
options.release = 8
35-
}
41+
// TODO BUILD remove when we no longer support java 8, use `options.release = 11` if needed
42+
java.sourceCompatibility = JavaVersion.VERSION_1_8
43+
java.targetCompatibility = JavaVersion.VERSION_1_8
3644
finalizedBy buildGitCommitFile
3745
}
3846

@@ -136,23 +144,17 @@ java -cp build/classes/java/main:\$CLASSPATH us.kbase.auth2.cli.AuthCLI \$@
136144
}
137145
}
138146

139-
def fromURL = { url, name ->
140-
File file = new File("$buildDir/download/${name}.jar")
141-
file.parentFile.mkdirs()
142-
if (!file.exists()) {
143-
new URL(url).withInputStream { downloadStream ->
144-
file.withOutputStream { fileOut ->
145-
fileOut << downloadStream
146-
}
147+
publishing {
148+
publications {
149+
shadow(MavenPublication) { publication ->
150+
project.shadow.component(publication)
151+
artifactId = "auth2-test-shadow-all"
147152
}
148153
}
149-
files(file.absolutePath)
150154
}
151155

152156
dependencies {
153157

154-
// ### General application dependencies ###
155-
156158
/* Notes on exclusions:
157159
* Bizarrely, the glassfish verison of inject has a dependency on v1 inject, which
158160
* causes problems when trying to build the fat jar
@@ -171,6 +173,20 @@ dependencies {
171173
implementation 'org.mongodb:mongodb-driver-sync:4.11.1'
172174
implementation 'org.mongodb:bson-record-codec:4.11.1'
173175
implementation 'org.mongodb:bson:4.11.1'
176+
implementation('com.github.kbase:java_common:0.3.0') {
177+
exclude group: 'net.java.dev.jna' // breaks shadow jar
178+
exclude group: 'org.eclipse.jetty.aggregate' // ugh, java common pollutes everything
179+
exclude group: 'com.fasterxml.jackson.core' // breaks everything if we upgrade
180+
exclude group: 'javax.servlet', module: 'servlet-api' // 2.5 vs 3.1 below
181+
// I have no idea why, but including the auth client in the build causes the shadow
182+
// jar to fail to start correctly. It shouldn't be a problem, but it is
183+
exclude group: 'com.github.kbase', module: 'auth2_client_java'
184+
}
185+
implementation 'ch.qos.logback:logback-classic:1.1.2'
186+
implementation 'org.slf4j:slf4j-api:1.7.25'
187+
// TODO DEPS Need to rework the java common logger to not use syslog4j at all since it's
188+
// abandonware and has a ton of CVEs, even in the newer versions.
189+
implementation "org.syslog4j:syslog4j:0.9.46"
174190
implementation 'com.github.spullara.mustache.java:compiler:0.9.3'
175191
implementation 'com.nulab-inc:zxcvbn:1.2.2'
176192
implementation 'nl.basjes.parse.useragent:yauaa:1.3'
@@ -196,28 +212,6 @@ dependencies {
196212
implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359'
197213

198214

199-
// ### Logging dependencies ###
200-
implementation fromURL(
201-
'https://github.com/kbase/jars/raw/master/lib/jars/kbase/common/kbase-common-0.2.0.jar',
202-
'kbase-common-0.2.0'
203-
)
204-
implementation 'ch.qos.logback:logback-classic:1.1.2'
205-
implementation 'org.slf4j:slf4j-api:1.7.25'
206-
// Syslog4j 0.9.46 doesn't appear to be available on Maven. It apparently lives in
207-
// a JetBrains artifact server, but that's too much trouble and there's only one version there
208-
// anyway.
209-
// https://mvnrepository.com/artifact/org.jetbrains/syslog4j/0.9.46
210-
// Need to rework the java common logger to not use syslog4j at all since it's abandonware
211-
// and has a ton of CVEs, even in the newer versions.
212-
implementation fromURL(
213-
'https://github.com/kbase/jars/raw/master/lib/jars/syslog4j/syslog4j-0.9.46.jar',
214-
'syslog4j-0.9.46'
215-
)
216-
// needed for syslog4j
217-
implementation 'joda-time:joda-time:2.3'
218-
219-
// ### Test ###
220-
221215
testImplementation 'commons-io:commons-io:2.4'
222216
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.1.10'
223217
testImplementation 'junit:junit:4.12'
@@ -233,6 +227,9 @@ dependencies {
233227
testImplementation 'de.danielbechler:java-object-diff:0.94'
234228
testImplementation 'org.jsoup:jsoup:1.10.2'
235229
testImplementation 'org.mockito:mockito-core:3.0.0'
230+
testImplementation('com.github.kbase:java_test_utilities:0.1.0') {
231+
exclude group: 'com.fasterxml.jackson.core' // upgrading breaks stuff
232+
}
236233
}
237234

238235
task showTestClassPath {

src/main/java/us/kbase/auth2/Version.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
public class Version {
66

77
/** The version of the KBase Auth2 service. */
8-
public static final String VERSION = "0.7.0";
8+
public static final String VERSION = "0.7.1";
99

1010
}

src/test/java/us/kbase/test/auth2/MongoStorageTestManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import us.kbase.auth2.cryptutils.RandomDataGenerator;
2323
import us.kbase.auth2.lib.storage.mongo.MongoStorage;
24-
import us.kbase.common.test.controllers.mongo.MongoController;
24+
import us.kbase.testutils.controllers.mongo.MongoController;
2525

2626
public class MongoStorageTestManager {
2727

src/test/java/us/kbase/test/auth2/TestCommon.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import us.kbase.auth2.lib.TemporarySessionData;
4040
import us.kbase.auth2.lib.UserName;
4141
import us.kbase.auth2.lib.token.TemporaryToken;
42-
import us.kbase.common.test.TestException;
42+
import us.kbase.testutils.TestException;
4343

4444
public class TestCommon {
4545

src/test/java/us/kbase/test/auth2/authcontroller/AuthController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package us.kbase.test.auth2.authcontroller;
22

3-
import static us.kbase.common.test.controllers.ControllerCommon.findFreePort;
4-
import static us.kbase.common.test.controllers.ControllerCommon.makeTempDirs;
3+
import static us.kbase.testutils.controllers.ControllerCommon.findFreePort;
4+
import static us.kbase.testutils.controllers.ControllerCommon.makeTempDirs;
55
import static us.kbase.test.auth2.TestConfigurator.MONGO_HOST_KEY;
66
import static us.kbase.test.auth2.TestConfigurator.MONGO_DB_KEY;
77
import static us.kbase.test.auth2.TestConfigurator.MONGO_TEMPLATES_KEY;
@@ -27,7 +27,7 @@
2727

2828
import com.fasterxml.jackson.databind.ObjectMapper;
2929

30-
import us.kbase.common.test.TestException;
30+
import us.kbase.testutils.TestException;
3131
import us.kbase.test.auth2.StandaloneAuthServer;
3232

3333
/** Q&D utility to run the auth server in test mode for use in testing rigs. Expected to

src/test/java/us/kbase/test/auth2/lib/storage/mongo/MongoStorageTester.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
import us.kbase.auth2.cryptutils.RandomDataGenerator;
1414
import us.kbase.auth2.lib.storage.mongo.MongoStorage;
15-
import us.kbase.common.test.controllers.mongo.MongoController;
1615
import us.kbase.test.auth2.MongoStorageTestManager;
16+
import us.kbase.testutils.controllers.mongo.MongoController;
1717

1818
public class MongoStorageTester {
1919

src/test/java/us/kbase/test/auth2/service/LoggingFilterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
import us.kbase.auth2.service.AuthStartupConfig;
4343
import us.kbase.auth2.service.LoggingFilter;
4444
import us.kbase.auth2.service.SLF4JAutoLogger;
45-
import us.kbase.common.test.RegexMatcher;
4645
import us.kbase.test.auth2.MongoStorageTestManager;
4746
import us.kbase.test.auth2.StandaloneAuthServer;
4847
import us.kbase.test.auth2.TestCommon;
48+
import us.kbase.testutils.RegexMatcher;
4949
import us.kbase.test.auth2.StandaloneAuthServer.ServerThread;
5050

5151
public class LoggingFilterTest {

src/test/java/us/kbase/test/auth2/service/ServiceTestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@
5757
import us.kbase.auth2.lib.token.TokenName;
5858
import us.kbase.auth2.lib.token.TokenType;
5959
import us.kbase.auth2.service.AuthExternalConfig;
60-
import us.kbase.common.test.RegexMatcher;
6160
import us.kbase.test.auth2.MockIdentityProviderFactory;
6261
import us.kbase.test.auth2.MongoStorageTestManager;
6362
import us.kbase.test.auth2.TestCommon;
63+
import us.kbase.testutils.RegexMatcher;
6464

6565
public class ServiceTestUtils {
6666

0 commit comments

Comments
 (0)