Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrHTTPStatusCodeIsNotOK = errors.New("HTTP status code is not OK")
ErrHTTPStatusCodeIsNotOK signals that the returned HTTP status code is not OK
var ErrInvalidValue = errors.New("invalid value")
ErrInvalidValue signals that an invalid value has been provided
var ErrNilAddress = errors.New("nil token address")
ErrNilAddress signals that the token has a nil address
var ErrNilBody = errors.New("nil token body")
ErrNilBody signals that the token has a nil body
var ErrNilCacher = errors.New("nil cacher")
ErrNilCacher signals that a nil cacher has been provided
var ErrNilCryptoComponentsHolder = errors.New("nil cryptoComponentsHolder")
ErrNilCryptoComponentsHolder signals that a nil cryptoComponentsHolder has been provided
var ErrNilHttpClientWrapper = errors.New("nil http client wrapper")
ErrNilHttpClientWrapper signals that a nil http client wrapper was provided
var ErrNilSignature = errors.New("nil token signature")
ErrNilSignature signals that the token has a nil signature
var ErrNilSigner = errors.New("nil signer")
ErrNilSigner signals that a nil signer has been provided
var ErrNilTokenHandler = errors.New("nil token handler")
ErrNilTokenHandler signals that a nil token handler has been provided
var ErrTokenExpired = errors.New("token expired")
ErrTokenExpired signals that the provided token is expired
Functions ¶
func CreateHTTPStatusError ¶ added in v1.3.3
CreateHTTPStatusError creates an error with the provided http status code and error
Types ¶
type AuthClient ¶
AuthClient defines the behavior of an authentication client
type AuthServer ¶ added in v1.3.3
AuthServer defines the behavior of an authentication server
type AuthToken ¶ added in v1.3.3
type AuthToken interface { GetTtl() int64 GetAddress() []byte GetHost() []byte GetSignature() []byte GetBlockHash() string GetExtraInfo() []byte IsInterfaceNil() bool }
AuthToken defines the behavior of an authentication token
type AuthTokenHandler ¶ added in v1.3.3
type AuthTokenHandler interface { Decode(accessToken string) (AuthToken, error) Encode(authToken AuthToken) (string, error) GetUnsignedToken(authToken AuthToken) []byte GetSignableMessage(address, unsignedToken []byte) []byte GetSignableMessageLegacy(address, unsignedToken []byte) []byte IsInterfaceNil() bool }
AuthTokenHandler defines the behavior of an authentication token handler
type HttpClientWrapper ¶ added in v1.3.3
type HttpClientWrapper interface { GetHTTP(ctx context.Context, endpoint string) ([]byte, int, error) PostHTTP(ctx context.Context, endpoint string, data []byte) ([]byte, int, error) IsInterfaceNil() bool }
HttpClientWrapper defines the behavior of http client able to make http requests