Hi all
A customer of mine wants to sponsor WMS GetMap output format restrictions and I want to start this work during the weekend.
The theme is not a new one, I found some mail threads
http://osgeo-org.1560.x6.nabble.com/WMS-output-format-restrictions-td3796402.html
There is also an issue about the topic
http://jira.codehaus.org/browse/GEOS-4592
My investigations so far
-
GEOS-4592 proposes a black listing of formats. I would prefer a white listing of mime types. Implementations of org.geoserver.wms.GetMapOutputFormat are injected by Spring and as consequence, output formats can be added by extensions.
-
I would like to store the white list in org.geoserver.wms.WMSInfo like the “Limited SRS list”. An empty white list means all formats are allowed (this is the default).
-
I think I can find all supported mime types by retrieving all implementations of GetMapOutputFormat form the Spring context and collecting the result of the method getMimeType(). On the WMSAdminPage I would implement a CheckBox “Allowed mime types”. The default value of this CheckBox is unchecked. If checked, I want dynamically add a list of check boxes representing each mime type .
-
If the white list is not empty, the WMS capabilities document contains only allowed format names, retrieved by GetMapOutputFormat.getOutputFormatNames().
-
A nice place to check the mime type would be org.geoserver.wms.GetMap.getDelegate(). If the mime type of the producer is not in the white list, I would throw a ServiceException. The problem I have is how to get WSInfo object (global or workspace specific). Any Hints ?
-
Is it enough to open a JIRA issue or should I write a GSIP on github.
Thanks in advance for comments, advises and hints.
Cheers
Christian
–
DI Christian Mueller MSc (GIS), MSc (IT-Security)
OSS Open Source Solutions GmbH