Skip to content

Example SpringBoot application leveraging CredHub

Notifications You must be signed in to change notification settings

ssherwood/demos-credhub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpringBoot CredHub Demo

Overview

When run within CloudFoundry and bound to the CredHub Service Broker any established secrets will be presented to the container in a modified VCAP_SERVICES JSON.

This mapping is handled by CloudFoundry transparently to the application, so no other special libraries/tools are needed (just the ability to parse VCAP_SERVICES).

SpringBoot automatically parses the VCAP_SERVICES and adds the results to the Environment (and can therefore be used in standard SPEL expressions and configuration properties).

Usage

Build

./gradlew clean build

Deploy

$ cf push demo-credhub -p build/libs/cf-credhub-0.0.1-SNAPSHOT.jar
$ curl http://demo-credhub.<your-domain>/secrets

^ you should see the defaults "unknown#"

Bind CredHub

$ cf create-service credhub default my-secrets -c '{"secret-list":"foo,bar,baz"}'
$ cf restage demo-credhub

^ you should see the "foo,bar,baz" secrets

Other Resources

About

Example SpringBoot application leveraging CredHub

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages