Skip to content

Commit 5bb2a9a

Browse files
committed
update groupid, update deps, release 1.8.0
1 parent e154ad3 commit 5bb2a9a

File tree

7 files changed

+57
-34
lines changed

7 files changed

+57
-34
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ jobs:
55
publish:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v3
9-
- uses: actions/setup-java@v3
8+
- uses: actions/checkout@v4
9+
- uses: actions/setup-java@v4
1010
with:
1111
java-version: '17'
1212
distribution: 'adopt'

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,42 @@ To add this library to your java project using Maven, add the following dependen
3232

3333
```xml
3434
<dependency>
35-
<groupId>dev.samstevens.totp</groupId>
36-
<artifactId>totp-hangar</artifactId>
37-
<version>1.7.2-SNAPSHOT</version>
35+
<groupId>io.papermc.hangar.totp</groupId>
36+
<artifactId>totp</artifactId>
37+
<version>1.8.0</version>
3838
</dependency>
3939
```
4040

41+
You will also need to add the following repository to your POM:
42+
43+
```xml
44+
<repositories>
45+
<repository>
46+
<id>papermc-repo</id>
47+
<url>https://repo.papermc.io/repository/maven-public/</url>
48+
</repository>
49+
</repositories>
50+
```
51+
4152
#### Gradle
4253

4354
To add the dependency using Gradle, add the following to the build script:
4455

4556
```
4657
dependencies {
47-
compile 'dev.samstevens.totp:totp-hangar:1.7.2-SNAPSHOT'
58+
compile 'io.papermc.hangar.totp:totp:1.8.0'
4859
}
4960
```
5061

62+
You will also need to add the following repository to your build script:
63+
64+
```
65+
repositories {
66+
maven {
67+
url "https://repo.papermc.io/repository/maven-public/"
68+
}
69+
}
70+
```
5171

5272

5373
## Usage

pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
5-
<groupId>dev.samstevens.totp</groupId>
6-
<artifactId>totp-parent-hangar</artifactId>
5+
<groupId>io.papermc.hangar.totp</groupId>
6+
<artifactId>totp-parent</artifactId>
77
<packaging>pom</packaging>
8-
<version>1.7.2-SNAPSHOT</version>
8+
<version>1.8.0</version>
99
<properties>
1010
<!-- compiling -->
1111
<java.version>17</java.version>
@@ -16,10 +16,10 @@
1616
<project.reporting.outputEncoding>${encoding}</project.reporting.outputEncoding>
1717

1818
<!-- plugins -->
19-
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
20-
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
21-
<maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
22-
<jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
19+
<maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
20+
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
21+
<maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
22+
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
2323
</properties>
2424

2525
<name>${project.groupId}:${project.artifactId}</name>

totp-spring-boot-starter/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@
44
<modelVersion>4.0.0</modelVersion>
55

66
<parent>
7-
<groupId>dev.samstevens.totp</groupId>
8-
<artifactId>totp-parent-hangar</artifactId>
9-
<version>1.7.2-SNAPSHOT</version>
7+
<groupId>io.papermc.hangar.totp</groupId>
8+
<artifactId>totp-parent</artifactId>
9+
<version>1.8.0</version>
1010
</parent>
1111

1212
<name>${project.groupId}:${project.artifactId}</name>
13-
<artifactId>totp-spring-boot-starter-hangar</artifactId>
13+
<artifactId>totp-spring-boot-starter</artifactId>
1414

1515
<description>A Spring Boot starter to autoconfigure the Java-TOTP library.</description>
1616

1717
<properties>
18-
<spring.version>3.0.5</spring.version>
18+
<spring.version>3.4.4</spring.version>
1919
</properties>
2020

2121
<dependencies>
2222
<dependency>
2323
<groupId>${project.groupId}</groupId>
24-
<artifactId>totp-hangar</artifactId>
24+
<artifactId>totp</artifactId>
2525
<version>${project.version}</version>
2626
</dependency>
2727
<dependency>

totp/pom.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<modelVersion>4.0.0</modelVersion>
55

66
<parent>
7-
<groupId>dev.samstevens.totp</groupId>
8-
<artifactId>totp-parent-hangar</artifactId>
9-
<version>1.7.2-SNAPSHOT</version>
7+
<groupId>io.papermc.hangar.totp</groupId>
8+
<artifactId>totp-parent</artifactId>
9+
<version>1.8.0</version>
1010
</parent>
1111

12-
<artifactId>totp-hangar</artifactId>
12+
<artifactId>totp</artifactId>
1313
<name>${project.groupId}:${project.artifactId}</name>
1414

1515
<description>A library to help implement time-based one time passwords to enable MFA.</description>
@@ -18,47 +18,47 @@
1818
<dependency>
1919
<groupId>org.junit.jupiter</groupId>
2020
<artifactId>junit-jupiter-api</artifactId>
21-
<version>5.9.2</version>
21+
<version>5.13.0-M2</version>
2222
<scope>test</scope>
2323
</dependency>
2424
<dependency>
2525
<groupId>org.junit.jupiter</groupId>
2626
<artifactId>junit-jupiter-engine</artifactId>
27-
<version>5.9.2</version>
27+
<version>5.13.0-M2</version>
2828
<scope>test</scope>
2929
</dependency>
3030
<dependency>
3131
<groupId>org.junit.jupiter</groupId>
3232
<artifactId>junit-jupiter-params</artifactId>
33-
<version>5.9.2</version>
33+
<version>5.13.0-M2</version>
3434
<scope>test</scope>
3535
</dependency>
3636
<dependency>
3737
<groupId>org.mockito</groupId>
3838
<artifactId>mockito-core</artifactId>
39-
<version>5.2.0</version>
39+
<version>5.16.1</version>
4040
<scope>test</scope>
4141
</dependency>
4242
<dependency>
4343
<groupId>commons-codec</groupId>
4444
<artifactId>commons-codec</artifactId>
45-
<version>1.15</version>
45+
<version>1.18.0</version>
4646
</dependency>
4747
<dependency>
4848
<groupId>commons-net</groupId>
4949
<artifactId>commons-net</artifactId>
50-
<version>3.9.0</version>
50+
<version>3.11.1</version>
5151
<optional>true</optional>
5252
</dependency>
5353
<dependency>
5454
<groupId>com.google.zxing</groupId>
5555
<artifactId>core</artifactId>
56-
<version>3.5.1</version>
56+
<version>3.5.3</version>
5757
</dependency>
5858
<dependency>
5959
<groupId>com.google.zxing</groupId>
6060
<artifactId>javase</artifactId>
61-
<version>3.5.1</version>
61+
<version>3.5.3</version>
6262
</dependency>
6363
</dependencies>
6464
</project>

totp/src/main/java/dev/samstevens/totp/time/NtpTimeProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import org.apache.commons.net.ntp.TimeInfo;
66
import java.net.InetAddress;
77
import java.net.UnknownHostException;
8+
import java.time.Duration;
89

910
public class NtpTimeProvider implements TimeProvider {
1011

@@ -31,7 +32,7 @@ private NtpTimeProvider(String ntpHostname, int timeout, String dependentClass)
3132
checkHasDependency(dependentClass);
3233

3334
client = new NTPUDPClient();
34-
client.setDefaultTimeout(timeout);
35+
client.setDefaultTimeout(Duration.ofMillis(timeout));
3536
ntpHost = InetAddress.getByName(ntpHostname);
3637
}
3738

totp/src/test/java/dev/samstevens/totp/qr/ZxingPngQrGeneratorTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
import com.google.zxing.WriterException;
55
import dev.samstevens.totp.exceptions.QrGenerationException;
66
import org.junit.jupiter.api.Test;
7+
import org.junit.jupiter.api.io.TempDir;
78
import javax.imageio.ImageIO;
89
import java.awt.image.BufferedImage;
910
import java.io.File;
1011
import java.io.IOException;
12+
import java.nio.file.Path;
1113
import static dev.samstevens.totp.IOUtils.*;
1214
import static org.junit.jupiter.api.Assertions.*;
1315
import static org.mockito.ArgumentMatchers.*;
@@ -37,13 +39,13 @@ public void testMimeType() {
3739
}
3840

3941
@Test
40-
public void testImageSize() throws QrGenerationException, IOException {
42+
public void testImageSize(@TempDir Path tempDir) throws QrGenerationException, IOException {
4143
ZxingPngQrGenerator generator = new ZxingPngQrGenerator();
4244
generator.setImageSize(500);
4345
byte[] data = generator.generate(getData());
4446

4547
// Write the data to a temp file and read it into a BufferedImage to get the dimensions
46-
String filename = "/tmp/test_qr.png";
48+
String filename = tempDir.resolve("test_qr.png").toAbsolutePath().toString();
4749
writeFile(data, filename);
4850
File file = new File(filename);
4951
BufferedImage image = ImageIO.read(file);

0 commit comments

Comments
 (0)