[ 
https://issues.apache.org/jira/browse/CAMEL-24531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Federico Mariani updated CAMEL-24531:
-------------------------------------
    Description: 
*Background*

The seven vault/secrets early-resolution listeners in Camel Spring Boot share 
almost identical traversal, placeholder matching, resolution-failure, and 
property-source override logic. They are currently implemented separately in 
the AWS Secrets Manager, Azure Key Vault, CyberArk Vault, Google Secret 
Manager, HashiCorp Vault, IBM Secrets Manager, and Spring Cloud Config starters.

This duplication made the fail-closed change in 
https://github.com/apache/camel-spring-boot/pull/1900 touch all seven 
implementations and makes future behavioural fixes prone to inconsistent 
application.

*Goal*

Introduce a common abstraction in {{core/camel-spring-boot}} (for example 
{{EarlyResolutionPropertiesParser}}) and refactor the existing listeners to use 
it. The abstraction should centralize the common early-resolution lifecycle and 
preserve component-specific client creation and resolver details.

*Scope and acceptance criteria*

* Preserve Spring property-source precedence and the existing listener 
ordering. The precedence defect itself is tracked separately in CAMEL-24532.
* Parameterize the component-specific placeholder prefix, resolver function, 
and diagnostic wording rather than duplicating the control flow.
* Extract a placeholder remainder by removing only the leading prefix and 
trailing {{}} delimiters (for example, with {{substring}}), rather than 
globally replacing delimiter strings.
* Read {{camel.vault.ignore-resolution-failures}} only after the relevant 
{{early-resolve-properties}} guard is enabled.
* When fail-closed mode is active, evaluate all matching properties and report 
the resolution failures together (for example, using suppressed exceptions) 
rather than aborting on the first failure.
* Normalize Google Secret Manager's client-creation {{IOException}} handling to 
{{RuntimeCamelException}}, matching the surrounding early-resolution error 
handling.
* Add focused coverage for shared behaviour and retain component-specific 
coverage where needed.

*Non-goals / documentation*

Early resolution deliberately handles only property values that consist 
entirely of a placeholder. Embedded placeholders remain the responsibility of 
Camel's normal property parser. The upgrade documentation should describe this 
boundary precisely.

  was:
h2 Background

The seven vault/secrets early-resolution listeners in Camel Spring Boot share 
almost identical traversal, placeholder matching, resolution-failure, and 
property-source override logic. They are currently implemented separately in 
the AWS Secrets Manager, Azure Key Vault, CyberArk Vault, Google Secret 
Manager, HashiCorp Vault, IBM Secrets Manager, and Spring Cloud Config starters.

This duplication made the fail-closed change in 
https://github.com/apache/camel-spring-boot/pull/1900 touch all seven 
implementations and makes future behavioural fixes prone to inconsistent 
application.

h2 Goal

Introduce a common abstraction in {{core/camel-spring-boot}} (for example 
{{EarlyResolutionPropertiesParser}}) and refactor the existing listeners to use 
it. The abstraction should centralize the common early-resolution lifecycle and 
preserve component-specific client creation and resolver details.

h2 Scope and acceptance criteria

* Preserve Spring property-source precedence and the existing listener 
ordering. The precedence defect itself is tracked separately in CAMEL-24532.
* Parameterize the component-specific placeholder prefix, resolver function, 
and diagnostic wording rather than duplicating the control flow.
* Extract a placeholder remainder by removing only the leading prefix and 
trailing {{}} delimiters (for example, with {{substring}}), rather than 
globally replacing delimiter strings.
* Read {{camel.vault.ignore-resolution-failures}} only after the relevant 
{{early-resolve-properties}} guard is enabled.
* When fail-closed mode is active, evaluate all matching properties and report 
the resolution failures together (for example, using suppressed exceptions) 
rather than aborting on the first failure.
* Normalize Google Secret Manager's client-creation {{IOException}} handling to 
{{RuntimeCamelException}}, matching the surrounding early-resolution error 
handling.
* Add focused coverage for shared behaviour and retain component-specific 
coverage where needed.

h2 Non-goals / documentation

Early resolution deliberately handles only property values that consist 
entirely of a placeholder. Embedded placeholders remain the responsibility of 
Camel's normal property parser. The upgrade documentation should describe this 
boundary precisely.

h2 Context

Raised during review of https://github.com/apache/camel-spring-boot/pull/1900, 
particularly 
https://github.com/apache/camel-spring-boot/pull/1900#issuecomment-5441526018.

_Created and updated by Codex on behalf of Federico Mariani._


> Camel Spring Boot: Extract a shared early-resolution properties parser
> ----------------------------------------------------------------------
>
>                 Key: CAMEL-24531
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24531
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Federico Mariani
>            Priority: Major
>
> *Background*
> The seven vault/secrets early-resolution listeners in Camel Spring Boot share 
> almost identical traversal, placeholder matching, resolution-failure, and 
> property-source override logic. They are currently implemented separately in 
> the AWS Secrets Manager, Azure Key Vault, CyberArk Vault, Google Secret 
> Manager, HashiCorp Vault, IBM Secrets Manager, and Spring Cloud Config 
> starters.
> This duplication made the fail-closed change in 
> https://github.com/apache/camel-spring-boot/pull/1900 touch all seven 
> implementations and makes future behavioural fixes prone to inconsistent 
> application.
> *Goal*
> Introduce a common abstraction in {{core/camel-spring-boot}} (for example 
> {{EarlyResolutionPropertiesParser}}) and refactor the existing listeners to 
> use it. The abstraction should centralize the common early-resolution 
> lifecycle and preserve component-specific client creation and resolver 
> details.
> *Scope and acceptance criteria*
> * Preserve Spring property-source precedence and the existing listener 
> ordering. The precedence defect itself is tracked separately in CAMEL-24532.
> * Parameterize the component-specific placeholder prefix, resolver function, 
> and diagnostic wording rather than duplicating the control flow.
> * Extract a placeholder remainder by removing only the leading prefix and 
> trailing {{}} delimiters (for example, with {{substring}}), rather than 
> globally replacing delimiter strings.
> * Read {{camel.vault.ignore-resolution-failures}} only after the relevant 
> {{early-resolve-properties}} guard is enabled.
> * When fail-closed mode is active, evaluate all matching properties and 
> report the resolution failures together (for example, using suppressed 
> exceptions) rather than aborting on the first failure.
> * Normalize Google Secret Manager's client-creation {{IOException}} handling 
> to {{RuntimeCamelException}}, matching the surrounding early-resolution error 
> handling.
> * Add focused coverage for shared behaviour and retain component-specific 
> coverage where needed.
> *Non-goals / documentation*
> Early resolution deliberately handles only property values that consist 
> entirely of a placeholder. Embedded placeholders remain the responsibility of 
> Camel's normal property parser. The upgrade documentation should describe 
> this boundary precisely.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to