{"id":18466278,"url":"https://github.com/ritreshgirdhar/microservice-vault-integration","last_synced_at":"2026-05-09T10:20:38.760Z","repository":{"id":78314225,"uuid":"342682674","full_name":"RitreshGirdhar/microservice-vault-integration","owner":"RitreshGirdhar","description":"Spring cloud application integration with Hashicorp-Vault.","archived":false,"fork":false,"pushed_at":"2021-05-07T14:20:16.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-04T08:53:54.532Z","etag":null,"topics":["hashicorp-vault","spring","spring-boot","spring-cloud","vault"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RitreshGirdhar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-26T19:41:25.000Z","updated_at":"2021-05-07T14:22:47.000Z","dependencies_parsed_at":"2023-04-20T20:08:07.186Z","dependency_job_id":null,"html_url":"https://github.com/RitreshGirdhar/microservice-vault-integration","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RitreshGirdhar%2Fmicroservice-vault-integration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RitreshGirdhar%2Fmicroservice-vault-integration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RitreshGirdhar%2Fmicroservice-vault-integration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RitreshGirdhar%2Fmicroservice-vault-integration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RitreshGirdhar","download_url":"https://codeload.github.com/RitreshGirdhar/microservice-vault-integration/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252310961,"owners_count":21727516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hashicorp-vault","spring","spring-boot","spring-cloud","vault"],"created_at":"2024-11-06T09:15:55.791Z","updated_at":"2026-05-09T10:20:38.713Z","avatar_url":"https://github.com/RitreshGirdhar.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Cloud application integration with Hashcorp vault\n\n### Pre-requisite\n* Some knowledge of Spring boot and docker will be helpful.\n\nHere, I am using docker for ease of set up\n\n\nRun below command to run vault server in development mode\n```\ndocker run --cap-add=IPC_LOCK -d --name=dev-vault -p8200:8200 -e 'VAULT_DEV_ROOT_TOKEN_ID=myroot' vault\n```\n\nConfirm that docker is up using below command \n```\n ritgirdh$ docker ps\nCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES\n9ad13a11b2d5        vault               \"docker-entrypoint.s…\"   25 hours ago        Up 25 hours         0.0.0.0:8200-\u003e8200/tcp   dev-vault\n```\n\nLogin http://localhost:8200/ui/ with token value myroot\n// TODO - screen shot\n\nNow create secret for weather service \n\n```\ndocker exec -it 9ad13a11b2d5 sh\n/ # vault kv put secret/weather-service weather.username=demouser weather.password=demopassword\nGet \"https://127.0.0.1:8200/v1/sys/internal/ui/mounts/secret/weather-service\": http: server gave HTTP response to HTTPS client\n/ # export VAULT_ADDR=\"http://127.0.0.1:8200\"\n/ # export export VAULT_TOKEN=\"myroot\"\n/ # vault kv put secret/weather-service weather.username=demouser weather.password=demopassword\nKey              Value\n---              -----\ncreated_time     2021-05-05T15:45:20.1485816Z\ndeletion_time    n/a\ndestroyed        false\nversion          1\n```\n\nNow add for QA and prod profile\n```\ndocker exec -it 9ad13a11b2d5 sh\n/ # vault kv put secret/weather-service/qa weather.username=qauser weather.password=qapassword\nKey              Value\n---              -----\ncreated_time     2021-05-05T15:46:25.801457Z\ndeletion_time    n/a\ndestroyed        false\nversion          1\n```\n\n```\ndocker exec -it 9ad13a11b2d5 sh\n/ # vault kv put secret/weather-service/prod weather.username=produser weather.password=prodpassword\nKey              Value\n---              -----\ncreated_time     2021-05-05T15:46:50.5295174Z\ndeletion_time    n/a\ndestroyed        false\nversion          1\n```\n```\n//TODO Screen shot\n```\n\nBuild microservice\n```\nritgirdh$ cd microservice/\nritgirdh$ mvn clean install\n....\n```\nRun \n``` \ndocker run -d -p8080:8080 weather-service -spring.active.profile=qa\n```\ncurl -ivk http://locahost:8080/weather\nIn qa Sunny\nIn prod Rainy\n\n\nNow make change in vault and see whether its getting reflected in the application \n\n\nHappy learning!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fritreshgirdhar%2Fmicroservice-vault-integration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fritreshgirdhar%2Fmicroservice-vault-integration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fritreshgirdhar%2Fmicroservice-vault-integration/lists"}