cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CXF-6321) Make sure global JAX-RS filters are applied once per request even if made to sub-resource
Date Thu, 02 Apr 2015 13:29:00 GMT

     [ https://issues.apache.org/jira/browse/CXF-6321?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sergey Beryozkin updated CXF-6321:
----------------------------------
    Fix Version/s: 3.0.5
                   3.1.0
         Assignee: Sergey Beryozkin
       Issue Type: Bug  (was: Improvement)

> Make sure global JAX-RS filters are applied once per request even if made to sub-resource
> -----------------------------------------------------------------------------------------
>
>                 Key: CXF-6321
>                 URL: https://issues.apache.org/jira/browse/CXF-6321
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.0.4
>            Reporter: Dmitry Kozlov
>            Assignee: Sergey Beryozkin
>             Fix For: 3.1.0, 2.7.16, 3.0.5
>
>
> As of now CXF JAX-RS implementation applies global filters once per each (sub-)resource
level.
> E.g. with resources defined as below any global filter is applied twice on a call to
sub-resource:
> {code}
> @Path("/groups")
> public interface GroupsResource {
>     @Path("/{id}/members")
>     MembersResource membersOf(@PathParam("id") String id);
> }
> -----
> public interface MembersResource {
>     @GET
>     @Path("/{memberId}")
>     MemberInfo get(@PathParam("memberId") String id);
> }
> GET http://example.com/groups/123/members/456
> {code}
> This may feel counter-intuitive in some cases and introduces certain overhead. E.g. if
you have your auth-filter defined as global.
> Following our conversation in CXF-6297 could you please consider to change filter chain
logic so that global filters are applied once per request disregard whether this request is
made to a root resource or to a sub-resource of any level.
> Filter should be called with a full request context including actual URI info and path
params, as it would be a last filter invocation in current implementation. E.g. in example
above {{uriInfo}} should be passed as {{/groups/123/members/456}} (not {{/main/123/members}}),
and path params should have both {{id}} and {{memberId}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message