Skip to content

Commit 909efa5

Browse files
committed
WiP
1 parent 14bf901 commit 909efa5

File tree

2 files changed

+94
-20
lines changed

2 files changed

+94
-20
lines changed

README.md

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,82 @@ DATABASE_PASSWORD=gizmosql_password
8888
DATABASE_TLS_SKIP_VERIFY=TRUE
8989
```
9090

91-
### Running the Docker image
92-
You can optionally run the Flight SQL WebSocket Proxy Server image:
91+
### Running the server locally
92+
You can run the Flight SQL WebSocket Proxy Server executable locally - here is the help output:
93+
```shell
94+
flight-sql-websocket-proxy-server --help
95+
Usage: flight-sql-websocket-proxy-server [OPTIONS]
96+
97+
Options:
98+
--version / --no-version Prints the Arrow Flight SQL WebSocket Proxy
99+
Server version and exits. [required]
100+
--port INTEGER Run the websocket server on this port.
101+
Defaults to environment variable SERVER_PORT
102+
if set, or 8765 if not set. [default: 8765;
103+
required]
104+
--tls ('CERTFILE', 'KEYFILE') Enable transport-level security (TLS/SSL).
105+
Provide a Certificate file path, and a Key
106+
file path - separated by a space. Defaults
107+
to environment variable TLS if set.
108+
Example: tls/server.crt tls/server.key
109+
--database-server-uri TEXT The URI of the Arrow Flight SQL server.
110+
Defaults to environment variable
111+
DATABASE_SERVER_URI if set, or
112+
grpc+tls://localhost:31337 if not set.
113+
[required]
114+
--database-username TEXT The username to authenticate with the Arrow
115+
Flight SQL server. Defaults to environment
116+
variable DATABASE_USERNAME if set.
117+
[required]
118+
--database-password TEXT The password to authenticate with the Arrow
119+
Flight SQL server. Defaults to environment
120+
variable DATABASE_PASSWORD if set.
121+
[required]
122+
--database-tls-skip-verify / --no-database-tls-skip-verify
123+
Skip TLS verification of the Arrow Flight
124+
SQL server. Defaults to environment
125+
variable DATABASE_TLS_SKIP_VERIFY if set, or
126+
FALSE if not set. [default: database-tls-
127+
skip-verify; required]
128+
--clerk-api-url TEXT The CLERK API URL - for user authentication.
129+
Defaults to environment variable
130+
CLERK_API_URL if set, or
131+
https://api.clerk.dev if not set.
132+
[required]
133+
--clerk-secret-key TEXT The CLERK Secret Key - for user
134+
authentication. Defaults to environment
135+
variable CLERK_SECRET_KEY if set.
136+
[required]
137+
--jwks-url TEXT The JWKS URL used for client session JWT
138+
token validation - for user authentication.
139+
Defaults to environment variable JWKS_URL if
140+
set. Example: https://wise-
141+
cattle-777.clerk.accounts.dev/.well-
142+
known/jwks.json [required]
143+
--session-token-issuer TEXT The issuer used for client session JWT token
144+
validation - for user authentication.
145+
Defaults to environment variable
146+
SESSION_TOKEN_ISSUER if set. Example:
147+
https://wise-cattle-777.clerk.accounts.dev
148+
[required]
149+
--max-process-workers INTEGER Max process workers. Defaults to
150+
environment variable MAX_PROCESS_WORKERS if
151+
set. [default: 10; required]
152+
--websocket-ping-timeout INTEGER
153+
Web-socket ping timeout. Defaults to
154+
environment variable PING_TIMEOUT if set.
155+
[default: 60; required]
156+
--max-websocket-message-size INTEGER
157+
Maximum Websocket message size [default:
158+
1073741824; required]
159+
--client-default-fetch-size INTEGER
160+
The default websocket client fetch size for
161+
queries. [default: 50; required]
162+
--help Show this message and exit.
163+
```
164+
165+
### Running the server via Docker
166+
You can optionally run the Flight SQL WebSocket Proxy Server via Docker:
93167
94168
**Note** - this assumes that you have your Github Access Token stored as an env var named `{GITHUB_ACCESS_TOKEN}`. See: [Creating a personal access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) for more information.
95169

src/flight_sql_websocket_proxy/server.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,95 +29,95 @@
2929
default=os.getenv("SERVER_PORT", SERVER_PORT),
3030
show_default=True,
3131
required=True,
32-
help="Run the websocket server on this port."
32+
help=f"Run the websocket server on this port. Defaults to environment variable SERVER_PORT if set, or {SERVER_PORT} if not set."
3333
)
3434
@click.option(
3535
"--tls",
3636
nargs=2,
3737
default=os.getenv("TLS").split(" ") if os.getenv("TLS") else None,
3838
required=False,
3939
metavar=('CERTFILE', 'KEYFILE'),
40-
help="Enable transport-level security (TLS/SSL). Provide a Certificate file path, and a Key file path - separated by a space. Example: tls/server.crt tls/server.key"
40+
help="Enable transport-level security (TLS/SSL). Provide a Certificate file path, and a Key file path - separated by a space. Defaults to environment variable TLS if set. Example: tls/server.crt tls/server.key"
4141
)
4242
@click.option(
4343
"--database-server-uri",
4444
type=str,
4545
default=os.getenv("DATABASE_SERVER_URI", "grpc+tls://localhost:31337"),
46-
show_default=True,
46+
show_default=False,
4747
required=True,
48-
help="The URI of the Arrow Flight SQL server."
48+
help="The URI of the Arrow Flight SQL server. Defaults to environment variable DATABASE_SERVER_URI if set, or grpc+tls://localhost:31337 if not set."
4949
)
5050
@click.option(
5151
"--database-username",
5252
type=str,
5353
default=os.getenv("DATABASE_USERNAME", "gizmosql_username"),
54-
show_default=True,
54+
show_default=False,
5555
required=True,
56-
help="The username to authenticate with the Arrow Flight SQL server."
56+
help="The username to authenticate with the Arrow Flight SQL server. Defaults to environment variable DATABASE_USERNAME if set."
5757
)
5858
@click.option(
5959
"--database-password",
6060
type=str,
6161
default=os.getenv("DATABASE_PASSWORD"),
6262
show_default=False,
6363
required=True,
64-
help="The password to authenticate with the Arrow Flight SQL server."
64+
help="The password to authenticate with the Arrow Flight SQL server. Defaults to environment variable DATABASE_PASSWORD if set."
6565
)
6666
@click.option(
6767
"--database-tls-skip-verify/--no-database-tls-skip-verify",
6868
type=bool,
69-
default=(os.getenv("DATABASE_TLS_SKIP_VERIFY").upper() == "TRUE"),
69+
default=(os.getenv("DATABASE_TLS_SKIP_VERIFY", "FALSE").upper() == "TRUE"),
7070
show_default=True,
7171
required=True,
72-
help="Skip TLS verification of the Arrow Flight SQL server."
72+
help="Skip TLS verification of the Arrow Flight SQL server. Defaults to environment variable DATABASE_TLS_SKIP_VERIFY if set, or FALSE if not set."
7373
)
7474
@click.option(
7575
"--clerk-api-url",
7676
type=str,
7777
default=os.getenv("CLERK_API_URL", "https://api.clerk.dev"),
78-
show_default=True,
78+
show_default=False,
7979
required=True,
80-
help="The CLERK API URL - for user authentication."
80+
help="The CLERK API URL - for user authentication. Defaults to environment variable CLERK_API_URL if set, or https://api.clerk.dev if not set."
8181
)
8282
@click.option(
8383
"--clerk-secret-key",
8484
type=str,
8585
default=os.getenv("CLERK_SECRET_KEY"),
8686
show_default=False,
8787
required=True,
88-
help="The CLERK Secret Key - for user authentication."
88+
help="The CLERK Secret Key - for user authentication. Defaults to environment variable CLERK_SECRET_KEY if set."
8989
)
9090
@click.option(
9191
"--jwks-url",
9292
type=str,
9393
default=os.getenv("JWKS_URL"),
94-
show_default=True,
94+
show_default=False,
9595
required=True,
96-
help="The JWKS URL used for client session JWT token validation - for user authentication."
96+
help="The JWKS URL used for client session JWT token validation - for user authentication. Defaults to environment variable JWKS_URL if set. Example: https://wise-cattle-777.clerk.accounts.dev/.well-known/jwks.json"
9797
)
9898
@click.option(
9999
"--session-token-issuer",
100100
type=str,
101101
default=os.getenv("SESSION_TOKEN_ISSUER"),
102-
show_default=True,
102+
show_default=False,
103103
required=True,
104-
help="The issuer used for client session JWT token validation - for user authentication."
104+
help="The issuer used for client session JWT token validation - for user authentication. Defaults to environment variable SESSION_TOKEN_ISSUER if set. Example: https://wise-cattle-777.clerk.accounts.dev"
105105
)
106106
@click.option(
107107
"--max-process-workers",
108108
type=int,
109109
default=os.getenv("MAX_PROCESS_WORKERS", get_cpu_count()),
110110
show_default=True,
111111
required=True,
112-
help="Max process workers"
112+
help="Max process workers. Defaults to environment variable MAX_PROCESS_WORKERS if set."
113113
)
114114
@click.option(
115115
"--websocket-ping-timeout",
116116
type=int,
117117
default=os.getenv("PING_TIMEOUT", 60),
118118
show_default=True,
119119
required=True,
120-
help="Web-socket ping timeout"
120+
help="Web-socket ping timeout. Defaults to environment variable PING_TIMEOUT if set."
121121
)
122122
@click.option(
123123
"--max-websocket-message-size",

0 commit comments

Comments
 (0)