Croway commented on PR #30364:
URL: https://github.com/apache/camel/pull/30364#issuecomment-7006013935

   The check `CREDENTIAL_OPTIONS.contains(p.getKey())` in 
`GoogleSheetsEndpoint.configureRequest` (`GoogleSheetsEndpoint.java:165`) is 
case-sensitive. The header suffix keeps its case, though, and the setter lookup 
capitalises the first letter. So a `CamelGoogleSheets.AccessToken` header 
passes the check and still sets `access_token` on the request. I added this to 
`GoogleSheetsRequestCredentialTest` on 8117355a58:
   
   ```java
   for (String header : List.of("CamelGoogleSheets.accessToken", 
"CamelGoogleSheets.AccessToken")) {
       transport.requests.clear();
       try (CamelContext context = createContext()) {
           context.createProducerTemplate().requestBodyAndHeader(
                   "google-sheets://data/get?spreadsheetId=abc&range=A1:B1&" + 
OAUTH, null, header, "htoken");
           System.out.println(header + " -> " + 
transport.requests.get(0).getUrl());
       }
   }
   ```
   
   ```
   CamelGoogleSheets.accessToken -> 
https://sheets.googleapis.com/v4/spreadsheets/abc/values/A1:B1
   CamelGoogleSheets.AccessToken -> 
https://sheets.googleapis.com/v4/spreadsheets/abc/values/A1:B1?access_token=htoken
   ```
   
   A case-insensitive set (for example a `TreeSet` with 
`String.CASE_INSENSITIVE_ORDER`) would close it. The same applies to 
`GoogleApiRequestHelper` in #30369, which this endpoint is going to use.
   
   _Claude Code on behalf of Croway_
   


-- 
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]

Reply via email to