Prev Next

Spring / Spring CredHub Interview questions

Explain the execution flow of credential interpolation for VCAP_SERVICES?

flowchart TD A[App receives VCAP_SERVICES from platform] --> B[Bound service entry contains a credential reference, not the raw secret] B --> C[App builds a ServicesData object from VCAP_SERVICES] C --> D[interpolateServiceData sent to CredHub's interpolation endpoint] D --> E[CredHub scans the structure for its own credential references] E --> F[Each reference resolved to its current credential value] F --> G[Resolved ServicesData returned with real values in place] G --> H[App reads bound-service config normally via Spring Cloud Connectors]

The reason this exists at all is that a CredHub-backed service broker doesn't want to hand an app's raw secret to the platform's binding metadata, which can end up logged, cached, or surfaced through cf env. Instead the binding contains a pointer — effectively "this credential lives at this CredHub name" — and it's only resolved to the real value in the single, authenticated interpolateServiceData() call.

Because that call is made with the app's own identity (mTLS or OAuth2), it only succeeds if the app already has read permission on the referenced credential — interpolation doesn't bypass CredHub's normal access control, it just batches the lookups for every reference in VCAP_SERVICES into one round trip instead of one per credential.

Why doesn't a CredHub-backed service binding contain the raw secret directly?
What permission must the app already hold for interpolation to succeed?

More Related questions...

What is Spring CredHub? What is CredHub? What are the core modules of Spring CredHub? What is the purpose of the spring-credhub-starter dependency? How do you add Spring CredHub to a Maven project? What is CredHubOperations? What is CredHubTemplate? What are the credential types supported by Spring CredHub? Define CredentialName in Spring CredHub? What is a CredentialDetails object? Describe CredHubCredentialOperations? What is CredHubPermissionOperations used for? List the authentication mechanisms supported by Spring CredHub? What is mutual TLS authentication in Spring CredHub? How do you configure the CredHub server URL? What is a password credential in Spring CredHub? What is a JsonCredential? How do you write a credential using CredHubOperations? What is CredHubInfoOperations? Describe CredHubInterpolationOperations? What is the difference between write and generate operations in Spring CredHub? What is the difference between getByName and getByNameWithHistory? How does Spring CredHub regenerate a credential? Why does Spring CredHub prefer mutual TLS over OAuth2 on Cloud Foundry? How do you configure OAuth2 authentication for Spring CredHub? What is the difference between CredHubPermissionOperations and CredHubPermissionV2Operations? How does Spring CredHub represent an actor in a permission entry? When should you use CredHubInterpolationOperations? What happens when you call getByName for a credential that does not exist? How is CredHubException structured? What is the difference between a UserCredential and a PasswordCredential? How do you enable reactive support in Spring CredHub? What is the difference between CredHubOperations and ReactiveCredHubOperations? Why would you choose CertificateCredential over a generic JsonCredential for TLS material? How does Spring Cloud Config Server use CredHub as a backend? When should you use the generate operation instead of write for a password? How do you troubleshoot a certificate_unknown error with mutual TLS? What is the difference between spring-credhub-core and spring-credhub-starter? Explain the lifecycle of a generated credential in CredHub? Explain the execution flow of a Spring Boot app calling CredHubOperations.write()? Explain the internal working of Spring CredHub's OAuth2 client-credentials authentication? How can you optimize credential retrieval in a high-throughput Spring service? Which is better for testing Spring CredHub integrations, Mockito or a real CredHub server, and why? Explain how CredentialRequest and CredentialDetails work together in the write API? Explain the internal working of Spring CredHub's mutual TLS auto-configuration on Cloud Foundry? How do you unit test a service that depends on CredHubCredentialOperations? Explain how permission actors and operations combine to enforce access control in CredHub? How does Spring CredHub's ReactiveCredHubTemplate differ internally from CredHubTemplate? Explain the execution flow of credential interpolation for VCAP_SERVICES? How can you design a credential rotation strategy using Spring CredHub's regenerate operation?
Show more question and Answers...


Comments & Discussions