Commit ade2845
committed
feat(orb): add an AMS-facing secret type to the generalized broker (#7674)
Adds ORB_SECRET_TYPE_AMS_GITHUB_TOKEN to src/orb/broker.ts, ratified on #4941:
hosted AMS reuses ORB's installation-based broker rather than a parallel
identity system. Mechanically identical to ORB_SECRET_TYPE_GITHUB_TOKEN -- a
GitHub App installation token's permissions come from the App and what the
installer granted, not from anything the broker's caller specifies, so there
is no real behavioral difference to build. brokerOrbToken's eligibility check
now accepts either value, routing both through the exact same mint/cache/
install-eligibility flow; the distinct value exists purely so an enrollment
row records which product's container it was issued for.
Deliberately distinct from the self-host session-based GitHub auth
packages/loopover-miner/lib/github-token-resolution.ts uses (a human's own
OAuth token via /v1/auth/github/token, from a loopover-mcp login) -- that
flow authenticates an interactive human tool as themselves; this one
authorizes a headless hosted container as the installed App, the same reason
ORB's own broker exists at all. The two are not duplicative: one models a
human identity, the other a machine service identity.
Scope is deliberately narrow, mirroring the #8064/#8066 split: this adds only
the broker's capability to mint this type. It does not wire up a way for a
real caller to request it at issuance time (POST /v1/internal/orb/enrollments
and oauth.ts's self-enrollment landing page both still hardcode
github_token) -- that's a follow-up once a real hosted-AMS consumer exists to
call it.
Tests mirror the existing github_token coverage (mint, cache, install-
eligibility re-check) for the new type, plus a regression test confirming a
genuinely unrecognized secret type is still rejected.1 parent 321c192 commit ade2845
2 files changed
Lines changed: 69 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
35 | 46 | | |
36 | 47 | | |
37 | 48 | | |
| |||
126 | 137 | | |
127 | 138 | | |
128 | 139 | | |
129 | | - | |
130 | | - | |
131 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
132 | 144 | | |
133 | 145 | | |
134 | 146 | | |
| |||
146 | 158 | | |
147 | 159 | | |
148 | 160 | | |
149 | | - | |
150 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
151 | 167 | | |
152 | 168 | | |
153 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
82 | 91 | | |
83 | 92 | | |
84 | 93 | | |
| |||
162 | 171 | | |
163 | 172 | | |
164 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
165 | 213 | | |
166 | 214 | | |
167 | 215 | | |
| |||
0 commit comments