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

How to disable the Transaction extension in the pgstac app? #492

Closed
jtherrmann opened this issue Nov 14, 2022 · 4 comments
Closed

How to disable the Transaction extension in the pgstac app? #492

jtherrmann opened this issue Nov 14, 2022 · 4 comments
Labels
question Further information is requested

Comments

@jtherrmann
Copy link
Contributor

We're currently using the pgstac app provided here, but we'd like to disable the Transaction extension. We're reluctant to do all of the configuration of the app from scratch. Is there a way to simply disable the extension in the app after it's already been created?

@gadomski gadomski added the question Further information is requested label Nov 14, 2022
@geospatial-jeff
Copy link
Collaborator

Hello @jtherrmann the only way of doing this currently is to configure the app from scratch, the library is designed to do this and we encourage users to configure their own instead of relying on the existing applications (they are really just examples).

That being said we could introduce an environment variable to the pgstac backend which optionally enables or disables the transactions extension, allowing the user to set this at deploy time. This seems reasonable to me.

@jtherrmann
Copy link
Contributor Author

Thanks for the reply @geospatial-jeff. We like the idea of using an environment variable, so I may open a PR to make that change, if that's alright?

@jtherrmann
Copy link
Contributor Author

jtherrmann commented Nov 16, 2022

@geospatial-jeff Were you suggesting to introduce an environment variable to enable/disable the Transaction extension just for the example app provided here, or were you intending for the environment variable to affect any app that uses the pgstac backend? The former should be easy to implement, but I'm not familiar enough with the codebase to implement the latter.

Just to clarify, we would actually like to prevent the Transaction extension from being added to the list of extensions, not simply to prevent those endpoints from working (because we would like those endpoints not to appear in the Swagger UI at all).

So it should be simple to check the value of the environment variable and add the Transaction extension to the list here depending on its value.

@jtherrmann
Copy link
Contributor Author

I opened #495 just to demonstrate the approach I was thinking of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants