feat(vcs): accept a base64 or escaped-newline GitHub App private key - #261
Merged
Conversation
generateAccessToken() now also takes the PEM base64-encoded, on one line or wrapped, or on one line with newlines escaped as \n. A raw PEM never passes strict base64 decoding, so keys that already work are used unchanged.
HarshMN2345
requested review from
Meldiron,
abnegate,
eldadfux and
loks0n
as code owners
September 11, 2026 12:53
Contributor
|
Meldiron
approved these changes
Sep 12, 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.
Two open questions:
_APP_VCS_GITHUB_PRIVATE_KEY_BASE64proposed in 🚀 Feature: Allow base64 for GitHub private key appwrite/appwrite#7732?\nhandling stay in, or should this be base64 only?What
GitHub::generateAccessToken()accepts the private key as:\nnewlinesWhy one parameter
Detection can't misfire. A strict
base64_decode()rejects the-in every PEM, so a key that works today is never decoded. A decoded value replaces the input only if it is itself a PEM. The Origin adapter already accepts a PEM or base64 through the same parameter.The
\nreplacement only runs on values containing-----BEGIN, sofile://paths are left alone.Testing
openssl_verify. Without the change, all three cases throwFailed to read the GitHub App private key.bin/monorepo check vcsand the vcs unit tier pass.Follow-up in Appwrite
utopia-php/vcs; the lock is on 5.2.5, so this also brings in 5.3.0._APP_VCS_GITHUB_PRIVATE_KEYdescription and the self-hosting docs.