Documentation ¶
Index ¶
- func NewAuthTokenHandler() *authTokenHandler
- func NewNativeAuthClient(args ArgsNativeAuthClient) (*authClient, error)
- func NewNativeAuthServer(args ArgsNativeAuthServer) (*authServer, error)
- type ArgsNativeAuthClient
- type ArgsNativeAuthServer
- type AuthToken
- func (token *AuthToken) GetAddress() []byte
- func (token *AuthToken) GetBlockHash() string
- func (token *AuthToken) GetExtraInfo() []byte
- func (token *AuthToken) GetHost() []byte
- func (token *AuthToken) GetSignature() []byte
- func (token *AuthToken) GetTtl() int64
- func (token *AuthToken) IsInterfaceNil() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuthTokenHandler ¶
func NewAuthTokenHandler() *authTokenHandler
NewAuthTokenHandler returns a new instance of a native authentication token handler
func NewNativeAuthClient ¶
func NewNativeAuthClient(args ArgsNativeAuthClient) (*authClient, error)
NewNativeAuthClient will create a new native client able to create authentication tokens
func NewNativeAuthServer ¶
func NewNativeAuthServer(args ArgsNativeAuthServer) (*authServer, error)
NewNativeAuthServer returns a native authentication server that verifies authentication tokens: 1. Checks whether the provided signature from tokens corresponds with the provided address for the provided body 2. Checks the token expiration status
Types ¶
type ArgsNativeAuthClient ¶
type ArgsNativeAuthClient struct { Signer builders.Signer ExtraInfo struct{} Proxy workflows.ProxyHandler CryptoComponentsHolder core.CryptoComponentsHolder TokenHandler authentication.AuthTokenHandler TokenExpiryInSeconds int64 Host string }
ArgsNativeAuthClient is the DTO used in the native auth client constructor
type ArgsNativeAuthServer ¶
type ArgsNativeAuthServer struct { HttpClientWrapper authentication.HttpClientWrapper TokenHandler authentication.AuthTokenHandler Signer builders.Signer PubKeyConverter core.PubkeyConverter KeyGenerator crypto.KeyGenerator TimestampsCacher storage.Cacher }
ArgsNativeAuthServer is the DTO used in the native auth server constructor
type AuthToken ¶
type AuthToken struct {
// contains filtered or unexported fields
}
AuthToken is the native authentication token implementation
func (*AuthToken) GetAddress ¶
GetAddress is the getter to address member
func (*AuthToken) GetBlockHash ¶
GetBlockHash is the getter to blockHash member
func (*AuthToken) GetExtraInfo ¶
GetExtraInfo is the getter to extraInfo member
func (*AuthToken) GetSignature ¶
GetSignature is the getter to signature member
func (*AuthToken) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface