feat(proxy): allow proxy to connect to separate compute compared to mock cplane #10178
+85
−72
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.
@a-masterov was asking for a way to test compute via proxy. This change allows for an easy way to mock the cplane api in a standalone postgres, while testing against a separate neon compute.
The following guide will be added to the proxy/README.md after some workshopping:
To setup locally, run a postgres server with the following schema:
And insert a host/port for your endpoint accordingly.
Create a certificate pair for proxy
openssl req -new -x509 -days 365 -nodes -text -out proxy.crt -keyout proxy.key -subj '/CN=*.localtest.me'
Run proxy
And connect to proxy via
psql "postgresql://${username}:${password}@${ENDPOINT}.localtest.me/dbname?sslmode=require"
Caveat, the username and password must be exactly the same in both postgres databases for this to work - in fact the salts need to be the same too which likely less useful 🙃 but it is still possible to do using
CREATE ROLE role WITH ENCRYPTED PASSWORD '...'