check

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package check contains tools to validate the signatures for DDAPI requests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONSchema

func JSONSchema(pm map[string]interface{}, s string) error

JSONSchema a json-schema based params checker

Types

type Params

type Params func(pm map[string]interface{}, s string) error

Params a params checker

func (Params) Check

func (f Params) Check(pm map[string]interface{}, s string) error

Check checks if the params are valid

type ParamsChecker

type ParamsChecker interface {
	Check(pm map[string]interface{}, schema string) error
}

ParamsChecker represents a param collection validator

type Signature

type Signature func(payload, signature []byte) error

Signature checker function type

func Sha256HMAC

func Sha256HMAC(secret []byte) Signature

Sha256HMAC returns a hmac/sha256 base query validator

func (Signature) Check

func (f Signature) Check(p, s []byte) error

Check checks the signature of a given payload

type SignatureChecker

type SignatureChecker interface {
	Check(payload, signature []byte) error
}

SignatureChecker represents a payload signature Checker

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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