Dhairya-007 opened a new pull request, #29568:
URL: https://github.com/apache/camel/pull/29568
`CyberArkVaultConfigurationProperties` has one fluent `withXxx` method per
option. Nine of them delegate to the inherited setter, but three call
*themselves*:
```java
public CyberArkVaultConfigurationProperties withApiKey(String apiKey) {
withApiKey(apiKey); // -> setApiKey(apiKey)
return this;
}
public CyberArkVaultConfigurationProperties withVerifySSL(boolean verifySSL)
{
withVerifySSL(verifySSL); // -> setVerifySsl(verifySSL)
return this;
}
public CyberArkVaultConfigurationProperties withCertificatePath(String
certificatePath) {
withCertificatePath(certificatePath); // ->
setCertificatePath(certificatePath)
return this;
}
```
Each is unconditional, infinite recursion: calling `withApiKey(...)` from
the Java Main DSL throws `StackOverflowError` before anything is configured,
and the three options can only be set through the `set*` methods or
`camel.vault.cyberark.*` properties. The neighbouring methods (`withUrl`,
`withAccount`, `withUsername`, `withPassword`, ...) show the intent — each
calls its setter. The setters are inherited from `CyberArkVaultConfiguration`;
note the real name for the SSL one is `setVerifySsl`, since the property is
`verifySsl`.
Verified with a standalone replica of the two classes (no Maven here), the
three buggy bodies copied verbatim:
```
BEFORE withApiKey -> StackOverflowError
BEFORE withVerifySSL -> StackOverflowError
BEFORE withCertificatePath -> StackOverflowError
AFTER apiKey=secret verifySsl=false certificatePath=/tmp/ca.pem
BEFORE field values after the 3 calls: apiKey=null verifySsl=true
certificatePath=null
```
Nothing else in the tree calls these three methods, and the generated
`CyberArkVaultConfigurationPropertiesConfigurer` binds the `set*` methods, so
no generated file changes.
The class javadoc also said "Configuration for access to Hashicorp Vault
Secret." (copy-paste from the Hashicorp class); corrected to Cyberark Conjur
Vault.
I left the method name `withVerifySSL` alone rather than renaming it to
match the `verifySsl` property, since it is public API; happy to rename it if
you prefer.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]