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

Support URL config value #11

Closed
steve-chavez opened this issue Apr 27, 2020 · 3 comments
Closed

Support URL config value #11

steve-chavez opened this issue Apr 27, 2020 · 3 comments

Comments

@steve-chavez
Copy link
Member

Hey there.

Adding support for getting a config value from a URL would allow us to close PostgREST/postgrest#1130 and PostgREST/postgrest#1292.

This would be similar to what dhall does: https://docs.dhall-lang.org/tutorials/Language-Tour.html?highlight=url#url-imports. I was thinking that maybe the {http/https}:// prefix could be inferred to be an HTTP value.

db-schema = "test"
jwks = https://domain.co/jwk ## without quotes

What do you think?

@steve-chavez
Copy link
Member Author

Oh, I forgot about the import directive. So maybe it could be like this instead:

db-schema = "test"
jwks = import https://domain.co/jwk

@robx
Copy link
Collaborator

robx commented Apr 27, 2020

I don't really think this is a good idea, on several different levels...

  1. There's my general feeling that this package is a bit of a poorly designed mess that I don't want to do feature development for. (The recent parsing error change was different in the sense that it made the package do what it does slightly less badly.)

  2. I'm not really sure something like this belongs in a configuration file format. If this is really needed for postgrest, I'd prefer an approach where

    • postgrest would handle the http request itself
    • the API of this package would be adapted as necessary to make it easy to integrate that

    As a related approach, I could expose the low-level parser (Data.Configurator.Syntax), and we could move the interpretation layer over into postgrest itself. Then interpretation of the import directive would be up to postgrest, and this feature could be developed there. If you 'd like this, I'd be happy to make that change.

  3. Would this even address the issue? As far as I understand, the potential users are serving a JSON file somewhere which they'd like integrated into their config, but configurator-pg would expect a file in its own format.

@steve-chavez
Copy link
Member Author

There's my general feeling that this package is a bit of a poorly designed mess that I don't want to do feature development for.

Totally understand. No change needed from configurator-pg.

I think now this should be handled in postgrest. Similarly to what we do for an option = @filename config value.(I somehow thought this was handled in configurator-pg, sorry about that).

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

No branches or pull requests

2 participants