Documentation ¶
Index ¶
- Constants
- func AdminMiddleware() gin.HandlerFunc
- func BasicMiddleware(engine engine.ClientInterface, appConfig *config.AppConfig) gin.HandlerFunc
- func CallbackTokenMiddleware(appConfig *config.AppConfig) gin.HandlerFunc
- func CorsMiddleware() gin.HandlerFunc
- func SignatureMiddleware(appConfig *config.AppConfig, requireSigning, adminRequired bool) gin.HandlerFunc
- type Payload
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
Click to show internal directories.
Click to hide internal directories.