Documentation
¶
Index ¶
- Constants
- Variables
- func CleanHookName(name string) string
- func GenKey(masterkey, salt []byte) ([]byte, error)
- func GenSig(key, msg []byte) []byte
- func GetEventDeliveryFromHeaderIter(seq iter.Seq2[[]byte, []byte]) []byte
- func GetEventTypeFromHeaderIter(seq iter.Seq2[[]byte, []byte]) []byte
- func GetSigFromHeaderIter(seq iter.Seq2[[]byte, []byte]) []byte
- func HookId(name string) string
- func MatchJson(match, target any) bool
- func ReadEnvFile(name string, env []string) ([]string, error)
- func VerifySig(key, sig, msg []byte) bool
- type ArgType
- type Args
- type Data
- type Hook
- type Hooker
Constants ¶
View Source
const (
PurposeHookKey = "webhooker hook key"
)
Purpose strings for HKDF. Shouldn't be changed.
Variables ¶
Functions ¶
func CleanHookName ¶
func GenKey ¶
Generate a secret key for a hook with its salt.
You may wipe the key, as you can generate it again.
Types ¶
type Args ¶
type Data ¶
func NewData ¶
Make sure to call Data.Close to wipe master key on program exit.
func (*Data) KeyForHook ¶
Should clean up name with CleanHookName before calling this.
func (*Data) MasterKey ¶
Get the internal master key.
Don't wipe the returned key, as it's shared. Use Data.Close instead.
type Hook ¶
Click to show internal directories.
Click to hide internal directories.