discordsign

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 7 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL