Adding a readonly rule in GeoFence will provoke a NullPointer exception

Description

Defining an attribute READONLY rule in GeoFence will provoke a NullPointerException during a WFS transaction request to the layer, regardless if we try to update the READONLY attribute or not.

Using an external GeoFence instance (version 3.2.0) and a GeoServer instance (master) with the GeoFence community module.

To reproduce the error using the layer feature:bugsites shipped with GeoServer, define a READONLY attribute rule in GeoFence (see print-screen).

And try this requests:

Updating the READONLY attribute

curl 'http://localhost/geoserver/wfs' -H 'Content-Type: application/xml' --data-binary '<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"><wfs:Update typeName="feature:bugsites" xmlns:feature="http://www.openplans.org/spearfish"><wfsroperty><wfs:Name>str1</wfs:Name><wfs:Value>Beetle site UPDATE</wfs:Value></wfsroperty><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:FeatureId fid="bugsites.1"/></ogc:Filter></wfs:Update></wfs:Transaction>' --compressed

Updating another attribute

curl 'http://localhost/geoserver/wfs' -H 'Content-Type: application/xml' --data-binary '<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"><wfs:Update typeName="feature:bugsites" xmlns:feature="http://www.openplans.org/spearfish"><wfsroperty><wfs:Name>cat</wfs:Name><wfs:Value>10</wfs:Value></wfsroperty><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:FeatureId fid="bugsites.1"/></ogc:Filter></wfs:Update></wfs:Transaction>' --compressed

In both cases the response should be:

Stack-trace attached.

Environment

None

Status

Assignee

Nuno Oliveira

Reporter

Nuno Oliveira

Triage

None

Fix versions

Affects versions

None

Components

Priority

Medium
Configure