Repository navigation
feat: support CI/CD login from Forgejo Actions (Codeberg) - #580
Conversation
Wires opkssh to the Forgejo Actions provider (forgejo/codeberg aliases, client login and server verification). The provider itself lives in the openpubkey library. Signed-off-by: Blacks-Army <104644957+Blacks-Army@users.noreply.github.com>
7212dbf to
e7360b9
Compare
Drop --print-id-token, the providers/auth_id echoes and the debug dump step so a run on a public instance does not leak the raw ID Token or opkssh internals. The final SSH whoami is the proof the flow works.
e7360b9 to
2d18b06
Compare
|
@Blacks-Army Now pointed at OpenPubkey with Forgejo support |
238d8b5 to
ffadbb6
Compare
…Writer/ErrorWriter fields openpubkey v0.26.1 added OutputWriter/ErrorWriter fields to providers.StandardOp, which now serialize into the chooser JSON these tests compare against.
…romAuthorizedKey golang.org/x/crypto v0.54.0 (pulled in via the openpubkey bump) now strictly validates that the declared key type in an authorized_keys line matches the type encoded in the key blob, breaking these tests which passed the literal string "cert-type" instead of the real algorithm-specific type (e.g. ecdsa-sha2-nistp256-cert-v01@openssh.com).
|
All checks have passed. |
|
FYI: Test over there is still passing with the changes https://codeberg.org/Blacks-Army/opkssh/actions/runs/4/jobs/0/attempt/1 |
Address review feedback on the Forgejo/GitHub Actions provider detection: - Detect GitHub positively via its token request URL host instead of inferring it from a failed Forgejo check, so a third Actions-compatible runner isn't misreported as GitHub. - Require the cicdUnusedClientID sentinel before routing an issuer into the Forgejo path, so an unrelated OP whose issuer coincidentally ends in "/api/actions" isn't misrouted. - Wire up GitLab CI/CD as a supported CI/CD provider (was implemented in openpubkey/providers but never connected here). IsCICDProvider now checks by alias rather than issuer, since GitLab CI/CD shares its issuer with the browser-based GitLab OP.
0b28e19 to
a8711ba
Compare
|
I don't know why the Pipelines were cancelled. @EthanHeilman can you please rerun them? Seems like I cannot do it.. |
Signed-off-by: Ethan Heilman <ethan.r.heilman@gmail.com>
|
@EthanHeilman No rush at all, I was just wondering if you have a rough idea of when my PR might be merged and whether it’s expected to be part of the next release. |
|
@Blacks-Army I'm hoping to merge it soon. It is the last major feature planned for the upcoming release |
Updates dependency OpenPubkey from v0.25.0 to v0.27.0 v0.27.0 adds a output writer to control where output in the web chooser or standard provider emit output and error. By default it suppresses outputs. Alongside this upgrade we set the output to stdout and stderr to maintain current behavior openpubkey/openpubkey#390 While there this behavior is covered by unittests, I also manually tested that the output was produced. This change was originally in #580 but I pulled it out as a separate PR. The broken tests are fixed in #580.
|
Hey @EthanHeilman, I’d love to use this feature in the near future. Is there perhaps an ETA for the next release? The last one was more than three months ago. |
|
@Blacks-Army Release v0.17.0 is out! |
##### [\`v0.17.0\`](https://github.com/openpubkey/opkssh/releases/tag/v0.17.0) ##### 🚀 Features - feat: support CI/CD login from Forgejo Actions (Codeberg) [@Blacks-Army](https://github.com/Blacks-Army) ([#580](openpubkey/opkssh#580)) - ssh-agent off by default [@EthanHeilman](https://github.com/EthanHeilman) ([#626](openpubkey/opkssh#626)) - feat: add GitLab CI provider support [@cgroschupp](https://github.com/cgroschupp) ([#559](openpubkey/opkssh#559)) - fix(verify): Rejects unsafe principals in authorized_keys [@EthanHeilman](https://github.com/EthanHeilman) ([#597](openpubkey/opkssh#597)) - Warn when a policy row matches on an unverified email [@arpitjain099](https://github.com/arpitjain099) ([#594](openpubkey/opkssh#594)) - Support sshd_session_t SELinux domain in installer [@ozan956](https://github.com/ozan956) ([#614](openpubkey/opkssh#614)) - login: load certificate into ssh-agent with configurable lifetime [@sini](https://github.com/sini) ([#611](openpubkey/opkssh#611)) - policy/plugins: marshal GROUPS and AUD env JSON with encoding/json [@SashaMIT](https://github.com/SashaMIT) ([#601](openpubkey/opkssh#601)) ##### 🐛 Bug Fixes - fix(verify): Rejects unsafe principals in authorized_keys [@EthanHeilman](https://github.com/EthanHeilman) ([#597](openpubkey/opkssh#597)) - fix: Policy footguns [@EthanHeilman](https://github.com/EthanHeilman) ([#596](openpubkey/opkssh#596)) - fix: Regression test for --private-key-file arg higher precedence over \~/.ssh/opkssh [@EthanHeilman](https://github.com/EthanHeilman) ([#592](openpubkey/opkssh#592)) - Accept a string email_verified claim in the plugin env vars [@arpitjain099](https://github.com/arpitjain099) ([#595](openpubkey/opkssh#595)) - Deny malformed oidc policy rows instead of panicking [@arpitjain099](https://github.com/arpitjain099) ([#593](openpubkey/opkssh#593)) ##### Chores - dep: Update to OpenPubkey v0.27.0 [@EthanHeilman](https://github.com/EthanHeilman) ([#598](openpubkey/opkssh#598)) - fix(deps): Update release-drafter/release-drafter action to v7.7.0 @[renovate\[bot\]](https://github.com/apps/renovate) ([#590](openpubkey/opkssh#590)) - fix(deps): Update actions/setup-go action to v7 @[renovate\[bot\]](https://github.com/apps/renovate) ([#578](openpubkey/opkssh#578)) - fix(deps): Update release-drafter/release-drafter action to v7.6.0 @[renovate\[bot\]](https://github.com/apps/renovate) ([#581](openpubkey/opkssh#581)) - \[fix] Windows linter errors [@EthanHeilman](https://github.com/EthanHeilman) ([#577](openpubkey/opkssh#577)) - fix(deps): Update zizmorcore/zizmor-action action to v0.6.0 @[renovate\[bot\]](https://github.com/apps/renovate) ([#575](openpubkey/opkssh#575)) - fix(deps): Update Docker @[renovate\[bot\]](https://github.com/apps/renovate) ([#568](openpubkey/opkssh#568)) - Bump testcontainers-go to 0.43.0 [@EthanHeilman](https://github.com/EthanHeilman) ([#571](openpubkey/opkssh#571)) - Update CLI documentation @[github-actions\[bot\]](https://github.com/apps/github-actions) ([#627](openpubkey/opkssh#627)) - fix(deps): Update dependency ubuntu to v26 @[renovate\[bot\]](https://github.com/apps/renovate) ([#616](openpubkey/opkssh#616)) - chore(deps): bump github.com/moby/go-archive from 0.2.0 to 0.3.0 @[dependabot\[bot\]](https://github.com/apps/dependabot) ([#608](openpubkey/opkssh#608)) - fix: reject empty identity attributes in policy [@SashaMIT](https://github.com/SashaMIT) ([#603](openpubkey/opkssh#603)) - fix(deps): Update go toolchain directive to v1.26.6 @[renovate\[bot\]](https://github.com/apps/renovate) ([#605](openpubkey/opkssh#605)) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Fixes #519
Adds
opkssh login forgejo(aliascodeberg), analogous toopkssh login github, so workflows on Forgejo instances such as Codeberg can authenticate over SSH with their OIDC token.<instance>/api/actions), so no client config is needed./api/actions.docs/forgejo-actions.md. Requires Forgejo v15.0 or later.The provider lives in the openpubkey library (depends on openpubkey/openpubkey#386).