Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions geonode_mapstore_client/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def run_setup_hooks(*args, **kwargs):
),
re_path(r"^metadata/(?P<pk>[^/]*)$", views.metadata, name='metadata'),
re_path(r"^metadata/(?P<pk>[^/]*)/embed$", views.metadata_embed, name='metadata'),
re_path(r"^api/v2/reqrules$", views.RequestConfigurationView.as_view(), name="request-rules"),
# required, otherwise will raise no-lookup errors to be analysed
re_path(r"^api/v2/", include(router.urls)),

Expand Down Expand Up @@ -304,6 +305,11 @@ def run_setup_hooks(*args, **kwargs):

setattr(settings, "MAPSTORE_DASHBOARD_CATALOGUE_SELECTED_SERVICE", MAPSTORE_DASHBOARD_CATALOGUE_SELECTED_SERVICE)
setattr(settings, "MAPSTORE_DASHBOARD_CATALOGUE_SERVICES", MAPSTORE_DASHBOARD_CATALOGUE_SERVICES)
handlers = getattr(settings, "REQUEST_CONFIGURATION_RULES_HANDLERS", [])
handlers.extend([
"geonode_mapstore_client.handlers.BaseConfigurationRuleHandler",
])
setattr(settings, "REQUEST_CONFIGURATION_RULES_HANDLERS", handlers)


def connect_geoserver_style_visual_mode_signal():
Expand All @@ -324,4 +330,8 @@ def ready(self):
if not apps.ready:
run_setup_hooks()
connect_geoserver_style_visual_mode_signal()

from geonode_mapstore_client.registry import request_configuration_rules_registry
request_configuration_rules_registry.init_registry()

super(AppConfig, self).ready()
2 changes: 1 addition & 1 deletion geonode_mapstore_client/client/MapStore2
Submodule MapStore2 updated 52 files
+17 −12 docs/developer-guide/integrations/geoserver.md
+74 −25 docs/developer-guide/local-config.md
+38 −1 web/client/actions/security.js
+1 −3 web/client/api/ArcGIS.js
+3 −5 web/client/api/CSW.js
+1 −3 web/client/api/TMS.js
+1 −3 web/client/api/ThreeDTiles.js
+1 −3 web/client/api/WFS.js
+4 −7 web/client/api/WMS.js
+2 −5 web/client/api/WMTS.js
+2 −3 web/client/api/catalog/TMS_1_0_0.js
+13 −7 web/client/components/map/cesium/plugins/ArcGISLayer.js
+12 −4 web/client/components/map/cesium/plugins/ElevationLayer.js
+0 −1 web/client/components/map/cesium/plugins/GraticuleLayer.js
+1 −1 web/client/components/map/cesium/plugins/MarkerLayer.js
+1 −1 web/client/components/map/cesium/plugins/ModelLayer.js
+7 −1 web/client/components/map/cesium/plugins/TerrainLayer.js
+5 −0 web/client/components/map/cesium/plugins/ThreeDTilesLayer.js
+10 −3 web/client/components/map/cesium/plugins/TileProviderLayer.js
+8 −8 web/client/components/map/cesium/plugins/WMTSLayer.js
+2 −2 web/client/components/map/leaflet/plugins/ElevationLayer.js
+2 −2 web/client/components/map/leaflet/plugins/VectorLayer.jsx
+1 −1 web/client/components/map/leaflet/plugins/WFSLayer.jsx
+12 −6 web/client/components/map/leaflet/plugins/WMSLayer.js
+6 −4 web/client/components/map/leaflet/plugins/WMTSLayer.js
+5 −7 web/client/components/map/openlayers/plugins/ArcGISLayer.js
+8 −7 web/client/components/map/openlayers/plugins/COGLayer.js
+2 −2 web/client/components/map/openlayers/plugins/ElevationLayer.js
+5 −8 web/client/components/map/openlayers/plugins/TMSLayer.js
+5 −7 web/client/components/map/openlayers/plugins/TileProviderLayer.js
+3 −8 web/client/components/map/openlayers/plugins/WMSLayer.js
+7 −9 web/client/components/map/openlayers/plugins/WMTSLayer.js
+3 −5 web/client/components/misc/SecureImage.jsx
+13 −4 web/client/configs/localConfig.json
+92 −2 web/client/epics/security.js
+1 −3 web/client/epics/wfsquery.js
+37 −48 web/client/libs/ajax.js
+7 −10 web/client/observables/wfs.js
+3 −5 web/client/observables/wms.js
+4 −5 web/client/observables/wps/execute.js
+2 −3 web/client/plugins/TOC/components/StyleBasedWMSJsonLegend.jsx
+32 −2 web/client/reducers/security.js
+8 −1 web/client/selectors/__tests__/catalog-test.js
+11 −1 web/client/selectors/catalog.js
+2 −1 web/client/selectors/security.js
+2 −5 web/client/utils/LayersUtils.js
+268 −97 web/client/utils/SecurityUtils.js
+480 −22 web/client/utils/__tests__/SecurityUtils-test.js
+6 −6 web/client/utils/cesium/WMSUtils.js
+8 −5 web/client/utils/mapinfo/wfs.js
+2 −3 web/client/utils/mapinfo/wms.js
+1 −4 web/client/utils/mapinfo/wmts.js
15 changes: 15 additions & 0 deletions geonode_mapstore_client/client/js/actions/gnsecurity.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright 2025, GeoSolutions Sas.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/

export const RULE_EXPIRED = 'GEONODE_SECURITY:RULE_EXPIRED';

export function ruleExpired() {
return {
type: RULE_EXPIRED
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import axios from '@mapstore/framework/libs/ajax';
import WKT from 'ol/format/WKT';
import GeoJSON from 'ol/format/GeoJSON';
import uuid from 'uuid';
import { getEndpointUrl, RULES } from '../v2/constants';

const wktFormat = new WKT();
const geoJSONFormat = new GeoJSON();
Expand Down Expand Up @@ -78,3 +79,8 @@ export const deleteGeoLimits = (resourceId, id, type = 'user') => {
return axios.delete(`/security/geolimits/${resourceId}?${type}_id=${id}`)
.then(({ data }) => data);
};

export const getRequestRules = () => {
return axios.get(getEndpointUrl(RULES))
.then(({ data }) => data);
};
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ let endpoints = {
'facets': '/api/v2/facets',
'uploads': '/api/v2/uploads',
'metadata': '/api/v2/metadata',
'assets': '/api/v2/assets'
'assets': '/api/v2/assets',
'rules': '/api/v2/reqrules'
};

export const RESOURCES = 'resources';
Expand All @@ -51,6 +52,7 @@ export const FACETS = 'facets';
export const UPLOADS = 'uploads';
export const METADATA = 'metadata';
export const ASSETS = 'assets';
export const RULES = 'rules';

export const setEndpoints = (data) => {
endpoints = { ...endpoints, ...data };
Expand Down
4 changes: 3 additions & 1 deletion geonode_mapstore_client/client/js/apps/gn-catalogue.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import {

import timelineEpics from '@mapstore/framework/epics/timeline';
import gnresourceEpics from '@js/epics/gnresource';
import securityEpics from '@js/epics/security';
import resourceServiceEpics from '@js/epics/resourceservice';
import maplayout from '@mapstore/framework/reducers/maplayout';

Expand Down Expand Up @@ -149,7 +150,8 @@ getEndpoints()
...resourceServiceEpics,
updateMapLayoutEpic,
// needed to initialize the correct time range
...timelineEpics
...timelineEpics,
...securityEpics
});

storeEpicsNamesToExclude(appEpics);
Expand Down
4 changes: 3 additions & 1 deletion geonode_mapstore_client/client/js/apps/gn-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { updateGeoNodeSettings } from '@js/actions/gnsettings';
import { COMPONENTS_ROUTES, appRouteComponentTypes } from '@js/utils/AppRoutesUtils';
import gnresourceEpics from '@js/epics/gnresource';
import resourceServiceEpics from '@js/epics/resourceservice';
import securityEpics from '@js/epics/security';

import gnresource from '@js/reducers/gnresource';
import resourceservice from '@js/reducers/resourceservice';
Expand Down Expand Up @@ -73,7 +74,8 @@ document.addEventListener('DOMContentLoaded', function() {
const appEpics = cleanEpics({
...configEpics,
...gnresourceEpics,
...resourceServiceEpics
...resourceServiceEpics,
...securityEpics
});

storeEpicsNamesToExclude(appEpics);
Expand Down
4 changes: 3 additions & 1 deletion geonode_mapstore_client/client/js/apps/gn-dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import ReactSwipe from 'react-swipeable-views';
import SwipeHeader from '@mapstore/framework/components/data/identify/SwipeHeader';
import { requestResourceConfig } from '@js/actions/gnresource';
import gnresourceEpics from '@js/epics/gnresource';
import securityEpics from '@js/epics/security';
const requires = {
ReactSwipe,
SwipeHeader
Expand Down Expand Up @@ -81,7 +82,8 @@ document.addEventListener('DOMContentLoaded', function() {

const appEpics = cleanEpics({
...configEpics,
...gnresourceEpics
...gnresourceEpics,
...securityEpics
});

storeEpicsNamesToExclude(appEpics);
Expand Down
4 changes: 3 additions & 1 deletion geonode_mapstore_client/client/js/apps/gn-document.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import ReactSwipe from 'react-swipeable-views';
import SwipeHeader from '@mapstore/framework/components/data/identify/SwipeHeader';
import { requestResourceConfig } from '@js/actions/gnresource';
import gnresourceEpics from '@js/epics/gnresource';
import securityEpics from '@js/epics/security';
const requires = {
ReactSwipe,
SwipeHeader
Expand Down Expand Up @@ -76,7 +77,8 @@ document.addEventListener('DOMContentLoaded', function() {

const appEpics = cleanEpics({
...configEpics,
...gnresourceEpics
...gnresourceEpics,
...securityEpics
});

storeEpicsNamesToExclude(appEpics);
Expand Down
4 changes: 3 additions & 1 deletion geonode_mapstore_client/client/js/apps/gn-geostory.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
import { updateGeoNodeSettings } from '@js/actions/gnsettings';
import { requestResourceConfig } from '@js/actions/gnresource';
import gnresourceEpics from '@js/epics/gnresource';
import securityEpics from '@js/epics/security';
import {
setupConfiguration,
initializeApp,
Expand Down Expand Up @@ -84,7 +85,8 @@ document.addEventListener('DOMContentLoaded', function() {

const appEpics = cleanEpics({
...configEpics,
...gnresourceEpics
...gnresourceEpics,
...securityEpics
});

storeEpicsNamesToExclude(appEpics);
Expand Down
4 changes: 3 additions & 1 deletion geonode_mapstore_client/client/js/apps/gn-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import {

import timelineEpics from '@mapstore/framework/epics/timeline';
import gnresourceEpics from '@js/epics/gnresource';
import securityEpics from '@js/epics/security';
import maplayout from '@mapstore/framework/reducers/maplayout';
import 'react-widgets/dist/css/react-widgets.css';
import 'react-select/dist/react-select.css';
Expand Down Expand Up @@ -130,7 +131,8 @@ document.addEventListener('DOMContentLoaded', function() {
...gnresourceEpics,
...pluginsDefinition.epics,
// needed to initialize the correct time range
...timelineEpics
...timelineEpics,
...securityEpics
});

storeEpicsNamesToExclude(appEpics);
Expand Down
Loading