protoauth

package
v0.0.0-...-2c4dd60 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ProtocolName = "protoauth"

Variables

This section is empty.

Functions

func GenerateChallengeMsg

func GenerateChallengeMsg() ([]byte, error)

func NewAuthProtocol

func NewAuthProtocol(transports []swarm.Transport, keyStore identity.KeyStore, peerStore swarm.PeerStore) *authProtocol

Types

type AuthPeerConn

type AuthPeerConn interface {
	swarm.PeerConn
	ChallengeIdentity(challengeMsg ChallengeMsg) error
	RespondChallengeIdentity(verifyAddressResponse []ChallengeIdentityResponse) error
	ReceiveChallengeIdentityResponse() ([]ChallengeIdentityResponse, error)
}

type AuthProtocol

type AuthProtocol interface {
	process.Interface
	ChallengePeerIdentity(ctx context.Context, peerConn AuthPeerConn) (err error)
}

type AuthTransport

type AuthTransport interface {
	swarm.Transport
	OnChallengeIdentity(handler ChallengeIdentityCallback)
}

type BaseAuthTransport

type BaseAuthTransport struct {
	// contains filtered or unexported fields
}

func (*BaseAuthTransport) HandleChallengeIdentity

func (t *BaseAuthTransport) HandleChallengeIdentity(challengeMsg ChallengeMsg, peerConn AuthPeerConn) error

func (*BaseAuthTransport) OnChallengeIdentity

func (t *BaseAuthTransport) OnChallengeIdentity(handler ChallengeIdentityCallback)

type ChallengeIdentityCallback

type ChallengeIdentityCallback func(challengeMsg ChallengeMsg, peerConn AuthPeerConn) error

type ChallengeIdentityResponse

type ChallengeIdentityResponse struct {
	Signature     []byte `json:"signature"`
	AsymEncPubkey []byte `json:"encryptingPublicKey"`
}

type ChallengeMsg

type ChallengeMsg []byte

func (ChallengeMsg) MarshalJSON

func (c ChallengeMsg) MarshalJSON() ([]byte, error)

func (*ChallengeMsg) UnmarshalJSON

func (c *ChallengeMsg) UnmarshalJSON(bs []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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