Documentation
¶
Index ¶
- Constants
- func GenerateAPIToken(dataDir, tokenFilename string) (string, error)
- func GetAndValidateAPIToken(dataDir, tokenFilename string) (string, error)
- func ValidateAPIToken(apiToken string) error
- func ValidateOrGenerateAPIToken(dataDir, tokenFilename string) (apiToken string, wroteToken bool, err error)
Constants ¶
View Source
const ( AlgodTokenFilename = "algod.token" AlgodAdminTokenFilename = "algod.admin.token" KmdTokenFilename = "kmd.token" )
API tokens that live in the datadirs of their respective daemons
Variables ¶
This section is empty.
Functions ¶
func GenerateAPIToken ¶
GenerateAPIToken writes a cryptographically secure APIToken to disk
func GetAndValidateAPIToken ¶
GetAndValidateAPIToken reads the APIToken from the token file and validates it. Always returns the potentially invalid token along with the error
func ValidateAPIToken ¶
ValidateAPIToken returns a non-nil error if the passed APIToken fails our validation checks
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.