Commit cfda96e
authored
[feat:extensions] add support to package web-bot-auth (#62)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Adds a new CLI flow to fetch, build, and package Cloudflare’s
`web-bot-auth` browser extension with Kernel-specific configs, plus
supporting utils and tests.
>
> - New `kernel extensions build-web-bot-auth` command in
`cmd/extensions.go` with flags `--to`, `--url`, `--key`, `--upload`; can
auto-upload to Kernel under a specified name
> - Implements build pipeline in `pkg/extensions/webbotauth.go`:
downloads GitHub archive, validates/converts Ed25519 keys (JWK/PEM),
modifies policy/build templates, runs `npm install/build/bundle`,
extracts extension ID, and copies artifacts (`.crx`, `update.xml`,
`policy`, built files) to output
> - Adds crypto helpers in `pkg/util/crypto.go` (`ValidatePEMKey`,
`IsPEMKey`, `ConvertJWKToPEM`) and file ops in `pkg/util/fileops.go`
(`CopyFile`, `CopyDir`, `ModifyFile`)
> - New tests: download/extract integration in
`pkg/extensions/webbotauth_test.go` and crypto unit tests in
`pkg/util/crypto_test.go`
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5268e7a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 251fba5 commit cfda96e
File tree
6 files changed
+964
-0
lines changed- cmd
- pkg
- extensions
- util
6 files changed
+964
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
422 | 423 | | |
423 | 424 | | |
424 | 425 | | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
425 | 473 | | |
426 | 474 | | |
427 | 475 | | |
428 | 476 | | |
429 | 477 | | |
430 | 478 | | |
| 479 | + | |
431 | 480 | | |
432 | 481 | | |
433 | 482 | | |
| |||
436 | 485 | | |
437 | 486 | | |
438 | 487 | | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
439 | 492 | | |
0 commit comments