Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enforce WMS layer limit #7466

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sidneygijzen
Copy link
Contributor

What this PR does

This PR proposes an approach for implementing the WMS layer limit. One of the goals is trying to mitigate the resource-intensive requests - as reported in #6866 and #7320 - by enabling a WMS server administrator to make use of the WMS layer limit.

My initial thought was to modify the WebMapServiceCatalogItem validLayers getter, but during manual testing the styles URL param went awry. From what I can tell it is because the WebMapServiceCatalogItem layersArray is used in the WebMapServiceCapabilitiesStratum legends getter. Therefore I chose to check for a layer limit in the layersArray.

A note on the modified XML test files; during the implementation a couple of unrelated tests errored out. A small number of xml files contained a <LayerLimit>1</LayerLimit>. I have opted to remove the <LayerLimit>1</LayerLimit> elements from the XML file instead of adjusting the tests.

Finally, I am not sure if it fully addresses #5267, because I haven't looked at the MagdaReference model.

Test me

Aside from the added unit test, I tested this manually by configuring a wms-group as a wms. Please see this gist for a test config. With this "wrong" config I try to simulate what is happening in #7320, which is that the CswCatalogGroup currently has no knowledge of the concept of a WMS-group. The WMS below has a WMS layer limit defined, so only one wms layer is requested in this case.

Checklist

  • There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)
    - [ ] I've updated relevant documentation in doc/.
  • I've updated CHANGES.md with what I changed.
  • I've provided instructions in the PR description on how to test this PR.

@sidneygijzen
Copy link
Contributor Author

@pjonsson Thanks for the review! I've updated the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants