reorder members and elements to comply with language recommendations
This commit is contained in:
parent
1195b447a2
commit
d81fc4e5af
114
pom.xml
114
pom.xml
@ -21,16 +21,11 @@
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<argLine></argLine>
|
||||
</properties>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>Stefan Kalscheuer</name>
|
||||
<email>stefan@stklcode.de</email>
|
||||
<timezone>+1</timezone>
|
||||
<timezone>Europe/Berlin</timezone>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
@ -45,6 +40,62 @@
|
||||
<url>https://github.com/stklcode/jvaultconnector/issues</url>
|
||||
</issueManagement>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<argLine></argLine>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.15.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>5.9.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>5.3.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.stefanbirkner</groupId>
|
||||
<artifactId>system-lambda</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.tomakehurst</groupId>
|
||||
<artifactId>wiremock-jre8</artifactId>
|
||||
<version>2.35.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>nl.jqno.equalsverifier</groupId>
|
||||
<artifactId>equalsverifier</artifactId>
|
||||
<version>3.14.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.awaitility</groupId>
|
||||
<artifactId>awaitility</artifactId>
|
||||
<version>4.2.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
@ -136,57 +187,6 @@
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.15.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>5.9.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>5.3.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.stefanbirkner</groupId>
|
||||
<artifactId>system-lambda</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.tomakehurst</groupId>
|
||||
<artifactId>wiremock-jre8</artifactId>
|
||||
<version>2.35.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>nl.jqno.equalsverifier</groupId>
|
||||
<artifactId>equalsverifier</artifactId>
|
||||
<version>3.14.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.awaitility</groupId>
|
||||
<artifactId>awaitility</artifactId>
|
||||
<version>4.2.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>sources</id>
|
||||
|
@ -75,6 +75,24 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
private String token; // Current token.
|
||||
private long tokenTTL = 0; // Expiration time for current token.
|
||||
|
||||
/**
|
||||
* Create connector using a {@link HTTPVaultConnectorBuilder}.
|
||||
*
|
||||
* @param builder The builder.
|
||||
*/
|
||||
HTTPVaultConnector(final HTTPVaultConnectorBuilder builder) {
|
||||
this.request = new RequestHelper(
|
||||
((builder.isWithTLS()) ? "https" : "http") + "://" +
|
||||
builder.getHost() +
|
||||
((builder.getPort() != null) ? ":" + builder.getPort() : "") +
|
||||
builder.getPrefix(),
|
||||
builder.getNumberOfRetries(),
|
||||
builder.getTimeout(),
|
||||
builder.getTlsVersion(),
|
||||
builder.getTrustedCA()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a new builder for a connector.
|
||||
*
|
||||
@ -108,24 +126,6 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
return new HTTPVaultConnectorBuilder().withBaseURL(baseURL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create connector using a {@link HTTPVaultConnectorBuilder}.
|
||||
*
|
||||
* @param builder The builder.
|
||||
*/
|
||||
HTTPVaultConnector(final HTTPVaultConnectorBuilder builder) {
|
||||
this.request = new RequestHelper(
|
||||
((builder.isWithTLS()) ? "https" : "http") + "://" +
|
||||
builder.getHost() +
|
||||
((builder.getPort() != null) ? ":" + builder.getPort() : "") +
|
||||
builder.getPrefix(),
|
||||
builder.getNumberOfRetries(),
|
||||
builder.getTimeout(),
|
||||
builder.getTlsVersion(),
|
||||
builder.getTrustedCA()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void resetAuth() {
|
||||
token = null;
|
||||
|
@ -34,17 +34,6 @@ import java.util.Objects;
|
||||
public final class AppRole implements Serializable {
|
||||
private static final long serialVersionUID = -6248529625864573990L;
|
||||
|
||||
/**
|
||||
* Get {@link Builder} instance.
|
||||
*
|
||||
* @param name Role name.
|
||||
* @return AppRole Builder.
|
||||
* @since 0.8
|
||||
*/
|
||||
public static Builder builder(final String name) {
|
||||
return new Builder(name);
|
||||
}
|
||||
|
||||
@JsonProperty("role_name")
|
||||
private String name;
|
||||
|
||||
@ -134,6 +123,17 @@ public final class AppRole implements Serializable {
|
||||
this.tokenType = builder.tokenType != null ? builder.tokenType.value() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get {@link Builder} instance.
|
||||
*
|
||||
* @param name Role name.
|
||||
* @return AppRole Builder.
|
||||
* @since 0.8
|
||||
*/
|
||||
public static Builder builder(final String name) {
|
||||
return new Builder(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the role name
|
||||
*/
|
||||
|
@ -34,16 +34,6 @@ import java.util.*;
|
||||
public final class Token implements Serializable {
|
||||
private static final long serialVersionUID = 5208508683665365287L;
|
||||
|
||||
/**
|
||||
* Get {@link Builder} instance.
|
||||
*
|
||||
* @return Token Builder.
|
||||
* @since 0.8
|
||||
*/
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
@JsonProperty("id")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private String id;
|
||||
@ -123,6 +113,16 @@ public final class Token implements Serializable {
|
||||
this.entityAlias = builder.entityAlias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get {@link Builder} instance.
|
||||
*
|
||||
* @return Token Builder.
|
||||
* @since 0.8
|
||||
*/
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Token ID
|
||||
*/
|
||||
|
@ -36,15 +36,6 @@ import java.util.Objects;
|
||||
public final class TokenRole implements Serializable {
|
||||
private static final long serialVersionUID = -3505215215838576321L;
|
||||
|
||||
/**
|
||||
* Get {@link Builder} instance.
|
||||
*
|
||||
* @return Token Role Builder.
|
||||
*/
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
@JsonProperty("name")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private String name;
|
||||
@ -129,6 +120,15 @@ public final class TokenRole implements Serializable {
|
||||
this.tokenType = builder.tokenType != null ? builder.tokenType.value() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get {@link Builder} instance.
|
||||
*
|
||||
* @return Token Role Builder.
|
||||
*/
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Token Role name
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user