The CORS plugin has been updated to use this functionality. It will also be in the next release.<br><br>On Sunday, July 8, 2018, Marc Savy &lt;<a href="mailto:marc.savy@redhat.com">marc.savy@redhat.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As I had no negative feedback, this has been merged (along with<br>
tests). It should be in the next release.<br>
<br>
On 4 July 2018 at 20:44, Marc Savy &lt;<a href="mailto:marc.savy@redhat.com">marc.savy@redhat.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I have a prototype of this available for people to try (forgive any<br>
&gt; scrappiness, this will be tidied before the final version is merged):<br>
&gt;<br>
&gt; <a href="https://github.com/apiman/apiman/pull/686/files" target="_blank">https://github.com/apiman/<wbr>apiman/pull/686/files</a><br>
&gt;<br>
&gt; It works as follows:<br>
&gt;<br>
&gt; Let&#39;s imagine our policy chain again.<br>
&gt; [CORS, PolicyA, PolicyB]<br>
&gt;<br>
&gt; * If a policy failure occurs in the *request* chain, the entire<br>
&gt; response chain will be executed (in the usual reverse order) with<br>
&gt; #processFailure<br>
&gt;<br>
&gt; Imagine PolicyA throws a failure on the request leg, then each of the<br>
&gt; policies will have a chance to modify the failure object in the<br>
&gt; following order:<br>
&gt; [PolicyB, PolicyA, CORS]<br>
&gt;<br>
&gt; * If a policy failure occurs during the *response* chain, then only<br>
&gt; the remaining policies will have a chance to process the failure.<br>
&gt;<br>
&gt; This seemed like the most sensible/practical design to me -- happy to<br>
&gt; hear feedback, though.<br>
&gt;<br>
&gt; Here&#39;s an example of a policy using this proposed functionality:<br>
&gt;     <a href="https://gist.github.com/msavy/b872efa7f08929d19a420ea68ec3f584" target="_blank">https://gist.github.com/msavy/<wbr>b872efa7f08929d19a420ea68ec3f5<wbr>84</a><br>
&gt;<br>
&gt;<br>
&gt; Regards,<br>
&gt; Marc<br>
&gt;<br>
&gt; On 12 April 2018 at 19:42, Marc Savy &lt;<a href="mailto:marc.savy@redhat.com">marc.savy@redhat.com</a>&gt; wrote:<br>
&gt;&gt;  Marvin Oßwald filed a really interesting issue:<br>
&gt;&gt; <a href="https://issues.jboss.org/browse/APIMAN-1300" target="_blank">https://issues.jboss.org/<wbr>browse/APIMAN-1300</a><br>
&gt;&gt;<br>
&gt;&gt; In short, if we imagine a policy chain like this:<br>
&gt;&gt;<br>
&gt;&gt; [CORS, PolicyA, PolicyB]<br>
&gt;&gt;<br>
&gt;&gt; Even if PolicyB emits a failure, then the CORS policy would likely<br>
&gt;&gt; still want to be able to process the PolicyFailure to add the relevant<br>
&gt;&gt; headers (otherwise a SPA type app like Angular would break).<br>
&gt;&gt;<br>
&gt;&gt; This seems like a valid use-case.<br>
&gt;&gt;<br>
&gt;&gt; Ideally I&#39;d like to tackle this without breaking any existing interfaces.<br>
&gt;&gt;<br>
&gt;&gt; A couple of quick ideas:<br>
&gt;&gt;<br>
&gt;&gt; * Add a new interface that policies like CORS could implement that<br>
&gt;&gt; indicates it wants to do this kind of processing. E.g.<br>
&gt;&gt; IFailureProcessor or similar with a simple method signature like<br>
&gt;&gt; #process(PolicyFailure failureToModify).<br>
&gt;&gt;<br>
&gt;&gt; * An annotation: essentially the same as above, but with a<br>
&gt;&gt; @WhateverWeCallIt annotation on the method that does the processing.<br>
</blockquote><br><br>-- <br>Sent from mobile phone, apologies for brevity.<br>