Skip to content

Commit 992377d

Browse files
Merge pull request #57 from BastiaanJansen/dev
Dependency upgrade and fixed code style issues.
2 parents 71e5d2f + f1fb01f commit 992377d

File tree

7 files changed

+18
-13
lines changed

7 files changed

+18
-13
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@ The following features are supported:
3030
<dependency>
3131
<groupId>com.github.bastiaanjansen</groupId>
3232
<artifactId>otp-java</artifactId>
33-
<version>1.3.0</version>
33+
<version>1.3.1</version>
3434
</dependency>
3535
```
3636

3737
### Gradle
3838
```gradle
39-
implementation 'com.github.bastiaanjansen:otp-java:1.3.0'
39+
implementation 'com.github.bastiaanjansen:otp-java:1.3.1'
4040
```
4141

4242
### Scala SBT
4343
```scala
44-
libraryDependencies += "com.github.bastiaanjansen" % "otp-java" % "1.3.0"
44+
libraryDependencies += "com.github.bastiaanjansen" % "otp-java" % "1.3.1"
4545
```
4646

4747
### Apache Ivy
4848
```xml
49-
<dependency org="com.github.bastiaanjansen" name="otp-java" rev="1.3.0" />
49+
<dependency org="com.github.bastiaanjansen" name="otp-java" rev="1.3.1" />
5050
```
5151

5252
Or you can download the source from the [GitHub releases page](https://github.com/BastiaanJansen/OTP-Java/releases).

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<groupId>com.github.bastiaanjansen</groupId>
1212
<artifactId>otp-java</artifactId>
13-
<version>1.3.0</version>
13+
<version>1.3.1</version>
1414

1515
<name>OTP-Java</name>
1616
<description>A small and easy-to-use one-time password generator for Java according to RFC 4226 (HOTP) and RFC 6238 (TOTP).</description>
@@ -49,19 +49,19 @@
4949
<dependency>
5050
<groupId>org.apache.maven.plugins</groupId>
5151
<artifactId>maven-compiler-plugin</artifactId>
52-
<version>3.8.1</version>
52+
<version>3.10.0</version>
5353
<scope>test</scope>
5454
</dependency>
5555
<dependency>
5656
<groupId>org.junit.jupiter</groupId>
5757
<artifactId>junit-jupiter</artifactId>
58-
<version>5.7.0</version>
58+
<version>5.8.2</version>
5959
<scope>test</scope>
6060
</dependency>
6161
<dependency>
6262
<groupId>commons-codec</groupId>
6363
<artifactId>commons-codec</artifactId>
64-
<version>1.11</version>
64+
<version>1.15</version>
6565
</dependency>
6666
<dependency>
6767
<groupId>org.hamcrest</groupId>

src/main/java/com/bastiaanjansen/otp/HOTP.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @see OTP
1616
*/
1717
public final class HOTP extends OTP implements HOTPGenerator, HOTPVerifier {
18-
private final static String OTP_TYPE = "hotp";
18+
private static final String OTP_TYPE = "hotp";
1919

2020
private HOTP(final Builder builder) {
2121
super(builder);
@@ -68,6 +68,7 @@ public static HOTP withDefaultValues(final byte[] secret) {
6868
* @return generated HOTP code
6969
* @throws IllegalArgumentException when code could not be generated
7070
*/
71+
@Override
7172
public String generate(long counter) throws IllegalArgumentException {
7273
return super.generate(counter);
7374
}

src/main/java/com/bastiaanjansen/otp/OTP.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* @author Bastiaan Jansen
2121
*/
2222
class OTP {
23-
private final static String URL_SCHEME = "otpauth";
23+
private static final String URL_SCHEME = "otpauth";
2424

2525
/**
2626
* Default value for password length
@@ -262,7 +262,7 @@ protected abstract static class Builder<T extends OTP, B extends Builder<T, B>>
262262
*/
263263
private final byte[] secret;
264264

265-
public Builder(final byte[] secret) {
265+
protected Builder(final byte[] secret) {
266266
this.secret = secret;
267267
this.passwordLength = DEFAULT_PASSWORD_LENGTH;
268268
this.algorithm = DEFAULT_HMAC_ALGORITHM;

src/main/java/com/bastiaanjansen/otp/SecretGenerator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
*/
1212
public class SecretGenerator {
1313

14+
private SecretGenerator() {}
15+
1416
/**
1517
* Default amount of bits for secret generation
1618
*/
17-
public final static int DEFAULT_BITS = 160;
19+
public static final int DEFAULT_BITS = 160;
1820

1921
/**
2022
* Generate an OTP base32 secret with default amount of bits

src/main/java/com/bastiaanjansen/otp/TOTP.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* @see OTP
2020
*/
2121
public final class TOTP extends OTP implements TOTPGenerator, TOTPVerifier {
22-
private final static String OTP_TYPE = "totp";
22+
private static final String OTP_TYPE = "totp";
2323

2424
/**
2525
* Default time interval for a time-based one-time password

src/main/java/com/bastiaanjansen/otp/helpers/URIHelper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
*/
1515
public class URIHelper {
1616

17+
private URIHelper() {}
18+
1719
public static final String DIGITS = "digits";
1820
public static final String SECRET = "secret";
1921
public static final String ALGORITHM = "algorithm";

0 commit comments

Comments
 (0)