From: Mathieu Baudier Date: Wed, 18 Oct 2023 08:52:02 +0000 (+0200) Subject: Make WFS http handler authentication aware. X-Git-Tag: v2.3.17~3 X-Git-Url: http://git.argeo.org/?p=gpl%2Fargeo-suite.git;a=commitdiff_plain;h=79f547b6827c6f2f8d2a0eb809d2a5ac9d1e1df3 Make WFS http handler authentication aware. --- diff --git a/org.argeo.app.geo/src/org/argeo/app/geo/http/WfsHttpHandler.java b/org.argeo.app.geo/src/org/argeo/app/geo/http/WfsHttpHandler.java index c9a1e85..94c3c01 100644 --- a/org.argeo.app.geo/src/org/argeo/app/geo/http/WfsHttpHandler.java +++ b/org.argeo.app.geo/src/org/argeo/app/geo/http/WfsHttpHandler.java @@ -35,7 +35,9 @@ import org.argeo.app.geo.GeoUtils; import org.argeo.app.geo.GpxUtils; import org.argeo.app.geo.JTS; import org.argeo.cms.acr.json.AcrJsonUtils; +import org.argeo.cms.auth.RemoteAuthUtils; import org.argeo.cms.http.HttpHeader; +import org.argeo.cms.http.RemoteAuthHttpExchange; import org.argeo.cms.http.server.HttpServerUtils; import org.argeo.cms.util.LangUtils; import org.geotools.api.feature.GeometryAttribute; @@ -200,7 +202,10 @@ public class WfsHttpHandler implements HttpHandler { if (featureAdapter == null) throw new IllegalStateException("No feature adapter found for " + typeName); // f.isContentClass(typeName); - featureAdapter.addConstraintsForFeature((AndFilter) search.getWhere(), typeName); + RemoteAuthUtils.doAs(() -> { + featureAdapter.addConstraintsForFeature((AndFilter) search.getWhere(), typeName); + return null; + }, new RemoteAuthHttpExchange(exchange)); } if (bbox != null) {