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

Need a new way to declare behaviour and modification of API from extensions #178

Open
rsmith013 opened this issue Jul 5, 2021 · 0 comments

Comments

@rsmith013
Copy link

While writing code to add the filters extension it became clear that it was difficult for downstream applications to dynamically register the extensions they implement and for this to modify the response without also needing to update the implementation.

There are 3 things that extensions do in the call/response flow:

  1. Add an additional, stand-alone endpoint
  2. Modify the response from an existing endpoint
  3. Modify the queryset behind the response on an existing endpoint

The current framework works well with additional, stand-alone modifications. The other two rely on adding:

if self.extension_is_enabled(<ExtensionClass>):
     # Do something

constructs from within the "Core" client.

It would be nice if extensions define the logic and perhaps some base implementation or abstract implementation for the additions and modifications to the basic STAC API implementation.

Of course, depending on the extension, some implementation-specific code would need to be written to define the interaction between the extension and the database but it would be good to be able to keep this out of the core.

I will continue to have a think about how this might be accomplished and will make a PR if I come up with anything, but as this will be significant work, it would be good to get some feedback. Or if someone else wants to make a start... 😉

Would also impact #175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants