-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implement combined Geoserver service and Workspace/Layer effective permissions #495
Conversation
…ssions are applicable
… one during creation from UI
…ssions offered by standards/implementations
… check + auto-switch to incoming page current service type for convenience
…ervice implementations + fix access of ServiceGeoserverWMS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got some quick fixes, but overall this is a good PR.
@f-PLT, since I only did a static review, you should validate the implementation with a live geoserver instance so that it fits correctly our use cases before approving.
Thank you!
…e mapping representation
… API, THREDDS, Access + update res-type structure schema
Tested with the public urls on a test instance and everything works very well and as expected with workspaces and layers. I did find a small problem with WFS request parameters: We'll have to account for this either by allowing/filtering for both, whatever the WFS version request, or filter by WFS version. However, Geoserver doesn't seem to care and will accept both for a request using version 2.0.0, which leads to the following security bypass: Using the following configuration should give access to the workspace
|
Self-notes of things to adjust following feedback and discussions :
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got some questions along the road, but it looks really good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! Do you think that at some point magpie/services.py
could be split? It starts to contains a lot of stuff.
Could be but I don't see any advantage other than to reduce how long the file is. |
@f-PLT |
Looking at the screenshot posted by @f-PLT, it looks like the permissions don't line up properly with the comboboxes. Is it because of total number of permissions or because some of them seem to explose the allowed width (horizontal comboboxes)? |
Already has been made an issue by @fmigneault : #498 |
Summary
First implementation that resolves most common use cases.
Since the changes are already substantial, start with this version that DOES NOT support multiple
layers=<layer1>,<layer2>
resources.A subsequent PR can attempt resolution of combined resources and return only
Allow
if all resources are accessible.That will involve modifying the (complicated)
effective_permissions
method.Features / Changes
ServiceWFS
permissions according to OGC WFS standard.DescribeLayer
permission toServiceGeoserverWMS
according to GeoServer WMS implementation.Resource
typeLayer
nested underWorkspace
forServiceGeoserverWMS
.Resource
typeLayer
underServiceWFS
.Resource
andService
name to contain colon (:
) character in order to define scoped names as it is often the case forLayer
names.child_structure_allowed
attribute toService
implementations allowing them to define specific path-like structures of allowedResource
types hierarchies in order to control at which level and which combinations of nestedResource
types are valid under their rootService
. When not defined under aService
implementation, any definedResource
type will remain available for creation at any level of the hierarchy, unless the correspondingResource
in the tree already definedchild_resource_allowed = False
. This was already the original behaviour in previous versions.GET /resources/{id}/types
endpoint that allows retrieval of applicable childrenResource
types under a givenResource
considering the nested hierarchy definition of its rootService
defined by the new attributechild_structure_allowed
.child_structure_allowed
attribute to the response ofGET /service/{name}
endpoint.For backward compatibility,
resource_types_allowed
parameter already available in the same response will continue to report all possibleResource
types at any level under theService
hierarchy, although not necessarily applicable as immediate childResource
under thatService
.configurable
attribute toService
types that supports custom definitions modifying their behaviour.service_configurable
to response ofGET /service/{name}
endpoint.child_structure_allowed
definitions to propose only applicableResource
types in the combobox when creating a newResource
in the tree hierarchy.Service
JSON configuration at creation when supported by the type.Bug Fixes
params_expected
parameter fromService
implementations (ServiceAccess
,ServiceAPI
,ServiceTHREDDS
) that don't make use of it since they don't derive fromServiceOWS
.Permission
definitions for all variants ofWMS
according to their reference implementations.Service
configuration for any type that supports it. Unless overridden during creation with a custom configuration,ServiceTHREDDS
implementation would not report their default configuration and would instead returnnull
, making it difficult to know from the API if default or no configuration was being applied for a givenService
.Effective Resolution
ofPermission
applied forServiceGeoserverWMS
to considerScope
modifier ofService
andWorkspace
for access to be resolved at theLayer
level.