Comments (4)
Hi @Docjones,
Thank you for reaching out. I'm not a java developer so I don't know anything about spring boot cloud config. Can you elaborate a bit on how this setup up should look like?
from medusa.
Hello @jonasvinther,
sorry if i was unclear :) spring boot applications rely heavyly on configuration in form of (java) property files (see here). Typically, there are secrets like database connection strings stored within.
We want to import our property files into a vault server. spring-boot-cloud already allows us to retrieve the kv from a vault during boot. But we have several dozens of property files to migrate
from medusa.
You could do something like this :
Have a file java.properties
with the following content
---
key: |-
# You are reading the ".properties" entry.
! The exclamation mark can also mark text as comments.
# The key characters =, and : should be written with
# a preceding backslash to ensure that they are properly loaded.
# However, there is no need to precede the value characters =, and : by a backslash.
website = https://en.wikipedia.org/
language = English
# The backslash below tells the application to continue reading
# the value onto the next line.
message = Welcome to \
Wikipedia!
# But if the number of backslashes at the end of the line is even, the next line is not included in the value. In the following example, the value for "key" is "valueOverOneLine\"
key = valueOverOneLine\\
# This line is not included in the value for "key"
# Add spaces to the key
key\ with\ spaces = This is the value that could be looked up with the key "key with spaces".
# The characters = and : in the key must be escaped as well:
key\:with\=colonAndEqualsSign = This is the value for the key "key:with=colonAndEqualsSign"
# Unicode
tab : \u0009
# If you want your property to include a backslash, it should be escaped by another backslash
path=c:\\wiki\\templates
# However, some editors will handle this automatically
Then import via
./medusa import secret/javaproject/properties java.properties -a="https://0.0.0.0:8201" -t="00000000-0000-0000-0000-000000000000" --insecure
Then export it again
echo -e $(./medusa export secret/javaproject/ -a="https://0.0.0.0:8201" -t="00000000-0000-0000-0000-000000000000" --format="json" --insecure | jq .javaproject.properties.key)
"# You are reading the \".properties\" entry.
! The exclamation mark can also mark text as comments.
# The key characters =, and : should be written with
# a preceding backslash to ensure that they are properly loaded.
# However, there is no need to precede the value characters =, and : by a backslash.
website = https://en.wikipedia.org/
language = English
# The backslash below tells the application to continue reading
# the value onto the next line.
message = Welcome to \
Wikipedia!
# But if the number of backslashes at the end of the line is even, the next line is not included in the value. In the following example, the value for \"key\" is \"valueOverOneLine\\"
key = valueOverOneLine\\
# This line is not included in the value for \"key\"
# Add spaces to the key
key\ with\ spaces = This is the value that could be looked up with the key \"key with spaces\".
# The characters = and : in the key must be escaped as well:
key\:with\=colonAndEqualsSign = This is the value for the key \"key:with=colonAndEqualsSign\"
# Unicode
tab : \u0009
# If you want your property to include a backslash, it should be escaped by another backslash
path=c:\\wiki\\templates
# However, some editors will handle this automatically"
The quotes could be removed with a sed
command
from medusa.
This is a framework specific feature and therefore not something we intend to implement. @hoeghh has made a proposal on how it could work using Medusa. I'm closing this issue.
from medusa.
Related Issues (20)
- unable to export with --insecure flag. HOT 1
- required policy ? HOT 3
- Feature: Implement Export & Import of secret versions
- Feature Request: Import and Export of Policies.
- JSON switch disabled in Vault UI after secrets imported( in yaml or json file) HOT 1
- cannot export from my vault because the path not found HOT 1
- ERROR: fail get idrsa, x509: failed to parse private key (use ParsePKCS8PrivateKey instead for this key format) HOT 4
- TLS Handshake Timeout With Many Paths
- Would it be possible to publish v2.x docker image(s) to ghcr.io ?
- Unable to export kv1 HOT 3
- feature: display only secrets' keys, not their value
- support to copy secrets provided in arguments
- Failure when the last version of secret is deleted HOT 1
- Failure when the last version of secret is deleted HOT 1
- vault:latest no longer exists in Docker Hub HOT 3
- Encryption/Decryption & OpenSSL
- Release assets missing for 0.7.0 HOT 1
- Error to the moment to run go build :(
- Ignoring updates
- Error while reading secret HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from medusa.