[Pki-devel] [PATCH] TRAC Ticket #868 - REST API get certs links missing segment [20140307]

Ade Lee alee at redhat.com
Thu Mar 13 18:38:48 UTC 2014


This patch doesn't future proof against other possible URL changes.
This bug basically arose because we changed the annotation for
CertsResource from "/certs" to "".

I think you should be rather mapping to the relevant GET method instead
using:

http://docs.oracle.com/javaee/6/api/javax/ws/rs/core/UriBuilder.html#path%28java.lang.Class,%20java.lang.String%29

either:
public abstract UriBuilder path(java.lang.Class resource,
                                java.lang.String method)

or:
public abstract UriBuilder path(java.lang.reflect.Method method)

In fact, we might want to open a ticket to confirm that all the rest of
the URLs are likewise future-proofed against changes.
                   
Ade

On Fri, 2014-03-07 at 18:48 -0800, Matthew Harmsen wrote:
> Please review the following patch which addresses:
>       * PKI TRAC Ticket #868 - REST API get certs links missing
>         segment
> 
> This patch has been tested on the DOGTAG_10_0_BRANCH as used on Fedora
> 19:
> 
> 
>         Prior to the patch, the following URL:
>         
>         
>               * https://fedora19.example.com:8443/ca/rest/certs
>         
>         produces an XML page which contains XML such as:
>         
>         
>               * <Link
>                 href="https://fedora19.example.com:8443/ca/rest/0x1"
>                 rel="self"/>
>         
>         which produces an 'HTTP Status 404' page.
>         
>         
>         
>         After the patch has been applied, the same URL produces an XML
>         page which contains XML such as:
>         
>         
>               * <Link
>                 href="https://fedora19.example.com:8443/ca/rest/certs/0x1" rel="self"/>
>         
>         which corresponds to a valid URL.
>         
>         
> 
> NOTE:  This patch needs to be applied to the DOGTAG_10_0_BRANCH
> (Fedora 19), the DOGTAG_10_1_BRANCH (Fedora 20), and the master
> (Fedora 21+).
>        This patch may also need to be applied to the
> IPA_V3_RHEL_7_ERRATA_BRANCH.
> 
> 
> _______________________________________________
> Pki-devel mailing list
> Pki-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/pki-devel





More information about the Pki-devel mailing list