Class GitHubSignatureVerifier

java.lang.Object
io.agentscope.extensions.channel.github.GitHubSignatureVerifier

public final class GitHubSignatureVerifier extends Object
Verifies the X-Hub-Signature-256 header on GitHub webhook deliveries: a sha256= prefix followed by the HMAC-SHA256 of the raw request body keyed with the configured webhook secret.
See Also:
  • Constructor Details

    • GitHubSignatureVerifier

      public GitHubSignatureVerifier(String webhookSecret)
  • Method Details

    • verify

      public boolean verify(String header, byte[] rawBody)
      Returns true when header matches "sha256=" + hex(HMAC-SHA256(secret, body)). Comparison is constant time.