Andrea Cosentino created CAMEL-28049:
----------------------------------------

             Summary: camel-google: replace the deprecated JacksonFactory with 
GsonFactory, and pin the Google Cloud libraries with the BOM
                 Key: CAMEL-28049
                 URL: https://issues.apache.org/jira/browse/CAMEL-28049
             Project: Camel
          Issue Type: Task
          Components: camel-google
            Reporter: Andrea Cosentino


Found during an audit of the cloud components (camel-aws, camel-azure, 
camel-google, camel-huawei) at commit 7c0644752e17. Every item below was 
verified against the source.

h4. 1. The deprecated JacksonFactory is used in eight places
{{com.google.api.client.json.jackson2.JacksonFactory}} is annotated 
{{@Deprecated}} upstream with "use com.google.api.client.json.GsonFactory 
instead". camel-google instantiates it eight times and uses {{GsonFactory}} 
zero times. The most important one is in the shared helper, from which the 
whole family inherits it:

{code:java}
// camel-google-common GoogleCredentialsHelper.java
private static final JsonFactory DEFAULT_JSON_FACTORY = new JacksonFactory();
{code}

The others are in BatchGoogleCalendarClientFactory, 
BatchGoogleMailClientFactory, BatchGoogleDriveClientFactory, 
BatchGoogleSheetsClientFactory and InteractiveGoogleDriveClientFactory.

Proposed change: switch to GsonFactory. This also drops a transitive dependency 
on the google-http-client Jackson 2 module.

h4. 2. Twelve Google Cloud versions are pinned independently, with no BOM
{{parent/pom.xml}} pins google-cloud-bigquery, -core, -firestore, -functions, 
-http-client, -pubsub, -secretmanager, -storage, -aiplatform, -vision, -speech 
and -texttospeech as twelve separate properties, and imports no Google BOM. 
camel-azure imports {{com.azure:azure-sdk-bom}} and camel-aws drives all 37 
poms from a single {{aws-java-sdk2-version}} property, so camel-google is the 
outlier. The consequence is the grpc/protobuf drift that had to be pinned by 
hand in CAMEL-27188 and the wire pin in CAMEL-24904.

{{com.google.cloud:libraries-bom}} exists for exactly this and is actively 
released (26.94.0, November 2026).

Proposed change: import libraries-bom in the dependencyManagement of the 
camel-google parent and drop the individual version properties it covers.

h4. 3. Smaller issues in the shared helper
{{GoogleCredentialsHelper.getCredentials}} javadoc still promises "@throws 
RuntimeException if neither OAuth nor service account credentials are 
configured", but the method falls back to Application Default Credentials 
instead.
{{wrapWithImpersonationIfNeeded}} is called only inside the 
workload-identity-federation branch, so {{impersonatedServiceAccount}} is 
silently ignored on the serviceAccountKey and ADC paths. google-storage 
documents that restriction on its own option, but the default method on the 
{{GoogleCommonConfiguration}} SPI does not, so the next component to implement 
it will drop the option silently. The impersonation token lifetime is 
hard-coded to 3600 seconds.

_Claude Code on behalf of oscerd_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to