AS AgentScopeAPI 手册 / API Reference

GitHubSignatureVerifier

public final class GitHubSignatureVerifier
源码Source io/agentscope/extensions/channel/github/GitHubSignatureVerifier.java:29–77

GitHub Signature 校验器,把智能体接入外部消息渠道与企业平台。位于 io.agentscope.extensions.channel.github 包。核心成员包括 verify、GitHubSignatureVerifier。

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.

构造器摘要Constructor Summary

构造器Constructor说明Description
public GitHubSignatureVerifier(String webhookSecret)
初始化 `GitHubSignatureVerifier` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public boolean verify(String header, byte[] rawBody)
执行 `verify` 方法。
Returns true when `header` matches `"sha256=" + hex(HMAC-SHA256(secret, body))`.

构造器详情Constructor Detail

GitHubSignatureVerifier

public GitHubSignatureVerifier(String webhookSecret)

初始化 GitHubSignatureVerifier 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
webhookSecretStringwebhook 密钥(类型 `String`)。The webhook secret.
源码Source io/agentscope/extensions/channel/github/GitHubSignatureVerifier.java:35–40

方法详情Method Detail

verify

public boolean verify(String header, byte[] rawBody)

执行 verify 方法。

Returns true when header matches "sha256=" + hex(HMAC-SHA256(secret, body)).

参数Parameters
名称Name类型Type说明Description
headerString请求头(类型 `String`)。The header.
rawBodybyte[]原始正文(类型 `byte[]`)。The raw body.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/channel/github/GitHubSignatureVerifier.java:46–65
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.