Add external secret extension implementation#6252
Conversation
|
Surge PR preview deployment succeeded. View it at https://woodpecker-ci-woodpecker-pr-6252.surge.sh |
|
Thanks! Please check out the tests and linters ;) I also don't think we need the exclusive setting here. This is only required for the config because you can then move that fully to the extension. But as we always have the DB, it's fine to always query the secrets from there as well I think. |
|
Okay, that sounds fine. I will update the PR. Thanks |
|
also have a look at https://woodpecker-ci.org/docs/next/usage/extensions and add a documentation for it :) location of this docs is at https://github.com/woodpecker-ci/woodpecker/tree/main/docs/docs/20-usage/72-extensions |
|
Hey guys, Changes made to accommodate your requests. Also streamlined more with the registry extension. docs etc. :) |
qwerty287
left a comment
There was a problem hiding this comment.
Thanks! Some more points, now with a more detailed look at the code.
…nd update tests and docs
qwerty287
left a comment
There was a problem hiding this comment.
Sorry that I have more and more to add…
In the meantime I also updated the example extension to align with this: woodpecker-ci/example-extensions#97
|
Besides those two points it looks good for me now. Thanks again :) |
qwerty287
left a comment
There was a problem hiding this comment.
Sorry again 🙈
I'm adapting your combined_test.go for the registry extension and found more.
(If you get tired of fixing this just say then I can do it as well…)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
|
we had some renames to make the extention feature more clear, could you please resolve the conflict :) |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6252 +/- ##
==========================================
+ Coverage 33.80% 33.85% +0.04%
==========================================
Files 420 422 +2
Lines 28333 28425 +92
==========================================
+ Hits 9578 9622 +44
- Misses 17862 17908 +46
- Partials 893 895 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add external secret extension support
Adds support for fetching secrets from an external HTTP service, mirroring the existing config service extension pattern (
WOODPECKER_CONFIG_EXTENSION_ENDPOINT).New environment variables
WOODPECKER_SECRET_EXTENSION_ENDPOINT- URL of the external secret serviceWOODPECKER_SECRET_EXTENSION_NETRC- Send netrc if neededPer-repo override
Repos can set their own
secret_extension_endpointHow it works
The external service receives a signed POST request with
{repo, pipeline, netrc}and returns[]*model.Secret. Requests use the same ed25519-signed HTTP client andWOODPECKER_EXTENSIONS_ALLOWED_HOSTSallowlist as the config extension.When not exclusive, DB and external secrets are merged, with external secrets overriding DB secrets by name.
closes #929