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

Config credentials Documentation #722

Open
MarkusGnigler opened this issue Mar 10, 2025 · 0 comments
Open

Config credentials Documentation #722

MarkusGnigler opened this issue Mar 10, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@MarkusGnigler
Copy link

MarkusGnigler commented Mar 10, 2025

I have a setup with only the postgres fdw and need to provide the credentials via json based config because the app/credentials-provider and the fdw run in 2 separate containers with no file exchange.

It always fails on some formatting issues. Is it possible to add some form of extended documentation of the json parsing from #318?

What is the correct hcl for json based credentials?

hcl

#with semicolons
config = """
"credentials="{...}"
"""

#without semicolons
config = """
"credentials={...}
"""

Error is:

FdwError: failed to process options: failed to parse connection config for connection 'public': Extraneous data after value: Extra characters appear after
the JSON value.
Root value must be object: The root value in a JSON-based configuration must be either a JSON object or a JSON array of objects.

json

#with semicolons
config = """{
"credentials":"{...}"
}
#without semicolons
"""
config = """{
"credentials":{...}
}
"""

Error is:

FdwError: failed to process options: failed to parse connection config for connection 'public': Missing attribute seperator comma: A comma must appear 
between each property definition in an object.
Root value must be object: The root value in a JSON-based configuration must be either a JSON object or a JSON array of objects.

How should the json object itself be formatted?

#with escape
config = """
credentials={\n\t"key":"multi\nrow"}
"""
#without escape
"""
config = """
credentials={\\n\\t"key":"multi\\nrow"}
"""
@MarkusGnigler MarkusGnigler added the bug Something isn't working label Mar 10, 2025
@MarkusGnigler MarkusGnigler changed the title Config credentials formatting Config credentials Documentation Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant