Skip to content

docs: document accepted private key formats for GitHub App auth - #186

Merged
luisina-santos merged 1 commit into
mainfrom
CXP-1055/update-docs
Aug 31, 2026
Merged

docs: document accepted private key formats for GitHub App auth#186
luisina-santos merged 1 commit into
mainfrom
CXP-1055/update-docs

Conversation

@carolinaroncaglia

Copy link
Copy Markdown
Contributor

Summary

The GitHub App walkthrough ends at "Carefully save the private key file." (docs/connector.mdx:216) and stops there. Two things an operator needs are absent from the page, and both are now covered by one note on that step.

Findings addressed

The accepted key formatsverified in code, measured against a live app.
loadPrivateKeyFromString accepts PKCS#1 — header -----BEGIN RSA PRIVATE KEY-----, what GitHub's Generate a private key button produces — and PKCS#8 — header -----BEGIN PRIVATE KEY-----, what OpenSSL 3.0+ emits by default (pkg/connector/connector.go:495-508). A PKCS#8 key that is not RSA is rejected with not an RSA private key (pkg/connector/connector.go:502), which is why the note says RSA explicitly. Both RSA formats were exercised against a live GitHub App on v0.4.1 and each produced a full sync, so the "no conversion is needed" claim is measured rather than inferred.

That the key can be supplied by valueverified in code.
--app-privatekey / $BATON_APP_PRIVATEKEY takes the raw PEM contents, and appPrivateKeyPEM (pkg/connector/connector.go:356) prefers it over --app-privatekey-path when both are set. README.md:77-78 documents both flags, but on the customer-facing page a reader following the credential walkthrough reaches the configuration step believing the saved file is the only usable artefact.

Why it mattered

An operator who generates the key with OpenSSL rather than GitHub's button has no way to tell from this page whether the resulting PKCS#8 file works, and converting it "just in case" is a step nobody needs to take. The second sentence is what connects this step to the configuration step, where either form is accepted.

Scope

One note, on the step where the walkthrough loses the reader. No other section changed. The C1 config form's single-line shape is deliberately out of scope here — it is documented separately in #185, which touches the same file at :296, well clear of this change.

🤖 Generated with Claude Code

The GitHub App walkthrough ended at "Carefully save the private key file"
and never told the reader which key formats the connector accepts, or that
the contents of that file can be supplied instead of a path.

loadPrivateKeyFromString accepts PKCS#1 and PKCS#8, so a key from GitHub's
Generate a private key button and one produced by OpenSSL 3.0+ both work
with no conversion.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Aug 31, 2026

Copy link
Copy Markdown

CXP-1055

@github-actions

Copy link
Copy Markdown
Contributor

Connector PR Review: docs: document accepted private key formats for GitHub App auth

Blocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0
Criteria: Criteria status: loaded .claude/skills/ci-review.md from trusted base 7f1382e0d52e.
Review mode: full
View review run

Review Summary

Scanned the full PR diff for security and correctness: it is documentation-only, adding a 7-line note to the GitHub App private-key step in docs/connector.mdx. Both claims verify against the current code — loadPrivateKeyFromString (pkg/connector/connector.go:487-508) accepts PEM blocks of type RSA PRIVATE KEY (PKCS#1) and PRIVATE KEY (PKCS#8, rejecting non-RSA keys with not an RSA private key), and appPrivateKeyPEM (pkg/connector/connector.go:356) accepts raw PEM contents via --app-privatekey in preference to --app-privatekey-path, matching the flag descriptions in pkg/config/config.go:50-60. No code, config, dependency, or generated-artifact changes; no new issues found.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

None.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No blocking issues found.

@luisina-santos
luisina-santos merged commit f8243ad into main Aug 31, 2026
9 checks passed
@luisina-santos
luisina-santos deleted the CXP-1055/update-docs branch August 31, 2026 17:52
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