Documentation
¶
Overview ¶
Package discordsign provides funcionality for generating request signature headers in testscript tests to simulate Discord interaction webhook requests. See: https://discord.com/developers/docs/interactions/overview#setting-up-an-endpoint-validating-security-request-headers
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cmd ¶
func Cmd(name string) func(*testscript.TestScript, bool, []string)
Cmd returns a github.com/rogpeppe/go-internal/testscript command that signs the contents of the provided file, i.e. request body. Signature and timestamp request headers are written to the specified file.
func Init ¶
func Init(env *testscript.Env)
Init creates an Ed25519 key pair for use in request signatures. It must be called in the testscript Setup function.
The hex-encoded public key is stored in an env variable named PUBLIC_KEY.
Types ¶
This section is empty.