Fix vault example: hashicorp secret separator and unmarshalled JDBC result - #214
Open
Croway wants to merge 1 commit into
Open
Fix vault example: hashicorp secret separator and unmarshalled JDBC result#214Croway wants to merge 1 commit into
Croway wants to merge 1 commit into
Conversation
…led JDBC result
camel-hashicorp-vault resolves {{hashicorp:secret:<path>#<key>}} using
'#' to separate the secret path from the field key, not '/'. The
datasource bean used '/', so the placeholders never resolved and the
app failed to start against a real Vault. Also aligned the README's
secret name (myDatabase) with the path actually used in
cars-datasource.yaml (database).
Separately, GET /api/cars 500'd with NoTypeConversionAvailableException
converting the JDBC SELECT's ArrayList result to InputStream for the
text/plain REST response. Marshal the result to JSON (adding
camel-jackson-starter) and serve it as application/json instead.
Verified end-to-end against real Vault and Postgres containers: app
starts, GET returns [], POST inserts a row, GET then returns it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HseDjsECuZhsCXxxioiD1k
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
camel-hashicorp-vaultresolves{{hashicorp:secret:<path>#<key>}}using#to separate the secret path from the field key, not/. The datasource bean (cars-datasource.yaml) used/, so the placeholders never resolved and the app failed to start against a real Vault.myDatabase) with the path actually used in code (database), and flagged the now-stale screenshot.GET /api/cars500'd withNoTypeConversionAvailableExceptionconverting the JDBC SELECT'sArrayListresult toInputStreamfor thetext/plainREST response. Now marshals the result to JSON (camel-jackson-starteradded) and serves it asapplication/json.Test plan
mvn -pl vault -am compilehashicorp/vault:1.16.1andpostgrescontainers, created thedatabasesecret via the Vault API, started the app withmvn spring-boot:runGET /api/cars→200 []POST /api/carswith a car payload →200GET /api/cars→200 [{"brand":"Ford","model":"Mustang","year":2024}]🤖 Generated with Claude Code
https://claude.ai/code/session_01HseDjsECuZhsCXxxioiD1k