diff --git a/CHANGELOG.md b/CHANGELOG.md index 68e0cb309..4d50ff09c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,8 @@ - [#765](https://github.com/LayerManager/layman/issues/765) Remove `authn.txt` files from workspace directories. The same information as in `authn.txt` files is saved in prime DB schema. - [#868](https://github.com/LayerManager/layman/issues/868) Fill table `map_layer` with relations between maps and [internal layers](doc/models.md#internal-map-layer) (layers published on this Layman instance). Relations to [external layers](doc/models.md#internal-map-layer) (layers of other servers) are not imported into the table. ### Changes -- [#868](https://github.com/LayerManager/layman/issues/868) Endpoints [GET Publications](doc/rest.md#get-publications), [GET Layers](doc/rest.md#get-layers), [GET Workspace Layers](doc/rest.md#get-workspace-layers), [GET Maps](doc/rest.md#get-maps), [GET Workspace Maps](doc/rest.md#get-workspace-maps), [GET Workspace Layer](doc/rest.md#get-workspace-layer), [GET Workspace Map](doc/rest.md#get-workspace-map), [POST Workspace Layers](doc/rest.md#post-workspace-layers), [DELETE Workspace Layer](doc/rest.md#delete-workspace-layer), [DELETE Workspace Layers](doc/rest.md#delete-workspace-layers), [DELETE Workspace Map](doc/rest.md#delete-workspace-map), [DELETE Workspace Maps](doc/rest.md#delete-workspace-maps), [POST Workspace Maps](doc/rest.md#post-workspace-maps), [PATCH Workspace Layer](doc/rest.md#patch-workspace-layer), [PATCH Workspace Map](doc/rest.md#patch-workspace-map) and [WMS/WFS endpoints](doc/endpoints.md) respects [HTTP header `X-Forwarded-Prefix`](doc/client-proxy.md#x-forwarded-prefix-http-header) of the request in the response. Header does not affect response of [GET Workspace Layer Metadata Comparison](doc/rest.md#get-workspace-layer-metadata-comparison). +- [#868](https://github.com/LayerManager/layman/issues/868) Endpoints [GET Publications](doc/rest.md#get-publications), [GET Layers](doc/rest.md#get-layers), [GET Workspace Layers](doc/rest.md#get-workspace-layers), [GET Maps](doc/rest.md#get-maps), [GET Workspace Maps](doc/rest.md#get-workspace-maps), [GET Workspace Layer](doc/rest.md#get-workspace-layer), [GET Workspace Map](doc/rest.md#get-workspace-map), [POST Workspace Layers](doc/rest.md#post-workspace-layers), [DELETE Workspace Layer](doc/rest.md#delete-workspace-layer), [DELETE Workspace Layers](doc/rest.md#delete-workspace-layers), [DELETE Workspace Map](doc/rest.md#delete-workspace-map), [DELETE Workspace Maps](doc/rest.md#delete-workspace-maps), [POST Workspace Maps](doc/rest.md#post-workspace-maps), [PATCH Workspace Layer](doc/rest.md#patch-workspace-layer), [PATCH Workspace Map](doc/rest.md#patch-workspace-map) and [WMS/WFS endpoints](doc/endpoints.md) respects [HTTP header `X-Forwarded-Prefix`](doc/client-proxy.md#x-forwarded-prefix-http-header) of the request in the response. + - Header does not affect responses of [GET Workspace Layer Metadata Comparison](doc/rest.md#get-workspace-layer-metadata-comparison) and [GET Workspace Map Metadata Comparison](doc/rest.md#get-workspace-map-metadata-comparison). - [#868](https://github.com/LayerManager/layman/issues/868) Relations between map and [internal layers](doc/models.md#internal-map-layer) are updated in `map_layer` table when calling [POST Workspace Maps](doc/rest.md#post-workspace-maps), [PATCH Workspace Map](doc/rest.md#patch-workspace-map), [DELETE Workspace Map](doc/rest.md#delete-workspace-map), and [DELETE Workspace Maps](doc/rest.md#delete-workspace-maps). - [#880](https://github.com/LayerManager/layman/issues/880) Use Docker Compose v2 (`docker compose`) in Makefile without `compatibility` flag and remove `Makefile_docker-compose_v1` file. Docker containers are named according to Docker Compose v2 and may have different name after upgrade. - [#765](https://github.com/LayerManager/layman/issues/765) Stop saving OAuth2 claims in filesystem, use prime DB schema only. diff --git a/doc/client-proxy.md b/doc/client-proxy.md index f28339646..a91579ac3 100644 --- a/doc/client-proxy.md +++ b/doc/client-proxy.md @@ -95,4 +95,4 @@ Currently, value of `X-Forwarded-Prefix` affects following URLs: * [WFS endpoints](endpoints.md#web-feature-service) * all operations URLs -Value of `X-Forwarded-Prefix` does not affects response values of [GET Workspace Layer Metadata Comparison](rest.md#get-workspace-layer-metadata-comparison). +Value of `X-Forwarded-Prefix` does not affects response values of [GET Workspace Layer Metadata Comparison](rest.md#get-workspace-layer-metadata-comparison) and [GET Workspace Map Metadata Comparison](rest.md#get-workspace-map-metadata-comparison). diff --git a/tests/asserts/final/publication/metadata.py b/tests/asserts/final/publication/metadata.py index a14164e03..e23309a9b 100644 --- a/tests/asserts/final/publication/metadata.py +++ b/tests/asserts/final/publication/metadata.py @@ -83,20 +83,22 @@ def correct_values_in_metadata(workspace, publ_type, name, http_method, *, exp_v expected_values_in_micka_metadata(workspace, publ_type, name, exp_metadata) -def correct_layer_comparison_response_with_x_forwarded_prefix_header(workspace, name, *, actor_name=None, headers=None): +def correct_layer_comparison_response_with_x_forwarded_prefix_header(workspace, publ_type, name, *, actor_name=None, headers=None): proxy_prefix = '/layman-proxy' headers = headers or {} actor_name = actor_name or settings.ANONYM_USER - md_props = LAYER_METADATA_PROPERTIES + md_props = { + process_client.LAYER_TYPE: LAYER_METADATA_PROPERTIES, + process_client.MAP_TYPE: MAP_METADATA_PROPERTIES, + }[publ_type] headers_with_header = {**headers, 'X-Forwarded-Prefix': proxy_prefix, } with app.app_context(): - resp_json_with_proxy = process_client.get_workspace_publication_metadata_comparison(process_client.LAYER_TYPE, workspace, name, + resp_json_with_proxy = process_client.get_workspace_publication_metadata_comparison(publ_type, workspace, name, actor_name=actor_name, headers=headers_with_header) - resp_json_without_proxy = process_client.get_workspace_publication_metadata_comparison(process_client.LAYER_TYPE, workspace, - name, + resp_json_without_proxy = process_client.get_workspace_publication_metadata_comparison(publ_type, workspace, name, actor_name=actor_name, headers=headers) assert md_props.issubset(set(resp_json_with_proxy['metadata_properties'].keys())) diff --git a/tests/dynamic_data/publications/layer_by_used_servers/layer_by_used_servers_test.py b/tests/dynamic_data/publications/layer_by_used_servers/layer_by_used_servers_test.py index 931cdf659..3e45a3f25 100644 --- a/tests/dynamic_data/publications/layer_by_used_servers/layer_by_used_servers_test.py +++ b/tests/dynamic_data/publications/layer_by_used_servers/layer_by_used_servers_test.py @@ -78,4 +78,4 @@ def test_layer(layer, params, rest_args, rest_method, parametrization): asserts_publ.geoserver_proxy.is_complete_in_workspace_wms(layer.workspace, layer.type, layer.name, version='1.1.1') asserts_publ.geoserver_proxy.wms_legend_url_with_x_forwarded_prefix(layer.workspace, layer.type, layer.name, ) - asserts_publ.metadata.correct_layer_comparison_response_with_x_forwarded_prefix_header(layer.workspace, layer.name, ) + asserts_publ.metadata.correct_layer_comparison_response_with_x_forwarded_prefix_header(layer.workspace, layer.type, layer.name, ) diff --git a/tests/dynamic_data/publications/map_layer_relation/map_layer_relation_test.py b/tests/dynamic_data/publications/map_layer_relation/map_layer_relation_test.py index 849df9aef..c194f6ae5 100644 --- a/tests/dynamic_data/publications/map_layer_relation/map_layer_relation_test.py +++ b/tests/dynamic_data/publications/map_layer_relation/map_layer_relation_test.py @@ -207,6 +207,7 @@ def test_publication(self, map, rest_method, rest_args, params): rest_method.fn(map, args=rest_args) if rest_method.enum_item in [base_test_classes.RestMethodAll.POST, base_test_classes.RestMethodAll.PATCH]: assert_util.is_publication_valid_and_complete(map) + asserts_publ.metadata.correct_layer_comparison_response_with_x_forwarded_prefix_header(map.workspace, map.type, map.name, ) exp = params['exp_after_rest_method'] http_method = REQUEST_METHOD_PATCH if rest_method.enum_item == base_test_classes.RestMethodAll.PATCH else REQUEST_METHOD_POST