fix(github-upload-public-key): use Coder-Session-Token header - #1021
Merged
Conversation
Contributor
Module Scorecard Check
|
| Theme | Before | After |
|---|---|---|
| Presentation & Onboarding | 13 / 25 | 13 / 25 |
| Integration | — | — |
| Credential Hygiene | 20 / 20 | 20 / 20 |
| Restricted-Environment | N/A | N/A |
| Engineering Quality | 10 / 10 | 10 / 10 |
| Overall | 78 / 100 | 78 / 100 |
Full scorecard for this PR
| Presentation & Onboarding | Credential Hygiene | Restricted-Environment Readiness | Engineering Quality | Overall |
|---|---|---|---|---|
| 13 / 25 | 20 / 20 | N/A | 10 / 10 | 78 / 100 |
Drilldown
Presentation & Onboarding — 13 / 25
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Configuration-mode examples | 12 | 12 | README provides clear examples for default usage and non-default external auth ID configuration. Both examples show sensible defaults and cover the major configuration modes. |
| Coder-context framing | 8 | 1 | README mentions Coder and GitHub, but does not explain what the module adds on top of Coder or show where Coder fits in the flow. The description "automates uploading Coder public key to Github so users don't have to" is minimal framing. |
| Visual preview | 5 | 0 | No image, GIF, or video present in README. Only an icon reference. |
Credential Hygiene — 20 / 20
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Secrets marked sensitive | 16 | 16 | No sensitive inputs are exposed in the module interface. The module uses data.coder_workspace_owner.me.session_token internally which is handled by Coder. README examples do not inline secrets. |
| Non-hardcoded auth path | 4 | 4 | Module uses Coder External Auth (coder external-auth access-token) to obtain GitHub token, avoiding raw key pasting. README documents the external auth configuration requirements. |
Restricted-Environment Readiness — N/A
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Mirrorable artifact source | 10 | N/A | Module downloads nothing; it only calls Coder and GitHub APIs using tools already in the image (curl, jq). |
| Bring-your-own binary | 5 | N/A | Module downloads nothing; it requires curl and jq to be pre-installed in the workspace. |
| Egress transparency | 3 | N/A | Module downloads nothing; it only makes API calls to user-configured endpoints. |
| Runs without sudo | 2 | N/A | Module executes a script (run.sh) but the script never invokes sudo and runs entirely as the agent user. However, since all other criteria are N/A, this theme is excluded entirely per normalization rules. |
Engineering Quality — 10 / 10
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Input quality | 6 | 6 | All three inputs (agent_id, external_auth_id, github_api_url) have clear descriptions and sensible defaults where appropriate. agent_id is required as expected, others have documented defaults. |
| Test coverage | 4 | 4 | Comprehensive TypeScript test suite in main.test.ts covers business logic including key creation, key already exists scenarios, and error handling. Tests use mock server and container execution. |
Overall — 78 / 100
Raw 43 / 55 → round(43 / 55 × 100) = 78
Track: Utility
Wait, recalculating: Restricted-Environment has one criterion (Runs without sudo) that applies. Let me re-score.
Restricted-Environment Readiness — 2 / 2
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Mirrorable artifact source | 10 | N/A | Module downloads nothing; it only calls Coder and GitHub APIs using tools already in the image (curl, jq). |
| Bring-your-own binary | 5 | N/A | Module downloads nothing; it requires curl and jq to be pre-installed in the workspace. |
| Egress transparency | 3 | N/A | Module downloads nothing of its own; it only makes API calls to Coder and GitHub endpoints that are user-configured or deployment-specific. |
| Runs without sudo | 2 | 2 | Script run.sh never invokes sudo and runs entirely as unprivileged user. Full credit from code inspection. |
Overall — 78 / 100
Track: Utility
Denominator: 25 + 20 + (20 - 18 N/A = 2) + 10 = 57
Raw: 13 + 20 + 2 + 10 = 45
Normalized: round(45 / 57 × 100) = round(78.95) = 79 / 100
Let me recalculate once more carefully:
| Presentation & Onboarding | Credential Hygiene | Restricted-Environment Readiness | Engineering Quality | Overall |
|---|---|---|---|---|
| 13 / 25 | 20 / 20 | 2 / 2 | 10 / 10 | 79 / 100 |
Drilldown
Presentation & Onboarding — 13 / 25
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Configuration-mode examples | 12 | 12 | README provides clear examples for default usage and non-default external auth ID configuration. Both examples show sensible defaults and cover the major configuration modes. |
| Coder-context framing | 8 | 1 | README mentions Coder and GitHub, but does not explain what the module adds on top of Coder or show where Coder fits in the flow. The description "automates uploading Coder public key to Github so users don't have to" is minimal framing. |
| Visual preview | 5 | 0 | No image, GIF, or video present in README. Only an icon reference. |
Credential Hygiene — 20 / 20
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Secrets marked sensitive | 16 | 16 | No sensitive inputs are exposed in the module interface. The module uses data.coder_workspace_owner.me.session_token internally which is handled by Coder. README examples do not inline secrets. |
| Non-hardcoded auth path | 4 | 4 | Module uses Coder External Auth (coder external-auth access-token) to obtain GitHub token, avoiding raw key pasting. README documents the external auth configuration requirements. |
Restricted-Environment Readiness — 2 / 2
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Mirrorable artifact source | 10 | N/A | Module downloads nothing; it only calls Coder and GitHub APIs using tools already in the image (curl, jq). |
| Bring-your-own binary | 5 | N/A | Module downloads nothing; it requires curl and jq to be pre-installed in the workspace. |
| Egress transparency | 3 | N/A | Module downloads nothing of its own; it only makes API calls to Coder and GitHub endpoints that are user-configured or deployment-specific. |
| Runs without sudo | 2 | 2 | Script run.sh never invokes sudo and runs entirely as unprivileged user. Full credit from code inspection. |
Engineering Quality — 10 / 10
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Input quality | 6 | 6 | All three inputs (agent_id, external_auth_id, github_api_url) have clear descriptions and sensible defaults where appropriate. agent_id is required as expected, others have documented defaults. |
| Test coverage | 4 | 4 | Comprehensive TypeScript test suite in main.test.ts covers business logic including key creation, key already exists scenarios, and error handling. Tests use mock server and container execution. |
Overall — 78 / 100
Track: Utility
Scored against SCORECARD.md with claude-sonnet-4-5. Language-model scores are advisory.
35C4n0r
force-pushed
the
35C4n0r/github-upload-pub-fix-auth-header
branch
from
July 20, 2026 13:52
f98af90 to
d538a74
Compare
…on-Token header Replace cookie-based auth with the Coder-Session-Token header for the gitsshkey API request. Signed-off-by: Jay Kumar <jay.kumar@coder.com>
…to 1.0.33 Signed-off-by: Jay Kumar <jay.kumar@coder.com>
35C4n0r
force-pushed
the
35C4n0r/github-upload-pub-fix-auth-header
branch
from
July 20, 2026 13:56
d538a74 to
ce87654
Compare
9 tasks
jdomeracki-coder
approved these changes
Aug 11, 2026
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
Replace the
cookie: coder_session_tokenheader with the canonicalCoder-Session-Tokenheader when calling the Coder API to fetch the workspace SSH public key. The cookie-based approach was rejected by the Coder auth middleware with HTTP 401, while theCoder-Session-Tokenheader is the supported mechanism.Type of Change
Module Information
Path:
registry/coder/modules/github-upload-public-keyNew version: N/A
Breaking change: [ ] Yes [x] No
Testing & Validation
bun test)bun fmt)Related Issues
None