[Apiman-user] Feedback wanted: Allowing policies to modify PolicyFailures emitted by *other* policies in chain

Marc Savy marc.savy at redhat.com
Thu Apr 12 14:42:19 EDT 2018


 Marvin Oßwald filed a really interesting issue:
https://issues.jboss.org/browse/APIMAN-1300

In short, if we imagine a policy chain like this:

[CORS, PolicyA, PolicyB]

Even if PolicyB emits a failure, then the CORS policy would likely
still want to be able to process the PolicyFailure to add the relevant
headers (otherwise a SPA type app like Angular would break).

This seems like a valid use-case.

Ideally I'd like to tackle this without breaking any existing interfaces.

A couple of quick ideas:

* Add a new interface that policies like CORS could implement that
indicates it wants to do this kind of processing. E.g.
IFailureProcessor or similar with a simple method signature like
#process(PolicyFailure failureToModify).

* An annotation: essentially the same as above, but with a
@WhateverWeCallIt annotation on the method that does the processing.



More information about the Apiman-user mailing list