Repository navigation
Commit df030d0
feat: add capabilities and scoped tokens
policy.toml now says who may do what: [[paths]] rules give each user,
node or group none, read or write under a path, and [grants] the
annotate, land and admin capabilities. Only admin lands on `policy`, so
no one grants themselves rights. Servers authenticate bearer tokens:
static ones from their configuration, or short-lived scoped ones they
sign with their node key and verify without storing, which only narrow
their principal's rights (`origin token issue`). A token lasts at most
7 days, and one issued with a token expires with it.
OriginService filters what each caller reads: a caller who reads no path
sees nothing of the repository, snapshot walks withhold the content of
unreadable paths, and revisions that only change such paths are hidden
with their statements and events. Writes are checked: records put must
be the caller's, statements must be about what they see and of a kind
they annotate, promotions included, revisions may only change paths they
write and only hold content they supplied or that a snapshot they refer
to holds at the same path, and landings may only change what the
submitter writes, whatever they land. Where a writer may not write, a
successor must have exactly each predecessor's effect: the same files
changed from the same entries to the same ones, on the same change below,
with exactly the same conflicts unresolved; a root lists only those of
the revision it's on. So anyone may take a change over and hand it on,
but no base, chain of revisions or other change makes it revert, replace
or resolve what they can't write, or add a conflict there. Only a new change gets
a root, and revisions evolve only from their own change's, so no one
becomes a change's creator, who abandons it, by adding one. Reserved kinds come only from
those core names, whoever puts them. A batch is read before the store,
so it may hold a stack. Promotions only copy results from records the
caller sees. Descriptions and payloads become attachments, an object kind
of their own, so no record can carry a file's content. Snapshots are
fetched by the record they belong to, never by a tree within one.
Clones record each user's rights, keep withheld files out of the working
copy and in their snapshots, and refuse pushes the server would reject. A
checkout asks the remote only for the files the clone lacks, so one that
needs nothing from it works offline.
Each user of a clone, and each scope of their tokens, keeps their own
rights and event cursor, so the workspaces of one clone can act for
different users and agents. Once their rights
change, the next fetch compares every change again: the events since the
last fetch don't show what they couldn't see then. The API also lists
directories and reads files of any snapshot, without its history. New
commands: `whoami`, `permissions`, `token issue`. An admin may also
abandon anyone's change (`Policy::authorizes`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 55a24f0 commit df030d0
51 files changed
Lines changed: 7229 additions & 788 deletions
File tree
- apps/origin-src
- benches
- src
- workspace
- tests
- common
- crates
- origin-client/src
- docs
- tools/xtask/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
33 | 42 | | |
34 | 43 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
38 | 48 | | |
39 | 49 | | |
40 | 50 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
108 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
109 | 166 | | |
110 | 167 | | |
111 | 168 | | |
| |||
136 | 193 | | |
137 | 194 | | |
138 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
139 | 199 | | |
140 | 200 | | |
141 | 201 | | |
142 | 202 | | |
143 | 203 | | |
144 | 204 | | |
145 | | - | |
146 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
147 | 209 | | |
148 | 210 | | |
149 | 211 | | |
150 | 212 | | |
151 | 213 | | |
152 | 214 | | |
153 | 215 | | |
154 | | - | |
155 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
156 | 219 | | |
157 | 220 | | |
158 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | | - | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
| 196 | + | |
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
0 commit comments