Repository navigation
feat: GitHub App authentication - #35
Merged
Merged
Conversation
Besides a token, the plugin can now authenticate as a GitHub App installation (app-id, installation-id, and private-key-file or private-key), using short-lived installation tokens that ghinstallation renews. A token still wins when set, and with neither the plugin stays unauthenticated as before; only incomplete app credentials are rejected. Ports compliance-framework/plugin-github-repositories#43 (itself based on plugin-github-repositories#3), with this plugin's hyphenated config keys. Co-authored-by: Gustavo Carvalho <gustavo@externalsecrets.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
The agent maps plugin config keys to CCF_* environment variables by uppercasing them and replacing dots, not hyphens, so app-id and friends could not be set from the environment (CCF_PLUGINS_DEPENDABOT_CONFIG_APP-ID is not a valid variable name). Use app_id, installation_id, private_key_file and private_key, the same keys as plugin-github-repositories and plugin-github-settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The agent sends plugin config over gRPC as a flat map<string, string>, which the plugin decodes into PluginConfig with the embedded, squashed AuthConfig. These tests send Configure through go-plugin's in-process gRPC harness: the token config every deployment sends today, a GitHub App config (with the empty keys agent configs declare for environment injection), and incomplete app credentials. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gusfcarvalho
approved these changes
Oct 28, 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.
Summary
Lets the plugin authenticate as a GitHub App installation as an alternative to a token. Organizations can govern apps centrally, and the plugin only holds short-lived installation tokens, which ghinstallation renews as they expire.
This is the same change as compliance-framework/plugin-github-repositories#43, which re-implements @gusfcarvalho's compliance-framework/plugin-github-repositories#3. It uses the same config keys:
Changes
auth.go:AuthConfigis embedded inPluginConfig(mapstructure:",squash", so the keys stay flat) and carried onParsedConfig.Auth, which replacesParsedConfig.Token. It validates the credentials and builds the authenticatedhttp.Clientbehind the go-github client.Behaviour for existing configs is unchanged:
tokenstill wins when set.Configureerror (for exampleGitHub App authentication needs installation_id).main_integration_test.go: thePluginConfigliterals now setAuthConfig{Token: ...}.Tests for validation, the token, file, base64 and PEM paths, bad input, and decoding of the agent's flat config map. README: an authentication section with a GitHub App setup guide.
Underscores, not hyphens, unlike
included-repositoriesand the plugin's other keys. The agent fills plugin config fromCCF_*environment variables by uppercasing the key and replacing dots only, so a hyphenatedapp-idwould needCCF_PLUGINS_DEPENDABOT_CONFIG_APP-ID, which shells can't set. local-dev and the hosted demo pass credentials this way, for exampleCCF_PLUGINS_DEPENDABOT_CONFIG_PRIVATE_KEY. The README notes this.Wiring
auth_grpc_test.gosendsConfigurethrough go-plugin's in-process gRPC harness (TestPluginGRPCConnwithrunner.RunnerV2GRPCPlugin), the same path the agent uses. The agent sends config as a flatmap<string, string>, and the plugin decodes it after the gRPC hop, so the embeddedAuthConfig(mapstructure:",squash") never affects the wire format. The tests cover the token-only config every deployment sends today, an app config with the empty keys agent configs declare, and incomplete app credentials. Withoutsquashthey fail.CCF_*environment variables) and teaches thedemo-go-check-githubpre-flight about app credentials.Testing
go vet ./...,go vet -tags integration ./...andgo test ./...pass.main.🤖 Generated with Claude Code