Commit acf1bfd
authored
gocached: support namespaces (#34)
Remove the special-case concept of "global writes" and instead allow
callers to provide a namespace mapping function that makes policy
decisions about which clients are globally trusted and which clients
should be isolated from each other. As a result, all clients are now
able to write, but not necessarily into the shared global namespace. All
clients can still read from the global namespace, as well as their own.
The Namespaces table already existed in the schema, but we drop the
lowercase constraint.
However, there are some breaking changes in the package API, WithJWTAuth
now takes issuer URLs only and policy moves into the new
WithNamespaceMapping option. cmd/gocached implements the spirit of the
old API in terms of a namespace mapping function, with the main
difference that it now allows writes if you don't have the global
claims, but just into your own isolated namespace.
Updates tailscale/corp#38092
Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>1 parent d48e363 commit acf1bfd
3 files changed
Lines changed: 434 additions & 249 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
77 | 76 | | |
78 | 77 | | |
79 | 78 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
89 | 100 | | |
90 | 101 | | |
91 | 102 | | |
| |||
0 commit comments