Croway commented on PR #30369:
URL: https://github.com/apache/camel/pull/30369#issuecomment-7006014586
The check `CREDENTIAL_OPTIONS.contains(p.getKey())` in
`GoogleApiRequestHelper.configureRequest` (`GoogleApiRequestHelper.java:56`) is
case-sensitive. The header suffix keeps its case, though, and the setter lookup
capitalises the first letter. So a `CamelGoogleDrive.AccessToken` header passes
the check and the token still ends up in the URL. The Mail and Calendar
producers go through the same helper. I added this to
`GoogleDriveRequestCredentialTest` on e405249f43:
```java
for (String header : List.of("CamelGoogleDrive.accessToken",
"CamelGoogleDrive.AccessToken")) {
transport.requests.clear();
try (CamelContext context = createContext()) {
context.createProducerTemplate().requestBodyAndHeader(
"google-drive://drive-files/list?" + OAUTH, null, header,
"htoken");
System.out.println(header + " -> " +
transport.requests.get(0).getUrl());
}
}
```
```
CamelGoogleDrive.accessToken -> https://www.googleapis.com/drive/v3/files
CamelGoogleDrive.AccessToken ->
https://www.googleapis.com/drive/v3/files?access_token=htoken
```
A case-insensitive set (for example a `TreeSet` with
`String.CASE_INSENSITIVE_ORDER`) would close it, and the Sheets copy in #30364
has the same gap.
_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]