Skip to content

Commit 0b27c64

Browse files
Improve local development credential documentation (#402)
Co-authored-by: Maria Ines Parnisari <[email protected]>
1 parent 35eb8ce commit 0b27c64

File tree

5 files changed

+105
-147
lines changed

5 files changed

+105
-147
lines changed

app/spicedb/concepts/commands/page.mdx

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@ A database that stores and computes permissions
2727

2828
### Children commands
2929

30-
- [spicedb datastore](#reference-spicedb-datastore) - datastore operations
31-
- [spicedb lsp](#reference-spicedb-lsp) - serve language server protocol
32-
- [spicedb man](#reference-spicedb-man) - Generate man page
33-
- [spicedb serve](#reference-spicedb-serve) - serve the permissions database
34-
- [spicedb serve-testing](#reference-spicedb-serve-testing) - test server with an in-memory datastore
35-
- [spicedb version](#reference-spicedb-version) - displays the version of SpiceDB
36-
30+
- [spicedb datastore](#reference-spicedb-datastore) - datastore operations
31+
- [spicedb lsp](#reference-spicedb-lsp) - serve language server protocol
32+
- [spicedb man](#reference-spicedb-man) - Generate man page
33+
- [spicedb serve](#reference-spicedb-serve) - serve the permissions database
34+
- [spicedb serve-testing](#reference-spicedb-serve-testing) - test server with an in-memory datastore
35+
- [spicedb version](#reference-spicedb-version) - displays the version of SpiceDB
3736

3837
## Reference: `spicedb datastore`
3938

@@ -49,11 +48,10 @@ Operations against the configured datastore
4948

5049
### Children commands
5150

52-
- [spicedb datastore gc](#reference-spicedb-datastore-gc) - executes garbage collection
53-
- [spicedb datastore head](#reference-spicedb-datastore-head) - compute the head (latest) database migration revision available
54-
- [spicedb datastore migrate](#reference-spicedb-datastore-migrate) - execute datastore schema migrations
55-
- [spicedb datastore repair](#reference-spicedb-datastore-repair) - executes datastore repair
56-
51+
- [spicedb datastore gc](#reference-spicedb-datastore-gc) - executes garbage collection
52+
- [spicedb datastore head](#reference-spicedb-datastore-head) - compute the head (latest) database migration revision available
53+
- [spicedb datastore migrate](#reference-spicedb-datastore-migrate) - execute datastore schema migrations
54+
- [spicedb datastore repair](#reference-spicedb-datastore-repair) - executes datastore repair
5755

5856
## Reference: `spicedb datastore gc`
5957

@@ -148,8 +146,6 @@ spicedb datastore gc [flags]
148146
--skip-release-check if true, skips checking for new SpiceDB releases
149147
```
150148

151-
152-
153149
## Reference: `spicedb datastore head`
154150

155151
compute the head (latest) database migration revision available
@@ -181,8 +177,6 @@ spicedb datastore head [flags]
181177
--skip-release-check if true, skips checking for new SpiceDB releases
182178
```
183179

184-
185-
186180
## Reference: `spicedb datastore migrate`
187181

188182
Executes datastore schema migrations for the datastore.
@@ -222,8 +216,6 @@ spicedb datastore migrate [revision] [flags]
222216
--skip-release-check if true, skips checking for new SpiceDB releases
223217
```
224218

225-
226-
227219
## Reference: `spicedb datastore repair`
228220

229221
Executes a repair operation for the datastore
@@ -317,8 +309,6 @@ spicedb datastore repair [flags]
317309
--skip-release-check if true, skips checking for new SpiceDB releases
318310
```
319311

320-
321-
322312
## Reference: `spicedb lsp`
323313

324314
serve language server protocol
@@ -342,20 +332,17 @@ spicedb lsp [flags]
342332
--skip-release-check if true, skips checking for new SpiceDB releases
343333
```
344334

345-
346-
347335
## Reference: `spicedb man`
348336

349337
Generate a man page for SpiceDB.
350-
The output can be redirected to a file and installed to the system:
338+
The output can be redirected to a file and installed to the system:
351339

352340
```
353341
spicedb man > spicedb.1
354342
sudo mv spicedb.1 /usr/share/man/man1/
355343
sudo mandb # Update man page database
356344
```
357345

358-
359346
```
360347
spicedb man
361348
```
@@ -368,8 +355,6 @@ spicedb man
368355
--skip-release-check if true, skips checking for new SpiceDB releases
369356
```
370357

371-
372-
373358
## Reference: `spicedb serve`
374359

375360
start a SpiceDB server
@@ -558,8 +543,6 @@ spicedb serve [flags]
558543
--skip-release-check if true, skips checking for new SpiceDB releases
559544
```
560545

561-
562-
563546
## Reference: `spicedb serve-testing`
564547

565548
An in-memory spicedb server which serves completely isolated datastores per client-supplied auth token used.
@@ -621,8 +604,6 @@ spicedb serve-testing [flags]
621604
--skip-release-check if true, skips checking for new SpiceDB releases
622605
```
623606

624-
625-
626607
## Reference: `spicedb version`
627608

628609
displays the version of SpiceDB
@@ -644,6 +625,3 @@ spicedb version [flags]
644625
--log-level string verbosity of logging ("trace", "debug", "info", "warn", "error") (default "info")
645626
--skip-release-check if true, skips checking for new SpiceDB releases
646627
```
647-
648-
649-

app/spicedb/getting-started/client-libraries/page.mdx

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { Tabs } from "nextra/components";
2+
13
# Official Client Libraries
24

35
SpiceDB is primarily accessed by a [gRPC] API and thus client libraries can be generated for any programming language.
@@ -9,13 +11,55 @@ AuthZed builds and maintains gRPC client libraries for the following languages:
911
- [Python](https://github.com/authzed/authzed-py)
1012
- [Ruby](https://github.com/authzed/authzed-rb)
1113
- [Java](https://github.com/authzed/authzed-java)
12-
- [Dotnet](https://github.com/authzed/authzed-dotnet)
14+
- [.NET](https://github.com/authzed/authzed-dotnet)
1315

1416
Because the above libraries are generated from protobuf definitions in our [API repo],
1517
the primary documentation for the gRPC API is in the [buf documentation] for SpiceDB's services.
1618
The gRPC client documentation associated with each host language will also be helpful for putting together invocations.
1719
Additionally, there are `example` directories in the client libraries that provide example usages.
1820

21+
## Local Development
22+
23+
When developing locally, you'll need to configure your client based on how SpiceDB is running.
24+
25+
### SpiceDB running without TLS (most common)
26+
27+
If SpiceDB is started without TLS (using `--grpc-no-tls`), use insecure plaintext credentials:
28+
29+
<Tabs items={["Node", "Go", "Python", "Ruby", "Java", ".NET"]}>
30+
<Tabs.Tab>`v1.ClientSecurity.INSECURE_PLAINTEXT_CREDENTIALS`</Tabs.Tab>
31+
<Tabs.Tab>
32+
`grpcutil.WithInsecureBearerToken()` and
33+
`grpc.WithTransportCredentials(insecure.NewCredentials())`
34+
</Tabs.Tab>
35+
<Tabs.Tab>`insecure_bearer_token_credentials()`</Tabs.Tab>
36+
<Tabs.Tab>`credentials: :this_channel_is_insecure`</Tabs.Tab>
37+
<Tabs.Tab>`.usePlaintext()`</Tabs.Tab>
38+
<Tabs.Tab>
39+
`ChannelCredentials.Insecure` with `UnsafeUseInsecureChannelCallCredentials
40+
= true` (also requires
41+
`AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport",
42+
true)`)
43+
</Tabs.Tab>
44+
</Tabs>
45+
46+
This applies to localhost, Docker, OrbStack, and other local environments running without TLS.
47+
48+
### SpiceDB running with TLS using self-signed certificates
49+
50+
If SpiceDB is running with TLS but using a self-signed or untrusted certificate:
51+
52+
<Tabs items={['Node', 'Go']}>
53+
<Tabs.Tab>
54+
`v1.ClientSecurity.INSECURE_LOCALHOST_ALLOWED` (allows localhost connections without CA verification)
55+
</Tabs.Tab>
56+
<Tabs.Tab>
57+
Load the self-signed CA explicitly with `grpcutil.WithCustomCerts()` or use `grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{InsecureSkipVerify: true}))` for localhost only (not recommended for production)
58+
</Tabs.Tab>
59+
</Tabs>
60+
61+
See the [Protecting a Blog Application](./protecting-a-blog#checking-permissions) tutorial for examples.
62+
1963
## HTTP Clients
2064

2165
SpiceDB exposes an HTTP API when run with the `--http-enabled` flag.

0 commit comments

Comments
 (0)