Skip to content

Fix error with agent requests header to X-GitHub-Public-Key-Signature #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bryantson
Copy link

The current application fails to start with go run . with a following error: failed to validate payload signature: asn1: syntax error: sequence truncated.

After some debugging, the error happens to due to sig value in the line sig := r.Header.Get("GitHub-Public-Key-Signature") of service.go file's ChatCompletion function returning nothing.

This happened because the header changed from GitHub-Public-Key-Signature to X-GitHub-Public-Key-Signature as seen here:

https://docs.github.com/en/copilot/building-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/configuring-your-copilot-agent-to-communicate-with-github#verifying-that-payloads-are-coming-from-github

The current application fails to start with "go run ." with a following error: "failed to validate payload signature: asn1: syntax error: sequence truncated." After some debugging, the error happens to due to "sig" value in the line of "sig := r.Header.Get("GitHub-Public-Key-Signature")" of "service.go" file's "ChatCompletion" function returning nothing. This happened because the header changed from "GitHub-Public-Key-Signature" to "XGitHub-Public-Key-Signature" as seen here: 
https://docs.github.com/en/copilot/building-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/configuring-your-copilot-agent-to-communicate-with-github#verifying-that-payloads-are-coming-from-github
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.

1 participant