I have a Constraint/ConstraintMapping that enables authentication. However, I need to exclude exactly one path from it, where authentication is not needed (and only for GET requests).
I created a constraint mapping with no constraint:
ConstraintMapping exclude = new ConstraintMapping();
exclude.setPathSpec("/items/{id}/list");
exclude.setMethod("GET");
The questions I have regarding this is:
- How can I add a pathSpec where there is an {id} parameter? I believe using setPathSpec("/items/{id}/list") wouldn't work.
- If I add the method GET, will it be only enabled for GET requests to that endpoint?