feat: CQL2 filtering via STAC Auth Proxy #144
Open
+215
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR builds out CQL2 filters for usage by the STAC Auth Proxy when handling requests for STAC Collections or STAC Items.
The logic is currently written as follows:
privateattribute or withprivate: falseand collections that are referenced by ID within thecollectionsclaim of their JWT access token. These users will be able to view items from collections following this same logic. For the items endpoints, we cache the IDs of the public collections for 30 seconds.superuserclaim (update: with a value of"true") in their JWT access token will be able to view all collections and items.Note that we pay no attention to the value of thesuperuserclaim, we only care that something is set on the JWT under that claim.These filters are written in
applications/argocd/staging/applications/montandon-eoapi/stac-auth-proxy/montandon_filters.pyand mounted to/app/src/stac_auth_proxy/montandon_filters.pywithin the STAC Auth Proxy container, allowing them to be referenced as theCOLLECTIONS_FILTER_CLS=stac_auth_proxy.montandon_filters:CollectionsFilter1 andITEMS_FILTER_CLS=stac_auth_proxy.montandon_filters:ItemsFilter2 within the runtime.Footnotes
https://developmentseed.org/stac-auth-proxy/user-guide/configuration/#collections_filter_cls ↩
https://developmentseed.org/stac-auth-proxy/user-guide/configuration/#items_filter_cls ↩