auth

package
v0.0.0-...-c4ef61d Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildJWTForRESTAPI

func BuildJWTForRESTAPI(uri string) (string, error)

BuildJWTForRESTAPI is inspired by the code in this document https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-auth

func BuildJWTForWebSocketAPI

func BuildJWTForWebSocketAPI() (string, error)

func SetToken

func SetToken(req *http.Request, url string) error

SetToken sets the Authorization header in the request if not set already

Types

type APIKeyClaimsForRESTAPI

type APIKeyClaimsForRESTAPI struct {
	*jwt.Claims
	URI string `json:"uri"`
}

type APIKeyClaimsForWebSocketAPI

type APIKeyClaimsForWebSocketAPI struct {
	*jwt.Claims
}

Jump to

Keyboard shortcuts

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