-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: impl vault sync connector, define common abstractions.
- Loading branch information
Showing
41 changed files
with
1,282 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...anager/connector/auth/K8sTokenReader.java → ...retsmanager/connector/K8sTokenReader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
...main/java/co/com/bancolombia/secretsmanager/connector/VaultSecretManagerConfigurator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...er/connector/auth/K8sTokenReaderTest.java → ...manager/connector/K8sTokenReaderTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...sync/src/test/java/co/com/bancolombia/secretsmanager/connector/VaulAuthenticatorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
.../java/co/com/bancolombia/secretsmanager/connector/VaultSecretManagerConfiguratorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...va/co/com/bancolombia/secretsmanager/connector/VaultSecretsManagerConnectorAsyncTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
dependencies { | ||
api project(":secrets-manager-api") | ||
api project(":vault-commons") | ||
implementation "io.projectreactor.addons:reactor-extra:${reactorExtraVersion}" | ||
implementation "io.projectreactor:reactor-core:${reactorCoreVersion}" | ||
implementation "com.google.code.gson:gson:${gsonVersion}" | ||
implementation "com.github.ben-manes.caffeine:caffeine:${cafeineVersion}" | ||
testImplementation "io.projectreactor:reactor-test:${reactorCoreVersion}" | ||
testImplementation("com.squareup.okhttp3:mockwebserver:4.9.3") | ||
|
||
} | ||
|
||
ext { | ||
artifactId = 'vault-async' | ||
artifactDescription = 'Secrets Manager' | ||
artifactDescription = 'Secrets Manager async connector for Vault' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version=4.3.1 | ||
version=4.4.0 | ||
springBootVersion=3.2.1 | ||
reactorCoreVersion=3.6.1 | ||
reactorExtraVersion=3.5.1 | ||
|
2 changes: 1 addition & 1 deletion
2
...smanager/connector/auth/AuthResponse.java → ...cretsmanager/vault/auth/AuthResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ecretsmanager/connector/auth/K8sAuth.java → ...ia/secretsmanager/vault/auth/K8sAuth.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...cretsmanager/connector/auth/RoleAuth.java → ...a/secretsmanager/vault/auth/RoleAuth.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ecretsmanager/config/CacheProperties.java → ...manager/vault/config/CacheProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...secretsmanager/config/HttpProperties.java → ...smanager/vault/config/HttpProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nager/config/VaultKeyStoreProperties.java → ...vault/config/VaultKeyStoreProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...config/VaultSecretsManagerProperties.java → ...config/VaultSecretsManagerProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ger/config/VaultTrustStoreProperties.java → ...ult/config/VaultTrustStoreProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nager/connector/secret/SecretPayload.java → ...tsmanager/vault/secret/SecretPayload.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ager/connector/secret/SecretResponse.java → ...smanager/vault/secret/SecretResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...cretsmanager/connector/ssl/SslConfig.java → ...a/secretsmanager/vault/ssl/SslConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...bia/secretsmanager/ssl/SslConfigTest.java → ...cretsmanager/vault/ssl/SslConfigTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIDSDCCAjACAQEwDQYJKoZIhvcNAQELBQAwajELMAkGA1UEBhMCQ08xDDAKBgNV | ||
BAgMA0FOVDERMA8GA1UEBwwITUVERUxMSU4xEjAQBgNVBAoMCWxvY2FsaG9zdDES | ||
MBAGA1UECwwJbG9jYWxob3N0MRIwEAYDVQQDDAlsb2NhbGhvc3QwHhcNMjMxMjIy | ||
MDI1NzUxWhcNMjQwMzIxMDI1NzUxWjBqMQswCQYDVQQGEwJDTzEMMAoGA1UECAwD | ||
QU5UMREwDwYDVQQHDAhNRURFTExJTjESMBAGA1UECgwJbG9jYWxob3N0MRIwEAYD | ||
VQQLDAlsb2NhbGhvc3QxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcN | ||
AQEBBQADggEPADCCAQoCggEBALlAo5u+D/fD+v5A4oXcF/14m15mYX+cx0svOKBD | ||
dNigECPu4UghvmCia3pGFyRP72P1Cx3jye6ImLRCNL7JJFV7BuOiMk1OP+BkqAG0 | ||
RNNt2okMsngkmHTyIHcBdu7QtNWewaZN7WRLa0cOgYMeKc1orftBNNfe7LpLtjuy | ||
wqzrqi3qI2Y2xXdjTWUVySXzDfVSCnLS+mYNHF5XEkqZXwA4j+rJN9ipeWXxm78G | ||
sft603a+u+f7PwvPHzMltHI7OxuaJpPC9KzUzgeJ9vzCMz/9Klmp/VrDjigqYMnW | ||
j3EB5eh7iXamJslexDotHZ2q6pQOq2OAPOVwsExPWc/ILkMCAwEAATANBgkqhkiG | ||
9w0BAQsFAAOCAQEAplB1L6fxpoQN0ynZdfRaXblvwLjzjVZe0j+p120JIGp8nsDK | ||
CwZvlu501j2y+yEZ4mUkNkbwe1U7bYd/KTexbsgrpzxfcqsPNGrs3te2k6m2Bkp1 | ||
KS43rUKx9VvjIaYstx9akuCZmirTLWimCUOGTlsnqGLf5y806F+ifyHrBLkWa6ly | ||
cZGnGitFS/PzCR3gjoO1CNIDFU5bLhAMGFdC6lr7aHLVctTI2Q9O42PVCBf169nP | ||
10poZACmxQkuDvKVDRA6foNibTWbwHq2Ng//TORMdCts3BUf+cpXBX+zXj3qV3Nc | ||
CPgnQwLaeotV1iBhzrt/TtWmZI2eGGNB8oL2qA== | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIDTjCCAjagAwIBAgIEZYwSAzANBgkqhkiG9w0BAQsFADBpMQswCQYDVQQGEwJD | ||
TzELMAkGA1UECAwCQU4xETAPBgNVBAcMCE1FREVMTElOMRIwEAYDVQQKDAlsb2Nh | ||
bGhvc3QxEjAQBgNVBAsMCWxvY2FsaG9zdDESMBAGA1UEAwwJbG9jYWxob3N0MB4X | ||
DTIzMTIyNzEyMDEwN1oXDTI0MTIyNjEyMDEwN1owaTELMAkGA1UEBhMCQ08xCzAJ | ||
BgNVBAgMAkFOMREwDwYDVQQHDAhNRURFTExJTjESMBAGA1UECgwJbG9jYWxob3N0 | ||
MRIwEAYDVQQLDAlsb2NhbGhvc3QxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJ | ||
KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMkh7JoVfFX20p0pqtRS8rRUl+70mpeu | ||
32fGoN5pA1AdqTRZfOoGKoHnVhAG6C/5UoD5GOStKLVdsXVEtaWkBnyVAD3Imdj7 | ||
450dU9+LATgSQYJbTL11OcZBizeiu6DfZmBtYWvmpPDIAPsZr6R+kcUIrzH3ZQjU | ||
/BAfwCEmdQYwW7gWL456mTvefnMXcraoS4sOlBrH5FGXkb0ESIHuXMUsOrvg3cgN | ||
8S9R7huZQTDCio605KZW3hjfngBSAFTKbxxNI8nt05i5Gd+PMjpTndBUT4xYPp8Y | ||
igjL5IE0j9xY6IfvHqn/GD5GzYYIjjer2eCGmXfHDNtHAnA/wgdArEsCAwEAATAN | ||
BgkqhkiG9w0BAQsFAAOCAQEAKUcvHUTOL+rNr4DvdS3N3PSvVsnldgcYoBGZH0nf | ||
QtSWdbtLXfnhzgQPP+ndvL8ZWrYyZAv6+/fV7eQ569436nu+ebPz43JYiUsPReSg | ||
qzcJn95JYJn1nW6CKBhkkFGmcDMidm6u0eSNKZdKc+vPdlQFcmqEXjEv7gMHmPrE | ||
rCwXKvxQZ1DEFett56DFqJvnOTD0lBAGl6pyROqsF5JjJVUXgGcHGbXll3/CzgvK | ||
803fOq4kgu/BNPxy/KyC6Ztz5Qgr+7/zFC52nyRJilWPOJwU64fHu+yHaR9sI6bn | ||
NE3wY5gnwzKHWL2jotlFfSuoXNpBW11JSdzfDDH5GWhMDQ== | ||
-----END CERTIFICATE----- |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
dependencies { | ||
api project(":secrets-manager-api") | ||
implementation "com.google.code.gson:gson:${gsonVersion}" | ||
} | ||
|
||
ext { | ||
artifactId = 'vault-commons' | ||
artifactDescription = 'Vault Secrets Manager base abstractions' | ||
} |
33 changes: 33 additions & 0 deletions
33
...c/src/main/java/co/com/bancolombia/secretsmanager/vaultsync/connector/K8sTokenReader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package co.com.bancolombia.secretsmanager.vaultsync.connector; | ||
|
||
import co.com.bancolombia.secretsmanager.api.exceptions.SecretException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
|
||
public class K8sTokenReader { | ||
|
||
private final String tokenFile; | ||
|
||
public K8sTokenReader() { | ||
this.tokenFile = "/var/run/secrets/kubernetes.io/serviceaccount/token"; | ||
} | ||
|
||
public K8sTokenReader(String tokenFile) { | ||
this.tokenFile = tokenFile; | ||
} | ||
|
||
/** | ||
* Reads the kubernetes service account token from the file system | ||
* @return the kubernetes service account token | ||
*/ | ||
public String getKubernetesServiceAccountToken() throws SecretException { | ||
try { | ||
Path path = Paths.get(this.tokenFile); | ||
return Files.readAllLines(path).get(0); | ||
} catch (Exception e) { | ||
throw new SecretException("Error reading kubernetes service account token: " + e.getMessage()); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.