tokens

package
v0.0.0-...-15eb78e Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

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

func GenerateAPIToken(dataDir, tokenFilename string) (string, error)

GenerateAPIToken writes a cryptographically secure APIToken to disk

func GetAndValidateAPIToken

func GetAndValidateAPIToken(dataDir, tokenFilename string) (string, error)

GetAndValidateAPIToken reads the APIToken from the token file and validates it. Always returns the potentially invalid token along with the error GetAndValidateAPIToken은 토큰 파일에서 APIToken을 읽고 유효성을 검사합니다. 항상 오류와 함께 잠재적으로 유효하지 않은 토큰을 반환합니다.

func ValidateAPIToken

func ValidateAPIToken(apiToken string) error

ValidateAPIToken returns a non-nil error if the passed APIToken fails our validation checks

func ValidateOrGenerateAPIToken

func ValidateOrGenerateAPIToken(dataDir, tokenFilename string) (apiToken string, wroteToken bool, err error)

ValidateOrGenerateAPIToken generates an APIToken if it does not exist, and checks that any set token is valid

Types

This section is empty.

Jump to

Keyboard shortcuts

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