- Notifications
You must be signed in to change notification settings - Fork1
Commitcb3aae6
authored
impl: verify cli signature (#148)
This PR introduces support for verifying the CLI binary using a detachedPGP signature. Starting with version 2.24, Coder signs all CLI binaries.For clients using older versions or running TBX in air-gappedenvironments, unsigned CLIs can still be executed — but users will haveto confirm it each time.In terms of code changes - the PR includes a big refactor around CLIdownloading with most of the code refactored and extracted in variouscomponents that provide clean steps and result state in the maindownload method. Then the pgp verification logic was added on top, withsome particularities:- the pgp public key is embedded in the plugin as a jar resource- we support multiple key rings in the public key- the user has the option of running the CLI if no signature was found- the signature search has a fallback approach: first we look in theCoder deployment, and then fall back to releases.coder.com to search forthe signature if the user allows it.- we expect the signature to be under the same relative path as the CLI(we have an option which allows user to pick the CLI from a differentsource other than the Coder deployment)1 parente02c866 commitcb3aae6
File tree
23 files changed
+1230
-322
lines changed- gradle
- src
- main
- kotlin/com/coder/toolbox
- cli
- downloader
- ex
- gpg
- settings
- store
- util
- views
- resources
- META-INF/trusted-keys
- localization
- test/kotlin/com/coder/toolbox
- cli
- store
23 files changed
+1230
-322
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| 8 | + | |
8 | 9 |
| |
9 | 10 |
| |
10 | 11 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
| 66 | + | |
66 | 67 |
| |
67 | 68 |
| |
68 | 69 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| 19 | + | |
19 | 20 |
| |
20 | 21 |
| |
21 | 22 |
| |
| |||
34 | 35 |
| |
35 | 36 |
| |
36 | 37 |
| |
| 38 | + | |
| 39 | + | |
37 | 40 |
| |
38 | 41 |
| |
39 | 42 |
| |
40 | 43 |
| |
| 44 | + | |
41 | 45 |
| |
42 | 46 |
| |
43 | 47 |
| |
|
Lines changed: 40 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
| 38 | + | |
38 | 39 |
| |
39 | 40 |
| |
40 | 41 |
| |
| |||
302 | 303 |
| |
303 | 304 |
| |
304 | 305 |
| |
305 |
| - | |
306 |
| - | |
307 |
| - | |
308 |
| - | |
309 |
| - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
310 | 318 |
| |
311 |
| - | |
312 |
| - | |
313 |
| - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
314 | 323 |
| |
315 | 324 |
| |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
316 | 332 |
| |
317 |
| - | |
318 |
| - | |
319 |
| - | |
320 |
| - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
321 | 349 |
| |
322 | 350 |
| |
323 |
| - | |
324 |
| - | |
325 |
| - | |
326 |
| - | |
327 |
| - | |
328 |
| - | |
329 |
| - | |
330 | 351 |
| |
331 | 352 |
| |
332 | 353 |
| |
|
0 commit comments
Comments
(0)