auth

package
v1.0.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ParamXPubKey the request parameter for the xpub string
	ParamXPubKey = "xpub"

	// ParamXPubHashKey the request parameter for the xpub ID
	ParamXPubHashKey = "xpub_hash"

	// ParamAccessKey the request parameter for the xpub ID
	ParamAccessKey = "access_key"

	// ParamAdminRequest the request parameter whether this is an admin request
	ParamAdminRequest = "auth_admin"

	// ParamAuthSigned the request parameter that says whether the request was signed
	ParamAuthSigned = "auth_signed"
)

Variables

This section is empty.

Functions

func AdminMiddleware

func AdminMiddleware() gin.HandlerFunc

AdminMiddleware will check if the request is authorized with admin xpub

func BasicMiddleware

func BasicMiddleware(engine engine.ClientInterface, appConfig *config.AppConfig) gin.HandlerFunc

BasicMiddleware will check the request for the xPub or AccessKey header

func CallbackTokenMiddleware

func CallbackTokenMiddleware(appConfig *config.AppConfig) gin.HandlerFunc

CallbackTokenMiddleware verifies the callback token - if it's valid and matches the Bearer scheme.

func CorsMiddleware

func CorsMiddleware() gin.HandlerFunc

CorsMiddleware is a middleware that handles CORS.

func SignatureMiddleware

func SignatureMiddleware(appConfig *config.AppConfig, requireSigning, adminRequired bool) gin.HandlerFunc

SignatureMiddleware will check the request for a signature

Types

type Payload

type Payload struct {
	AuthHash     string `json:"auth_hash"`
	AuthNonce    string `json:"auth_nonce"`
	BodyContents string `json:"body_contents"`
	Signature    string `json:"signature"`

	AuthTime int64 `json:"auth_time"`
	// contains filtered or unexported fields
}

Payload is the authentication payload for checking or creating a signature

Jump to

Keyboard shortcuts

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