typo fixes
This commit is contained in:
parent
46461f482a
commit
9f80a7dada
@ -20,8 +20,8 @@ Java Vault Connector is a connector library for [Vault](https://www.vaultproject
|
||||
* AppRole (register and authenticate)
|
||||
* AppID (register and authenticate) [_deprecated_]
|
||||
* Tokens
|
||||
* Creation and lookup of tokens
|
||||
* TokenBuilder for speaking creation of complex configuraitons
|
||||
* Creation and lookup of tokens and token roles
|
||||
* TokenBuilder for speaking creation of complex configurations
|
||||
* Secrets
|
||||
* Read secrets
|
||||
* Write secrets
|
||||
|
@ -31,7 +31,7 @@ import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Vault Connector implementatin using Vault's HTTP API.
|
||||
* Vault Connector implementation using Vault's HTTP API.
|
||||
*
|
||||
* @author Stefan Kalscheuer
|
||||
* @since 0.1
|
||||
|
@ -91,7 +91,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
|
||||
HealthResponse getHealth() throws VaultConnectorException;
|
||||
|
||||
/**
|
||||
* Get all availale authentication backends.
|
||||
* Get all available authentication backends.
|
||||
*
|
||||
* @return List of backends
|
||||
* @throws VaultConnectorException on error
|
||||
@ -232,7 +232,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
|
||||
/**
|
||||
* Delete AppRole role from Vault.
|
||||
*
|
||||
* @param roleName The role anme
|
||||
* @param roleName The role name
|
||||
* @return {@code true} on success
|
||||
* @throws VaultConnectorException on error
|
||||
*/
|
||||
@ -514,7 +514,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
|
||||
* @param mount Secret store mount point (without leading or trailing slash).
|
||||
* @param key Secret identifier
|
||||
* @param version Version to read. If {@code null} or zero, the latest version will be returned.
|
||||
* @return Secret responsef
|
||||
* @return Secret response.
|
||||
* @throws VaultConnectorException on error
|
||||
* @since 0.8
|
||||
*/
|
||||
|
@ -33,7 +33,7 @@ import java.security.cert.CertificateFactory;
|
||||
import java.security.cert.X509Certificate;
|
||||
|
||||
/**
|
||||
* Vault Connector Factory implementation for HTTP Vault connectors.
|
||||
* Vault Connector Builder implementation for HTTP Vault connectors.
|
||||
*
|
||||
* @author Stefan Kalscheuer
|
||||
* @since 0.8.0
|
||||
@ -162,7 +162,7 @@ public final class HTTPVaultConnectorBuilder implements VaultConnectorBuilder {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a trusted CA certifiate for HTTPS connections.
|
||||
* Add a trusted CA certificate for HTTPS connections.
|
||||
*
|
||||
* @param cert path to certificate file
|
||||
* @return self
|
||||
@ -179,7 +179,7 @@ public final class HTTPVaultConnectorBuilder implements VaultConnectorBuilder {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a trusted CA certifiate for HTTPS connections.
|
||||
* Add a trusted CA certificate for HTTPS connections.
|
||||
*
|
||||
* @param cert path to certificate file
|
||||
* @return self
|
||||
|
@ -107,7 +107,7 @@ public final class HTTPVaultConnectorFactory extends VaultConnectorFactory {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a trusted CA certifiate for HTTPS connections.
|
||||
* Add a trusted CA certificate for HTTPS connections.
|
||||
*
|
||||
* @param cert path to certificate file
|
||||
* @return self
|
||||
@ -120,7 +120,7 @@ public final class HTTPVaultConnectorFactory extends VaultConnectorFactory {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a trusted CA certifiate for HTTPS connections.
|
||||
* Add a trusted CA certificate for HTTPS connections.
|
||||
*
|
||||
* @param cert path to certificate file
|
||||
* @return self
|
||||
|
@ -28,7 +28,7 @@ final class Error {
|
||||
static final String UNEXPECTED_RESPONSE = "Received response where none was expected";
|
||||
static final String URI_FORMAT = "Invalid URI format";
|
||||
static final String RESPONSE_CODE = "Invalid response code";
|
||||
static final String INIT_SSL_CONTEXT = "Unable to intialize SSLContext";
|
||||
static final String INIT_SSL_CONTEXT = "Unable to initialize SSLContext";
|
||||
|
||||
/**
|
||||
* Constructor hidden, this class should not be instantiated.
|
||||
|
@ -340,7 +340,7 @@ public final class RequestHelper implements Serializable {
|
||||
/* Fail on different error code and/or no retries left */
|
||||
handleError(response);
|
||||
|
||||
/* Throw exception withoud details, if response entity is empty. */
|
||||
/* Throw exception without details, if response entity is empty. */
|
||||
throw new InvalidResponseException(Error.RESPONSE_CODE,
|
||||
response.getStatusLine().getStatusCode());
|
||||
}
|
||||
@ -362,7 +362,7 @@ public final class RequestHelper implements Serializable {
|
||||
* Create a custom socket factory from trusted CA certificate.
|
||||
*
|
||||
* @return The factory.
|
||||
* @throws TlsException An error occured during initialization of the SSL context.
|
||||
* @throws TlsException An error occurred during initialization of the SSL context.
|
||||
* @since 0.8.0
|
||||
*/
|
||||
private SSLConnectionSocketFactory createSSLSocketFactory() throws TlsException {
|
||||
@ -376,7 +376,7 @@ public final class RequestHelper implements Serializable {
|
||||
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
||||
tmf.init(keyStore);
|
||||
|
||||
// Create context usint this TrustManager.
|
||||
// Create context using this TrustManager.
|
||||
SSLContext context = SSLContext.getInstance(tlsVersion);
|
||||
context.init(null, tmf.getTrustManagers(), new SecureRandom());
|
||||
|
||||
|
@ -198,7 +198,7 @@ public final class AppRole {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list of bound CIDR subnets of assiciated tokens
|
||||
* @return list of bound CIDR subnets of associated tokens
|
||||
* @since 0.9
|
||||
*/
|
||||
public List<String> getTokenBoundCidrs() {
|
||||
@ -578,22 +578,22 @@ public final class AppRole {
|
||||
/**
|
||||
* Set number of uses for sectet IDs.
|
||||
*
|
||||
* @param secredIdNumUses the number of uses
|
||||
* @param secretIdNumUses the number of uses
|
||||
* @return self
|
||||
*/
|
||||
public Builder withSecretIdNumUses(final Integer secredIdNumUses) {
|
||||
this.secretIdNumUses = secredIdNumUses;
|
||||
public Builder withSecretIdNumUses(final Integer secretIdNumUses) {
|
||||
this.secretIdNumUses = secretIdNumUses;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set default sectet ID TTL in seconds.
|
||||
*
|
||||
* @param secredIdTtl the TTL
|
||||
* @param secretIdTtl the TTL
|
||||
* @return self
|
||||
*/
|
||||
public Builder withSecretIdTtl(final Integer secredIdTtl) {
|
||||
this.secretIdTtl = secredIdTtl;
|
||||
public Builder withSecretIdTtl(final Integer secretIdTtl) {
|
||||
this.secretIdTtl = secretIdTtl;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -181,24 +181,24 @@ public final class AppRoleBuilder {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set number of uses for sectet IDs.
|
||||
* Set number of uses for secret IDs.
|
||||
*
|
||||
* @param secredIdNumUses the number of uses
|
||||
* @param secretIdNumUses the number of uses
|
||||
* @return self
|
||||
*/
|
||||
public AppRoleBuilder withSecretIdNumUses(final Integer secredIdNumUses) {
|
||||
this.secretIdNumUses = secredIdNumUses;
|
||||
public AppRoleBuilder withSecretIdNumUses(final Integer secretIdNumUses) {
|
||||
this.secretIdNumUses = secretIdNumUses;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set default sectet ID TTL in seconds.
|
||||
* Set default secret ID TTL in seconds.
|
||||
*
|
||||
* @param secredIdTtl the TTL
|
||||
* @param secretIdTtl the TTL
|
||||
* @return self
|
||||
*/
|
||||
public AppRoleBuilder withSecretIdTtl(final Integer secredIdTtl) {
|
||||
this.secretIdTtl = secredIdTtl;
|
||||
public AppRoleBuilder withSecretIdTtl(final Integer secretIdTtl) {
|
||||
this.secretIdTtl = secretIdTtl;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -136,14 +136,14 @@ public final class TokenRole {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Is Roken Role orphan?
|
||||
* @return Is Token Role orphan?
|
||||
*/
|
||||
public Boolean getOrphan() {
|
||||
return orphan;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Is Roken Role renewable?
|
||||
* @return Is Token Role renewable?
|
||||
*/
|
||||
public Boolean getRenewable() {
|
||||
return renewable;
|
||||
|
@ -25,7 +25,7 @@ import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Vault response for a single secret version metatada, i.e. after update (KV v2).
|
||||
* Vault response for a single secret version metadata, i.e. after update (KV v2).
|
||||
*
|
||||
* @author Stefan Kalscheuer
|
||||
* @since 0.8
|
||||
|
@ -83,7 +83,7 @@ public final class AuthData {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return List of policies associated with the ooken
|
||||
* @return List of policies associated with the token
|
||||
* @since 0.9
|
||||
*/
|
||||
public List<String> getTokenPolicies() {
|
||||
|
@ -151,7 +151,7 @@ public class HTTPVaultConnectorOfflineTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* Test constductors of the {@link HTTPVaultConnector} class.
|
||||
* Test constructors of the {@link HTTPVaultConnector} class.
|
||||
*/
|
||||
@Test
|
||||
public void constructorTest() throws IOException, CertificateException {
|
||||
|
@ -948,8 +948,8 @@ public class HTTPVaultConnectorTest {
|
||||
try {
|
||||
AppRoleResponse res = connector.lookupAppRole(roleName);
|
||||
// Note: As of Vault 0.8.3 default policy is not added automatically, so this test should return 1, not 2.
|
||||
assertThat("Role lookuo returned wrong policy count (before Vault 0.8.3 is should be 2)", res.getRole().getPolicies(), hasSize(1));
|
||||
assertThat("Role lookuo returned wrong policies", res.getRole().getPolicies(), hasItem("testpolicy"));
|
||||
assertThat("Role lookup returned wrong policy count (before Vault 0.8.3 is should be 2)", res.getRole().getPolicies(), hasSize(1));
|
||||
assertThat("Role lookup returned wrong policies", res.getRole().getPolicies(), hasItem("testpolicy"));
|
||||
} catch (VaultConnectorException e) {
|
||||
fail("Creation of role by name failed.");
|
||||
}
|
||||
@ -1079,7 +1079,7 @@ public class HTTPVaultConnectorTest {
|
||||
assertThat("Root token should not be renewable", res.getAuth().isRenewable(), is(false));
|
||||
assertThat("Root token should not be orphan", res.getAuth().isOrphan(), is(false));
|
||||
|
||||
// Starting with Vault 1.0 a warning "cusotm ID uses weaker SHA1..." is given.
|
||||
// Starting with Vault 1.0 a warning "custom ID uses weaker SHA1..." is given.
|
||||
if (VAULT_VERSION.startsWith("1.")) {
|
||||
assertThat("Token creation did not return expected warning.", res.getWarnings(), hasSize(1));
|
||||
} else {
|
||||
@ -1106,7 +1106,7 @@ public class HTTPVaultConnectorTest {
|
||||
assertThat("Metadata not correct.", res.getAuth().getMetadata().get("foo"), is("bar"));
|
||||
assertThat("Token should be renewable", res.getAuth().isRenewable(), is(true));
|
||||
} catch (VaultConnectorException e) {
|
||||
fail("Token createion failed: " + e.getMessage());
|
||||
fail("Token creation failed: " + e.getMessage());
|
||||
}
|
||||
|
||||
/* Overwrite token should fail as of Vault 0.8.0 */
|
||||
@ -1146,12 +1146,12 @@ public class HTTPVaultConnectorTest {
|
||||
assertThat("Specified token Type not set", res.getAuth().getTokenType(), is(Token.Type.BATCH.value()));
|
||||
|
||||
} catch (VaultConnectorException e) {
|
||||
fail("Token createion failed: " + e.getMessage());
|
||||
fail("Token creation failed: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test token lookuo.
|
||||
* Test token lookup.
|
||||
*/
|
||||
@Test
|
||||
@Order(30)
|
||||
@ -1268,8 +1268,8 @@ public class HTTPVaultConnectorTest {
|
||||
fail("Token role deletion failed.");
|
||||
}
|
||||
|
||||
assertThrows(InvalidResponseException.class, () -> connector.readTokenRole(roleName), "Reading inexistent token role should fail");
|
||||
assertThrows(InvalidResponseException.class, () -> connector.listTokenRoles(), "Listing inexistent token roles should fail");
|
||||
assertThrows(InvalidResponseException.class, () -> connector.readTokenRole(roleName), "Reading nonexistent token role should fail");
|
||||
assertThrows(InvalidResponseException.class, () -> connector.listTokenRoles(), "Listing nonexistent token roles should fail");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1405,7 +1405,7 @@ public class HTTPVaultConnectorTest {
|
||||
try {
|
||||
connector.seal();
|
||||
assumeTrue(connector.sealStatus().isSealed());
|
||||
connector.resetAuth(); // SHould work unauthenticated
|
||||
connector.resetAuth(); // Should work unauthenticated
|
||||
} catch (VaultConnectorException e) {
|
||||
fail("Unexpected exception on sealing: " + e.getMessage());
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public class TokenBuilderTest {
|
||||
* Build token without any parameters.
|
||||
*/
|
||||
@Test
|
||||
public void legadcyBuildDefaultTest() throws JsonProcessingException {
|
||||
public void legacyBuildDefaultTest() throws JsonProcessingException {
|
||||
Token token = new TokenBuilder().build();
|
||||
assertThat(token.getId(), is(nullValue()));
|
||||
assertThat(token.getType(), is(nullValue()));
|
||||
|
@ -77,7 +77,7 @@ public class MetadataResponseTest {
|
||||
try {
|
||||
MetadataResponse res = new ObjectMapper().readValue(META_JSON, MetadataResponse.class);
|
||||
assertThat("Parsed response is NULL", res, is(notNullValue()));
|
||||
assertThat("Parsed metadatra is NULL", res.getMetadata(), is(notNullValue()));
|
||||
assertThat("Parsed metadata is NULL", res.getMetadata(), is(notNullValue()));
|
||||
assertThat("Incorrect created time", res.getMetadata().getCreatedTimeString(), is(V1_TIME));
|
||||
assertThat("Parting created time failed", res.getMetadata().getCreatedTime(), is(notNullValue()));
|
||||
assertThat("Incorrect current version", res.getMetadata().getCurrentVersion(), is(CURRENT_VERSION));
|
||||
@ -87,14 +87,14 @@ public class MetadataResponseTest {
|
||||
assertThat("Parting updated time failed", res.getMetadata().getUpdatedTime(), is(notNullValue()));
|
||||
assertThat("Incorrect number of versions", res.getMetadata().getVersions().size(), is(3));
|
||||
assertThat("Incorrect version 1 delete time", res.getMetadata().getVersions().get(1).getDeletionTimeString(), is(V2_TIME));
|
||||
assertThat("Parsion version delete time failed", res.getMetadata().getVersions().get(1).getDeletionTime(), is(notNullValue()));
|
||||
assertThat("Parsing version delete time failed", res.getMetadata().getVersions().get(1).getDeletionTime(), is(notNullValue()));
|
||||
assertThat("Incorrect version 1 destroyed state", res.getMetadata().getVersions().get(1).isDestroyed(), is(true));
|
||||
assertThat("Incorrect version 2 created time", res.getMetadata().getVersions().get(2).getCreatedTimeString(), is(V2_TIME));
|
||||
assertThat("Parsion version created failed", res.getMetadata().getVersions().get(2).getCreatedTime(), is(notNullValue()));
|
||||
assertThat("Parsing version created failed", res.getMetadata().getVersions().get(2).getCreatedTime(), is(notNullValue()));
|
||||
assertThat("Incorrect version 3 destroyed state", res.getMetadata().getVersions().get(3).isDestroyed(), is(false));
|
||||
|
||||
} catch (IOException e) {
|
||||
fail("MetadataResoponse deserialization failed: " + e.getMessage());
|
||||
fail("MetadataResponse deserialization failed: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class SecretVersionResponseTest {
|
||||
try {
|
||||
SecretVersionResponse res = new ObjectMapper().readValue(META_JSON, SecretVersionResponse.class);
|
||||
assertThat("Parsed response is NULL", res, is(notNullValue()));
|
||||
assertThat("Parsed metadatra is NULL", res.getMetadata(), is(notNullValue()));
|
||||
assertThat("Parsed metadata is NULL", res.getMetadata(), is(notNullValue()));
|
||||
assertThat("Incorrect created time", res.getMetadata().getCreatedTimeString(), is(CREATION_TIME));
|
||||
assertThat("Incorrect deletion time", res.getMetadata().getDeletionTimeString(), is(DELETION_TIME));
|
||||
assertThat("Incorrect destroyed state", res.getMetadata().isDestroyed(), is(false));
|
||||
|
Loading…
x
Reference in New Issue
Block a user