Repository navigation
feat(coder/github-upload-public-key): add key_type to upload SSH signing keys - #1193
Merged
Merged
Conversation
…ing keys Add an optional key_type variable (auth, signing, both) so the Coder public key can also be uploaded as a GitHub SSH signing key. The default stays auth to preserve the current behavior. Supersedes #1072.
Contributor
Module Scorecard Check
|
| Theme | Before | After |
|---|---|---|
| Presentation & Onboarding | 6 / 17 | 12 / 17 |
| Integration | — | — |
| Credential Hygiene | 20 / 20 | 12 / 20 |
| Restricted-Environment | 2 / 2 | 2 / 2 |
| Engineering Quality | 10 / 10 | 10 / 10 |
| Overall | 78 / 100 | 73 / 100 |
Full scorecard for this PR
| Presentation & Onboarding | Credential Hygiene | Restricted-Environment Readiness | Engineering Quality | Overall |
|---|---|---|---|---|
| 12 / 17 | 12 / 20 | 2 / 2 | 10 / 10 | 73 / 100 |
Drilldown
Presentation & Onboarding — 12 / 17
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Configuration-mode examples | 12 | 12 | README documents all three key_type modes (auth default in first example, signing in prose "Set key_type to signing", both in second example), key_name in the first example, and external_auth_id in a dedicated example. Sensible defaults are stated for every variable. |
| Visual preview | 5 | 0 | No image, GIF, or video embedded in the README. The frontmatter icon field is a static SVG reference, not a visual preview of the module in action. |
Credential Hygiene — 12 / 20
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Secrets marked sensitive | 16 | 8 | No module input is a secret (session token is obtained via data.coder_workspace_owner.me.session_token), so no sensitive = true is needed. However, the README's "Requirements" section inlines a placeholder secret: CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=xxxxxxx, which triggers the calibration cap at half. |
| Non-hardcoded auth path | 4 | 4 | The module uses Coder External Auth (coder external-auth access-token) to obtain the GitHub token at runtime. No raw API keys or tokens are pasted into templates. The README explicitly documents the External Auth prerequisite and the required OAuth scopes. |
Restricted-Environment Readiness — 2 / 2 (18 pts N/A)
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Mirrorable artifact source | 5 | N/A | The module downloads or installs nothing. It invokes curl and jq already present in the image and makes HTTP API calls to Coder and GitHub. No tool download URL exists to override. |
| Bring-your-own binary | 10 | N/A | No download or install step exists. The module requires curl and jq to be pre-installed (documented in README) but does not install them. |
| Egress transparency | 3 | N/A | The module downloads or installs nothing of its own; it only invokes pre-installed tools and calls APIs. |
| Runs without sudo | 2 | 2 | run.sh contains no sudo invocation. All operations (curl, jq, coder CLI) run as the unprivileged workspace user. |
Engineering Quality — 10 / 10
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Input quality | 6 | 6 | All five variables have clear description fields. key_type has a validation block restricting values to ["auth","signing","both"]. external_auth_id and github_api_url have sensible defaults. key_name defaults to null with a documented fallback. |
| Test coverage | 4 | 4 | main.tftest.hcl covers Terraform-level logic (key_type default, signing, both, invalid rejection via expect_failures). main.test.ts provides end-to-end tests executing the actual run.sh in a container against a mock GitHub API server, covering: new key creation, custom name, special characters, idempotency, signing-only, both, pagination, and skip-existing. Clear separation of concerns. |
Overall — 73 / 100
Raw 36 / 49 → round(36 / 49 × 100) = 73
Track: Utility (helper module for GitHub key management; not an AI agent or IDE)
(N/A exclusions: Mirrorable artifact source 5, Bring-your-own binary 10, Egress transparency 3 = 18 pts removed from the 67-pt universal denominator, leaving 49.)
Tip
You can run this locally by telling your agent: "review this module against .github/scorecard/SCORECARD.md".
Scored against SCORECARD.md with solstice-1. Language-model scores are advisory.
Edd88-pixel
reviewed
Oct 20, 2026
…existing keys (#1197) ## Description Stacked on #1193. Addresses [this review comment](#1193 (comment)). GitHub's key list endpoints return 30 keys per page by default, so a Coder key beyond the first page was missed and the module tried to upload it again. `upload_key` now requests `per_page=100` and keeps fetching pages until it finds the key or gets a page shorter than 100. This applies to both `/user/keys` and `/user/ssh_signing_keys`. ## Type of Change - [ ] New module - [ ] New template - [x] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [ ] Other ## Module Information **Path:** `registry/coder/modules/github-upload-public-key` **New version:** `v1.2.0` (unreleased; same version as #1193) **Breaking change:** [ ] Yes [x] No ## Testing & Validation - [x] Tests pass (`bun test`): 10/10, with a new case where the key is on the second page for both endpoints. This case fails on the #1193 script. - [x] Code formatted (`bun fmt`) - [x] Changes tested locally against real GitHub ## Related Issues Stacked on #1193 --- > [!NOTE] > This PR was generated by Coder Agents on behalf of @35C4n0r, using Claude.
Edd88-pixel
approved these changes
Oct 21, 2026
2 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an optional
key_typevariable togithub-upload-public-keyso the Coder public key can also be uploaded as a GitHub SSH signing key, letting GitHub verify commits signed with it.auth(default): uploads to/user/keys, same as before.signing: uploads to/user/ssh_signing_keys.both: uploads to both, checking each endpoint independently so an existing key on one does not skip the other.Supersedes #1072 (thanks @v-atsai), keeping signing as an additive option instead of replacing authentication key upload.
Type of Change
Module Information
Path:
registry/coder/modules/github-upload-public-keyNew version:
v1.2.0Breaking change: [ ] Yes [x] No
Testing & Validation
bun test): 9/9, including newsigningandbothcases;terraform test: 4/4 (newmain.tftest.hcl)bun fmt)Related Issues
Supersedes #1072
Decision log
key_typedefaults toauthso existing templates keep uploading an authentication key.upload_keyfunction. Both endpoints share the same list/compare/POST flow, sorun.shruns it once per selected type and fails the script if either upload fails.read:ssh_signing_keyand creating needswrite:ssh_signing_key; the README recommendsadmin:ssh_signing_key, matching the existingadmin:public_keyguidance. GitHub Apps need the "SSH signing keys" user permission (read forGET, write forPOST).1.2.0(new optional input).Note
This PR was generated by Coder Agents on behalf of @35C4n0r, using Claude.