Claus Ibsen created CAMEL-26921:
-----------------------------------

             Summary: camel-oaipmh - remove the CamelOaimphIgnoreSSLWarnings 
producer header
                 Key: CAMEL-26921
                 URL: https://issues.apache.org/jira/browse/CAMEL-26921
             Project: Camel
          Issue Type: Improvement
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
             Fix For: 4.24.0, 4.22.3, 4.18.6


Since CAMEL-26130 (4.24.0), the OAI-PMH producer reads the 
{{CamelOaimphOnlyFirst}} and {{CamelOaimphIgnoreSSLWarnings}} headers for the 
current exchange only; before that, {{OAIPMHProducer.overrideHarvesterConfigs}} 
wrote them into the shared {{OAIPMHEndpoint}} ({{endpoint.setOnlyFirst(...)}}, 
{{endpoint.setIgnoreSSLWarnings(...)}}), so one exchange with the header 
changed the endpoint for every later exchange on the same URI.

This issue covers two follow-ups.

*1. main (4.24.0): remove the {{CamelOaimphIgnoreSSLWarnings}} header*

_Today:_ the SSL setting of the HTTP client can be set in two places: the 
{{ignoreSSLWarnings}} endpoint option, and the {{CamelOaimphIgnoreSSLWarnings}} 
message header, which is not in the component documentation or the catalog.

_After the change:_ the {{ignoreSSLWarnings}} endpoint option is the only way 
to set it. The producer no longer reads the header. 
{{OAIPMHConstants.IGNORE_SSL_WARNINGS}} is removed. {{CamelOaimphOnlyFirst}} 
stays as a per-exchange header.

Code change:
* {{OAIPMHProducer.process()}}: set 
{{harvester.getHttpClient().setIgnoreSSLWarnings(...)}} from 
{{endpoint.isIgnoreSSLWarnings()}} only.
* {{OAIPMHConstants}}: remove {{IGNORE_SSL_WARNINGS}} (hard break, no 
deprecated alias, as for other header changes).
* Upgrade guide 4.24: the {{CamelOaimphIgnoreSSLWarnings}} header is removed; 
use the {{ignoreSSLWarnings}} endpoint option instead (amend the CAMEL-26130 
entry).

Tests ({{OAIPMHProducerHeadersPerExchangeTest}} or a new test, against the 
HTTPS port of {{MockOaipmhServer}}):
* an exchange with {{CamelOaimphIgnoreSSLWarnings=true}} on an endpoint without 
{{ignoreSSLWarnings}} behaves as if the header were absent;
* an endpoint with {{ignoreSSLWarnings=true}} still harvests from the HTTPS 
port.

*2. camel-4.22.x (4.22.3) and camel-4.18.x (4.18.6): port the per-exchange 
handling of CAMEL-26130*

_Today:_ both maintenance lines still write {{CamelOaimphOnlyFirst}} and 
{{CamelOaimphIgnoreSSLWarnings}} into the shared endpoint, so after one 
exchange with {{CamelOaimphOnlyFirst=true}} every later exchange returns only 
the first page, and the same applies to the SSL header.

_After the change:_ both headers apply only to the exchange that carries them; 
the producer never changes the endpoint at runtime. The headers are kept on 
these lines (no removal in a patch release).

Code change:
* {{OAIPMHProducer.process()}}: compute {{onlyFirst}} and {{ignoreSSLWarnings}} 
as local values from the endpoint options, overridden by the headers of the 
current exchange; pass them to {{harvester.synHarvest(onlyFirst)}} and the HTTP 
client; the resumption-token branch uses the local {{onlyFirst}}.
* Remove the {{endpoint::setOnlyFirst}} and {{endpoint::setIgnoreSSLWarnings}} 
calls.
* camel-4.22.x is the same code as main before CAMEL-26130 (cherry-pick); 
camel-4.18.x has no custom HTTP headers support (CAMEL-23351), so 
{{overrideHarvesterConfigs}} needs a small manual port.
* Upgrade guide notes for 4.22.3 and 4.18.6 (on main): these headers now apply 
only to the exchange that carries them; a route that relied on the value 
staying on the endpoint sets the endpoint option instead.

Tests: port {{OAIPMHProducerHeadersPerExchangeTest}} 
({{onlyFirstHeaderAppliesToItsExchangeOnly}} and the check that the endpoint 
options keep their configured values).



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

Reply via email to