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

[Feature] Allow metadata_type.prefixes and data_type.prefixes in ServiceTHREDDS configuration to contain / character #633

Open
mishaschwartz opened this issue Nov 22, 2024 · 0 comments
Assignees
Labels
feature New feature to be developed

Comments

@mishaschwartz
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

THREDDS can have service paths that include subpaths (ex: /ncss/grid and ncss/point). We should be able to define a configuration file for the Magpie THREDDS service like so:

...
data_type:
  prefixes:
    ...
    - ncss
    - ncss/grid
    - ncss/point
...

So that part of the URL path that defines the service can be treated as a prefix.

Currently, we cannot include / in prefix values because Magpie splits the URL path on / characters.

The current workaround is to just include the top-most path part as the prefix and apply permissions to the rest of the path parts as if they were directories. However, this means that we need to define permissions multiple times for the same resource.
For example:

  • Right now we have URL paths like:

    • ${FQDN}/twitcher/ows/proxy/thredds/ncss/datasets/...
    • ${FQDN}/twitcher/ows/proxy/thredds/dodsC/datasets/...

    So if we want to set specific permissions on the datasets/ directory we can do that by setting one directory permission rule on the datasets/ subdirectory and it will work for all services.

    But if we instead have:

    • ${FQDN}/twitcher/ows/proxy/thredds/ncss/point/datasets/...
    • ${FQDN}/twitcher/ows/proxy/thredds/dodsC/datasets/...

    Then we would need to set the same permission rule on datasets/ as well as point/datasets/. If we don't set the same rule on point/datasets/ then the rule won't apply to resources accessed by the ncss/point service.

Describe the solution you'd like

Parse the prefix values differently so that values that include / can be matched. I suggest that permission_requested function should detect that a prefix includes a / and applies multiple matches to each path part in order.

Additional context

See initial discussion of this issue here: bird-house/birdhouse-deploy#413 (comment)

@mishaschwartz mishaschwartz added the feature New feature to be developed label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature to be developed
Projects
None yet
Development

No branches or pull requests

2 participants