native

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: GPL-3.0 Imports: 18 Imported by: 1

Documentation

Index

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

func (token *AuthToken) GetAddress() []byte

GetAddress is the getter to address member

func (*AuthToken) GetBlockHash

func (token *AuthToken) GetBlockHash() string

GetBlockHash is the getter to blockHash member

func (*AuthToken) GetExtraInfo

func (token *AuthToken) GetExtraInfo() []byte

GetExtraInfo is the getter to extraInfo member

func (*AuthToken) GetHost

func (token *AuthToken) GetHost() []byte

GetHost is the getter to host member

func (*AuthToken) GetSignature

func (token *AuthToken) GetSignature() []byte

GetSignature is the getter to signature member

func (*AuthToken) GetTtl

func (token *AuthToken) GetTtl() int64

GetTtl is the getter to ttl member

func (*AuthToken) IsInterfaceNil

func (token *AuthToken) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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