Skip to content

fix(github-upload-public-key): use ssh_signing_keys uri - #1072

Closed
v-atsai wants to merge 1 commit into
coder:mainfrom
v-atsai:patch-1
Closed

v-atsai wants to merge 1 commit into
coder:mainfrom
v-atsai:patch-1

Conversation

@v-atsai

@v-atsai v-atsai commented Aug 21, 2026 •

Copy link
Copy Markdown

Description

Type of Change

  • New module
  • New template
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/coder/modules/github-upload-public-key
New version: v1.1.1
Breaking change:

  • Yes
  • No

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun fmt)
  • Changes tested locally

Related Issues

@35C4n0r
35C4n0r self-requested a review August 25, 2026 17:14

@35C4n0r 35C4n0r left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@v-atsai adding a signing key should be an additional feature in the module, we don't want to replace the current behaviour of the module from adding authentication SSH key to signing SSH key.
I'd suggest to add a new optional variable where users can key_type auth(default)/signing/both, this would add signing as an additive option rather than a replacement.

Edd88-pixel pushed a commit that referenced this pull request Oct 21, 2026
…ing keys (#1193)

## Description

Adds an optional `key_type` variable to `github-upload-public-key` so
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

- [ ] New module
- [ ] New template
- [ ] Bug fix
- [x] Feature/enhancement
- [ ] Documentation
- [ ] Other

## Module Information

**Path:** `registry/coder/modules/github-upload-public-key`
**New version:** `v1.2.0`
**Breaking change:** [ ] Yes [x] No

## Testing & Validation

- [x] Tests pass (`bun test`): 9/9, including new `signing` and `both`
cases; `terraform test`: 4/4 (new `main.tftest.hcl`)
- [x] Code formatted (`bun fmt`)
- [x] Changes tested locally against real GitHub

## Related Issues

Supersedes #1072

<details>
<summary>Decision log</summary>

- **Additive, not a replacement.** Per review on #1072, `key_type`
defaults to `auth` so existing templates keep uploading an
authentication key.
- **Single `upload_key` function.** Both endpoints share the same
list/compare/POST flow, so `run.sh` runs it once per selected type and
fails the script if either upload fails.
- **Log wording.** Messages now name the key type (for example, "added
as a GitHub signing key"). This changes the wording on the default path
too; no exit-code changes.
- **Required permissions, checked against GitHub docs.** Listing signing
keys needs `read:ssh_signing_key` and creating needs
`write:ssh_signing_key`; the README recommends `admin:ssh_signing_key`,
matching the existing `admin:public_key` guidance. GitHub Apps need the
"SSH signing keys" user permission (read for `GET`, write for `POST`).
- **Out of scope.** The module only uploads the key; configuring Git in
the workspace to sign commits with it is left to the template.
- **Version.** Minor bump to `1.2.0` (new optional input).

</details>

---

> [!NOTE]
> This PR was generated by Coder Agents on behalf of @35C4n0r, using
Claude.
@35C4n0r

35C4n0r commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Closing in favour of #1193

@35C4n0r 35C4n0r closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants