[Geoserver-devel] MetadataURL validation inconsistency

I’m dealing with a complaint that REST doesn’t validate metadata URLs on layers the same way the Web UI does.

I got it raising an exception when the value can’t be parsed into a URL but found the unit tests use relative URLs in places (https://github.com/geoserver/geoserver/blob/master/src/main/src/test/java/org/vfny/geoserver/util/ResponseUtilsTest.java#L61). I checked the web UI validation and it only accepts full URLs with a schema of HTTP, HTTPS, or FTP. It seems like this should be consistent: either the validation should be loosened to allow relative URLs, or the unit tests should only be using full URLs.

I couldn’t find any indication of what’s correct in the OGC specs although that seems to me it would imply inclusiveness.

Kevin Smith

Junior Software Engineer | Boundless

ksmith@anonymised.com

+1-778-785-7459

@boundlessgeo

With a CSW implementation in GeoServer I could see allowing relative links as a useful feature.

···

On Wed, Mar 19, 2014 at 1:09 PM, Kevin Smith <ksmith@anonymised.com> wrote:

I’m dealing with a complaint that REST doesn’t validate metadata URLs on layers the same way the Web UI does.

I got it raising an exception when the value can’t be parsed into a URL but found the unit tests use relative URLs in places (https://github.com/geoserver/geoserver/blob/master/src/main/src/test/java/org/vfny/geoserver/util/ResponseUtilsTest.java#L61). I checked the web UI validation and it only accepts full URLs with a schema of HTTP, HTTPS, or FTP. It seems like this should be consistent: either the validation should be loosened to allow relative URLs, or the unit tests should only be using full URLs.

I couldn’t find any indication of what’s correct in the OGC specs although that seems to me it would imply inclusiveness.

Kevin Smith

Junior Software Engineer | Boundless

ksmith@anonymised.com

+1-778-785-7459

@boundlessgeo


Learn Graph Databases - Download FREE O’Reilly Book
“Graph Databases” is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive

Yes, I expect that was the idea. Replacing the Wicket validator with one that allows relative URLs, adding validation to the XStream deserialization (Having readResolve throw a Runtime Exception), and leaving the unit tests as is.

I’ve also noticed that the ServiceInfo objects each have a MetadataLinkInfo

which defaults to having all its fields null rather than just having null in place of the object. (In the XML serialization “” appears rather than having nothing) This strikes me as a bit odd but probably isn’t worth the trouble of changing.

···

On 20 March 2014 06:45, Justin Deoliveira <jdeolive@anonymised.com> wrote:

With a CSW implementation in GeoServer I could see allowing relative links as a useful feature.

Kevin Smith

Junior Software Engineer | Boundless

ksmith@anonymised.com

+1-778-785-7459

@boundlessgeo

On Wed, Mar 19, 2014 at 1:09 PM, Kevin Smith <ksmith@anonymised.com> wrote:

I’m dealing with a complaint that REST doesn’t validate metadata URLs on layers the same way the Web UI does.

I got it raising an exception when the value can’t be parsed into a URL but found the unit tests use relative URLs in places (https://github.com/geoserver/geoserver/blob/master/src/main/src/test/java/org/vfny/geoserver/util/ResponseUtilsTest.java#L61). I checked the web UI validation and it only accepts full URLs with a schema of HTTP, HTTPS, or FTP. It seems like this should be consistent: either the validation should be loosened to allow relative URLs, or the unit tests should only be using full URLs.

I couldn’t find any indication of what’s correct in the OGC specs although that seems to me it would imply inclusiveness.

Kevin Smith

Junior Software Engineer | Boundless

ksmith@anonymised.com

+1-778-785-7459

@boundlessgeo


Learn Graph Databases - Download FREE O’Reilly Book
“Graph Databases” is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive