update versions to 1.4.0, remove AppID examples

Stefan Kalscheuer 2024-12-07 18:10:59 +01:00
parent 4890f4611f
commit 4317dfebc0
Signed by: stefan
GPG Key ID: 3887EC2A53B55430
3 changed files with 36 additions and 47 deletions

@ -1,6 +1,6 @@
# Java Vault Connector
![Logo](https://raw.githubusercontent.com/stklcode/jvaultconnector/master/assets/logo.png)
![Logo](https://raw.githubusercontent.com/stklcode/jvaultconnector/main/assets/logo.png)
Java Vault Connector is a connector library for [Vault](https://www.vaultproject.io) by [Hashicorp](https://www.hashicorp.com) written in Java. The connector allows simple usage of Vault's secret store in own applications.
@ -13,7 +13,6 @@ Java Vault Connector is a connector library for [Vault](https://www.vaultproject
* Token
* Username/Password
* AppRole (register and authenticate)
* AppID (register and authenticate) [_deprecated_]
* Tokens
* Creation and lookup of tokens and token roles
* TokenBuilder for speaking creation of complex configurations
@ -27,4 +26,4 @@ Java Vault Connector is a connector library for [Vault](https://www.vaultproject
* SQL secret handling
* KV v1 and v2 support
* Connector Factory with builder pattern
* Tested against Vault 1.11.2
* Tested against Vault 1.2 to 1.18

@ -2,7 +2,7 @@
## Installation
[![Maven Central](https://img.shields.io/maven-central/v/de.stklcode.jvault/jvault-connector.svg)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22de.stklcode.jvault%22%20AND%20a%3A%22jvault-connector%22)
[![Maven Central Version](https://img.shields.io/maven-central/v/de.stklcode.jvault/jvault-connector)](https://central.sonatype.com/artifact/de.stklcode.jvault/jvault-connector)
The connector is published at Maven Central and may be included into your project easily.
@ -12,16 +12,16 @@ The connector is published at Maven Central and may be included into your projec
<dependency>
<groupId>de.stklcode.jvault</groupId>
<artifactId>jvault-connector</artifactId>
<version>1.1.1</version>
<version>1.4.0</version>
</dependency>
```
### Gradle Dependency
```groovy
compile group: 'de.stklcode.jvault', name: 'jvault-connector', version: '1.1.1'
compile group: 'de.stklcode.jvault', name: 'jvault-connector', version: '1.4.0'
```
### SBT Dependency
```
libraryDependencies += "de.stklcode.jvault" % "jvault-connector" % "1.1.1"
libraryDependencies += "de.stklcode.jvault" % "jvault-connector" % "1.4.0"
```

@ -8,15 +8,14 @@ The connector currently supports four authorization methods.
* Token
* Username & Password
* AppRole
* AppID [_deprecated_]
#### Token
##### Authenticate
#### Token
##### Authenticate
```java
VaultConnector connector = ...;
connector.authToken("01234567-89ab-cdef-0123-456789abcdef");
```java
VaultConnector connector = ...;
connector.authToken("01234567-89ab-cdef-0123-456789abcdef");
```
##### Create new Token
@ -30,48 +29,39 @@ The connector currently supports four authorization methods.
AuthResponse createResponse = connector.createToken(token);
```
#### Username & Password
##### Authenticate
```java
VaultConnector connector = ...;
connector.authUserPass("username", "p4ssw0rd");
```java
VaultConnector connector = ...;
connector.authUserPass("username", "p4ssw0rd");
```
#### AppRole
#### AppRole
##### Authenticate
```java
VaultConnector connector = ...;
// connector.authAppId("role-id", "secret-id");
connector.authAppRole("01234567-89ab-cdef-0123-456789abcdef", "fedcba98-7654-3210-fedc-ba9876543210");
##### Authenticate
```java
VaultConnector connector = ...;
// connector.authAppId("role-id", "secret-id");
connector.authAppRole("01234567-89ab-cdef-0123-456789abcdef", "fedcba98-7654-3210-fedc-ba9876543210");
```
##### Manage roles and secrets
```java
// Create new role using the builder. Supports all current role parameters.
AppRole role = AppRole.builder("role-name").build();
// Write the new role to Vault.
boolean created = connector.createAppRole(role);
// Lookup the role by name.
AppRoleResponse res = connector.lookupAppRole("role-name");
// Create a new secret with random ID.
AppRoleSecretResponse secret = connector.createAppRoleSecret("role-name");
// Destroy the secret.
boolean destroyed = connector.destroyAppRoleSecret("role-name", secret.getSecret().getId());
```
```java
// Create new role using the builder. Supports all current role parameters.
AppRole role = AppRole.builder("role-name").build();
#### AppID
```java
VaultConnector connector = ...;
// connector.authAppId("app-id", "user-id");
connector.authAppId("01234567-89ab-cdef-0123-456789abcdef", "fedcba98-7654-3210-fedc-ba9876543210");
// Write the new role to Vault.
boolean created = connector.createAppRole(role);
// Lookup the role by name.
AppRoleResponse res = connector.lookupAppRole("role-name");
// Create a new secret with random ID.
AppRoleSecretResponse secret = connector.createAppRoleSecret("role-name");
// Destroy the secret.
boolean destroyed = connector.destroyAppRoleSecret("role-name", secret.getSecret().getId());
```