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

Remove fuzzy matching of malformed LIDVIDS #242

Open
alexdunnjpl opened this issue Jan 31, 2023 · 1 comment
Open

Remove fuzzy matching of malformed LIDVIDS #242

alexdunnjpl opened this issue Jan 31, 2023 · 1 comment
Assignees
Labels
bug Something isn't working open.v1.3.1 open.1.5.0 p.should-have s.medium Medium level severity

Comments

@alexdunnjpl
Copy link
Contributor

alexdunnjpl commented Jan 31, 2023

Checked for duplicates

Yes - I've already checked

🐛 Describe the bug

Currently, registry-api will resolve some:product::, some:product::1 and some:product::1. to the latest LIDVID for LID some:product.

This is undesirable and support should be removed.

🕵️ Expected behavior

I expect malformed LIDVIDs to throw a 404 in all cases

📜 To Reproduce

1. Spin up registry profile `int-registry-batch-loader`
2. `curl --get 'http://localhost:8080/collections/urn:nasa:pds:insight_rad:data_derived::' | json_pp`
3. Observe successful return of v7.0 for that product

🖥 Environment Info

- Version of this software [e.g. vX.Y.Z]
- Operating System: [e.g. MacOSX with Docker Desktop vX.Y]
...

📚 Version of Software Used

No response

🩺 Test Data / Additional context

No response

🦄 Related requirements

🦄 #xyz

⚙️ Engineering Details

The key here is to remove the fuzzy-matching from PdsProductIdentifier.fromString() - if the argument contains a LID/VID separator and cannot be parsed to a valid LIDVID, it should throw a parsing error rather than falling back to extracting the LID and returning a PdsLid

@alexdunnjpl
Copy link
Contributor Author

alexdunnjpl commented Feb 16, 2023

Will require adjustment of swagger documentation - currently shows:

syntax: lidvid or lid behavior (lid): returns one or more items whose lid matches this lid exactly. If the endpoint ends with the identifier or /latest then a signle result is returned and it is the highest version. If the endpoint ends with /all then all versions of the lid are returned. behavior (lidvid): returns one and only one item whose lidvid matches this lidvid exactly. note: the current lid/lidvid resolution will match all the lids that start with lid. In other words, it acts like a glob of foobar*. It behavesn this way from first character to the last note: simple sorting of the lidvid is being done to select the latest from the end of the list. However, the versions 1.0, 2.0, and 13.0 will sort to 1.0, 13.0, and 2.0 so the end of the list may not be the latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working open.v1.3.1 open.1.5.0 p.should-have s.medium Medium level severity
Projects
Status: ToDo
Status: Release Backlog
Development

No branches or pull requests

4 participants