Repository navigation
Commit 589feca
feat: platform-token auth for runs, run help text, nan --version fix (0.1.25) (#42)
* chore: 0.1.25
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(runs): authenticate with NAN_TOKEN or --token-file
Precedence: NAN_TOKEN > --token-file > session > saved platform token >
saved API key. A token file readable or writable by others is refused.
Refused credentials are named, never shown. nan me and nan metrics usage
explain that they need a session when only a token is configured.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(auth): nan auth login --api-token
Reads a platform token or API key from stdin (hidden on a terminal),
checks it with GET /v1/runs?limit=1 and saves it 0600. Platform tokens
go to platformToken, never apiKey, which the Setup tab writes into tools.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: nan --version prints one line; the dashboard explains platform tokens
nan --version and nan -v print "nan <version>" and exit 0 instead of
the full-screen wordmark. The sign-in step of the dashboard says that a
platform token only works for nan run and nan runs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(help): branch behaviour, queue, portal labels and auth in nan run --help
nan runs --help and nan runs logs --help link the docs; logs lists the
event types and the --json line format.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs: authentication for runs, headless use with NAN_TOKEN
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(auth): review feedback on token login and precedence
- A saved platform token now goes before the session: a session expires
on the server unseen, and ranked after it the token was never reached.
- --api-token asks the terminal itself whether stdin is one, so
</dev/null (cron, docker run without -i) says no token arrived.
- The login output says what nan run will actually use, and warns when
an sk- key replaces the one the Setup tab saved.
- --token-file paths are sanitised in errors; a missing file says so.
- NAN_TOKEN is one constant (session.TokenEnvVar); usingKey() removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(runs): sanitised --token-file paths on every error, with tests
Stat and read errors drop the raw path from *os.PathError too. Help and
README say an sk- key saved with --api-token counts as a saved API key,
and a refused saved token says the logout way back to the session.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(runs): cover every --token-file error branch for sanitised paths
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: barckcode <cristian@helmcode.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 45afdb7 commit 589feca
21 files changed
Lines changed: 1389 additions & 101 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
| 108 | + | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
115 | 129 | | |
116 | 130 | | |
117 | 131 | | |
| |||
154 | 168 | | |
155 | 169 | | |
156 | 170 | | |
157 | | - | |
158 | | - | |
| 171 | + | |
| 172 | + | |
| 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 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
159 | 217 | | |
160 | 218 | | |
161 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
30 | | - | |
31 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
32 | 50 | | |
33 | 51 | | |
34 | 52 | | |
35 | 53 | | |
36 | | - | |
| 54 | + | |
37 | 55 | | |
38 | 56 | | |
39 | 57 | | |
| |||
44 | 62 | | |
45 | 63 | | |
46 | 64 | | |
| 65 | + | |
47 | 66 | | |
48 | 67 | | |
49 | 68 | | |
| |||
52 | 71 | | |
53 | 72 | | |
54 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
55 | 80 | | |
56 | 81 | | |
57 | 82 | | |
| |||
212 | 237 | | |
213 | 238 | | |
214 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
0 commit comments