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

Add UUID check for public DB methods using collectionId before making query #51

Merged
merged 1 commit into from
Feb 21, 2024
Merged

Conversation

ThorodanBrom
Copy link
Collaborator

  • If the collectionId is not a valid UUID, using UUID.fromString() in execute(Tuple.of(...)) throws an IllegalArgumentException and as a result a failed future, but the connection is not returned back to the postgres pool
  • Hence the pool gets exhausted
  • So we check if collectionId matches UUID regex before making query
  • We did not put this check in the OpenAPI spec as it would return a 400 instead of a 400, which may be non-compliant with OGC and STAC specs

… query

- If the collectionId is not a valid UUID, using `UUID.fromString()` in `execute(Tuple.of(...))`
throws an IllegalArgumentException and as a result a failed future, *but the connection is not returned back to the postgres pool*
- Hence the pool gets exhausted
- So we check if collectionId matches UUID regex before making query
- We did not put this check in the OpenAPI spec as it would return a 400 instead of a 400, which may be non-compliant with OGC and
STAC specs
@code-akki code-akki merged commit dea17ae into datakaveri:main Feb 21, 2024
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