Testcontainers and importing a json file containing vault/secrets #1616
Replies: 1 comment 1 reply
|
Sorry format is messes up!! @Container
static final GenericContainer<?> lowkeyVaultContainer = new GenericContainer<>(
DockerImageName.parse("nagyesta/lowkey-vault:4.0.0"))
.withCopyFileToContainer(
MountableFile.forClasspathResource("test-data/import.json", 0444),
"/vault/config/import.json")
.withEnv("LOWKEY_VAULT_IMPORT_PATH", "/vault/config/import.json")
.withEnv("LOWKEY_STRICT_URIS", "false")
.withEnv("LOWKEY_VAULT_RELAXED_PORTS", "true")
.withExposedPorts(8443)
.withEnv("LOWKEY_VAULT_NAMES", "local"); |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello.
I am using test containers to instantiate nagyesta/lowkey-vault:4.0.0, I am trying to import a json file containing a single vault/with few secrets.
I am having hard time accessing the secrets. I am getting 404.
static final GenericContainer<?> lowkeyVaultContainer = new GenericContainer<>( DockerImageName.parse("nagyesta/lowkey-vault:4.0.0")) .withCopyFileToContainer( MountableFile.forClasspathResource("test-data/import.json", 0444), "/vault/config/import.json") .withEnv("LOWKEY_VAULT_IMPORT_PATH", "/vault/config/import.json") .withEnv("LOWKEY_STRICT_URIS", "false") .withEnv("LOWKEY_VAULT_RELAXED_PORTS", "true") .withExposedPorts(8443) .withEnv("LOWKEY_VAULT_NAMES", "local");"vaults": [
{
"name": "localhost",
"secrets": [
{
"name": "app-secret",
"value": "my-super-secret-value",
"contentType": "text/plain"
},
{
"name": "database-url",
"value": "jdbc:postgresql://localhost:5432/mydb",
"contentType": "text/plain"
},
{
"name": "api-key",
"value": "abc123def456",
"contentType": "text/plain"
},
{
"name": "encryption-key",
"value": "aes-256-cbc-key-here",
"contentType": "text/plain"
},
{
"name": "jwt-secret",
"value": "jwt-super-secret-key-2024",
"contentType": "text/plain"
},
{
"name": "spring-boot-version",
"value": "3.5.4",
"contentType": "text/plain"
},
{
"name": "spring-cloud-azure-version",
"value": "5.15.0",
"contentType": "text/plain"
}
]
}
]
}`
I am having a hard time accesing the serrets. I am getting a 404. I tried various aliases etc. My requirements is to lload pre-configured vault/secrets.
What am I missing?
Any help will be appreciated!!
Thanks
Matt
All reactions