authn

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ClientAuthnID_v1_0_0 = libp2pProtocol.ID("/xmtplabs/xmtp-v1/clientauthn/1.0.0")

Variables

View Source
var (
	ErrInvalidPeerId     = errors.New("invalid peerId")
	ErrInvalidWalletAddr = errors.New("invalid walletAddress")
	ErrInvalidSignature  = errors.New("invalid signature")
	ErrNoHandler         = errors.New("no handler found for given request version")
	ErrWalletMismatch    = errors.New("wallet address mismatch")
	ErrWrongPeerId       = errors.New("wrong peerId supplied")
)
View Source
var File_authn_proto protoreflect.FileDescriptor

Functions

func CreateIdentitySignRequest

func CreateIdentitySignRequest(identityBytes []byte) crypto.Message

Types

type AuthData

type AuthData struct {
	WalletAddr string `protobuf:"bytes,1,opt,name=wallet_addr,json=walletAddr,proto3" json:"wallet_addr,omitempty"`
	PeerId     string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
	Timestamp  uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthData) Descriptor deprecated

func (*AuthData) Descriptor() ([]byte, []int)

Deprecated: Use AuthData.ProtoReflect.Descriptor instead.

func (*AuthData) GetPeerId

func (x *AuthData) GetPeerId() string

func (*AuthData) GetTimestamp

func (x *AuthData) GetTimestamp() uint64

func (*AuthData) GetWalletAddr

func (x *AuthData) GetWalletAddr() string

func (*AuthData) ProtoMessage

func (*AuthData) ProtoMessage()

func (*AuthData) ProtoReflect

func (x *AuthData) ProtoReflect() protoreflect.Message

func (*AuthData) Reset

func (x *AuthData) Reset()

func (*AuthData) String

func (x *AuthData) String() string

type ClientAuthRequest

type ClientAuthRequest struct {

	// Types that are valid to be assigned to Version:
	//
	//	*ClientAuthRequest_V1
	Version isClientAuthRequest_Version `protobuf_oneof:"version"`
	// contains filtered or unexported fields
}

func (*ClientAuthRequest) Descriptor deprecated

func (*ClientAuthRequest) Descriptor() ([]byte, []int)

Deprecated: Use ClientAuthRequest.ProtoReflect.Descriptor instead.

func (*ClientAuthRequest) GetV1

func (*ClientAuthRequest) GetVersion

func (x *ClientAuthRequest) GetVersion() isClientAuthRequest_Version

func (*ClientAuthRequest) ProtoMessage

func (*ClientAuthRequest) ProtoMessage()

func (*ClientAuthRequest) ProtoReflect

func (x *ClientAuthRequest) ProtoReflect() protoreflect.Message

func (*ClientAuthRequest) Reset

func (x *ClientAuthRequest) Reset()

func (*ClientAuthRequest) String

func (x *ClientAuthRequest) String() string

type ClientAuthRequest_V1

type ClientAuthRequest_V1 struct {
	V1 *V1ClientAuthRequest `protobuf:"bytes,1,opt,name=v1,proto3,oneof"`
}

type ClientAuthResponse

type ClientAuthResponse struct {

	// Types that are valid to be assigned to Version:
	//
	//	*ClientAuthResponse_V1
	Version isClientAuthResponse_Version `protobuf_oneof:"version"`
	// contains filtered or unexported fields
}

func (*ClientAuthResponse) Descriptor deprecated

func (*ClientAuthResponse) Descriptor() ([]byte, []int)

Deprecated: Use ClientAuthResponse.ProtoReflect.Descriptor instead.

func (*ClientAuthResponse) GetV1

func (*ClientAuthResponse) GetVersion

func (x *ClientAuthResponse) GetVersion() isClientAuthResponse_Version

func (*ClientAuthResponse) ProtoMessage

func (*ClientAuthResponse) ProtoMessage()

func (*ClientAuthResponse) ProtoReflect

func (x *ClientAuthResponse) ProtoReflect() protoreflect.Message

func (*ClientAuthResponse) Reset

func (x *ClientAuthResponse) Reset()

func (*ClientAuthResponse) String

func (x *ClientAuthResponse) String() string

type ClientAuthResponse_V1

type ClientAuthResponse_V1 struct {
	V1 *V1ClientAuthResponse `protobuf:"bytes,1,opt,name=v1,proto3,oneof"`
}

type PublicKey

type PublicKey struct {
	Timestamp uint64     `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3,oneof" json:"signature,omitempty"`
	// Types that are valid to be assigned to Union:
	//
	//	*PublicKey_Secp256K1Uncompressed
	Union isPublicKey_Union `protobuf_oneof:"union"`
	// contains filtered or unexported fields
}

PublicKey represents a generalized public key, defined as a union to support cryptographic algorithm agility.

func (*PublicKey) Descriptor deprecated

func (*PublicKey) Descriptor() ([]byte, []int)

Deprecated: Use PublicKey.ProtoReflect.Descriptor instead.

func (*PublicKey) GetSecp256K1Uncompressed

func (x *PublicKey) GetSecp256K1Uncompressed() *Secp256K1Uncompresed

func (*PublicKey) GetSignature

func (x *PublicKey) GetSignature() *Signature

func (*PublicKey) GetTimestamp

func (x *PublicKey) GetTimestamp() uint64

func (*PublicKey) GetUnion

func (x *PublicKey) GetUnion() isPublicKey_Union

func (*PublicKey) ProtoMessage

func (*PublicKey) ProtoMessage()

func (*PublicKey) ProtoReflect

func (x *PublicKey) ProtoReflect() protoreflect.Message

func (*PublicKey) Reset

func (x *PublicKey) Reset()

func (*PublicKey) String

func (x *PublicKey) String() string

type PublicKey_Secp256K1Uncompressed

type PublicKey_Secp256K1Uncompressed struct {
	Secp256K1Uncompressed *Secp256K1Uncompresed `protobuf:"bytes,3,opt,name=secp256k1_uncompressed,json=secp256k1Uncompressed,proto3,oneof"`
}

type Secp256K1Uncompresed

type Secp256K1Uncompresed struct {

	// uncompressed point with prefix (0x04) [ P || X || Y ], 65 bytes
	Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"`
	// contains filtered or unexported fields
}

func (*Secp256K1Uncompresed) Descriptor deprecated

func (*Secp256K1Uncompresed) Descriptor() ([]byte, []int)

Deprecated: Use Secp256K1Uncompresed.ProtoReflect.Descriptor instead.

func (*Secp256K1Uncompresed) GetBytes

func (x *Secp256K1Uncompresed) GetBytes() []byte

func (*Secp256K1Uncompresed) ProtoMessage

func (*Secp256K1Uncompresed) ProtoMessage()

func (*Secp256K1Uncompresed) ProtoReflect

func (x *Secp256K1Uncompresed) ProtoReflect() protoreflect.Message

func (*Secp256K1Uncompresed) Reset

func (x *Secp256K1Uncompresed) Reset()

func (*Secp256K1Uncompresed) String

func (x *Secp256K1Uncompresed) String() string

type Signature

type Signature struct {

	// Types that are valid to be assigned to Union:
	//
	//	*Signature_EcdsaCompact
	Union isSignature_Union `protobuf_oneof:"union"`
	// contains filtered or unexported fields
}

Signature represents a generalized public key signature, defined as a union to support cryptographic algorithm agility.

func (*Signature) Descriptor deprecated

func (*Signature) Descriptor() ([]byte, []int)

Deprecated: Use Signature.ProtoReflect.Descriptor instead.

func (*Signature) GetEcdsaCompact

func (x *Signature) GetEcdsaCompact() *Signature_ECDSACompact

func (*Signature) GetUnion

func (x *Signature) GetUnion() isSignature_Union

func (*Signature) ProtoMessage

func (*Signature) ProtoMessage()

func (*Signature) ProtoReflect

func (x *Signature) ProtoReflect() protoreflect.Message

func (*Signature) Reset

func (x *Signature) Reset()

func (*Signature) String

func (x *Signature) String() string

type Signature_ECDSACompact

type Signature_ECDSACompact struct {
	Bytes    []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"`        // compact representation [ R || S ], 64 bytes
	Recovery uint32 `protobuf:"varint,2,opt,name=recovery,proto3" json:"recovery,omitempty"` // recovery bit
	// contains filtered or unexported fields
}

func (*Signature_ECDSACompact) Descriptor deprecated

func (*Signature_ECDSACompact) Descriptor() ([]byte, []int)

Deprecated: Use Signature_ECDSACompact.ProtoReflect.Descriptor instead.

func (*Signature_ECDSACompact) GetBytes

func (x *Signature_ECDSACompact) GetBytes() []byte

func (*Signature_ECDSACompact) GetRecovery

func (x *Signature_ECDSACompact) GetRecovery() uint32

func (*Signature_ECDSACompact) ProtoMessage

func (*Signature_ECDSACompact) ProtoMessage()

func (*Signature_ECDSACompact) ProtoReflect

func (x *Signature_ECDSACompact) ProtoReflect() protoreflect.Message

func (*Signature_ECDSACompact) Reset

func (x *Signature_ECDSACompact) Reset()

func (*Signature_ECDSACompact) String

func (x *Signature_ECDSACompact) String() string

type Signature_EcdsaCompact

type Signature_EcdsaCompact struct {
	EcdsaCompact *Signature_ECDSACompact `protobuf:"bytes,1,opt,name=ecdsa_compact,json=ecdsaCompact,proto3,oneof"`
}

type V1ClientAuthRequest

type V1ClientAuthRequest struct {
	IdentityKeyBytes []byte     `protobuf:"bytes,1,opt,name=identity_key_bytes,json=identityKeyBytes,proto3" json:"identity_key_bytes,omitempty"`
	WalletSignature  *Signature `protobuf:"bytes,2,opt,name=wallet_signature,json=walletSignature,proto3" json:"wallet_signature,omitempty"`
	AuthDataBytes    []byte     `protobuf:"bytes,3,opt,name=auth_data_bytes,json=authDataBytes,proto3" json:"auth_data_bytes,omitempty"`
	AuthSignature    *Signature `protobuf:"bytes,4,opt,name=auth_signature,json=authSignature,proto3" json:"auth_signature,omitempty"`
	// contains filtered or unexported fields
}

func (*V1ClientAuthRequest) Descriptor deprecated

func (*V1ClientAuthRequest) Descriptor() ([]byte, []int)

Deprecated: Use V1ClientAuthRequest.ProtoReflect.Descriptor instead.

func (*V1ClientAuthRequest) GetAuthDataBytes

func (x *V1ClientAuthRequest) GetAuthDataBytes() []byte

func (*V1ClientAuthRequest) GetAuthSignature

func (x *V1ClientAuthRequest) GetAuthSignature() *Signature

func (*V1ClientAuthRequest) GetIdentityKeyBytes

func (x *V1ClientAuthRequest) GetIdentityKeyBytes() []byte

func (*V1ClientAuthRequest) GetWalletSignature

func (x *V1ClientAuthRequest) GetWalletSignature() *Signature

func (*V1ClientAuthRequest) ProtoMessage

func (*V1ClientAuthRequest) ProtoMessage()

func (*V1ClientAuthRequest) ProtoReflect

func (x *V1ClientAuthRequest) ProtoReflect() protoreflect.Message

func (*V1ClientAuthRequest) Reset

func (x *V1ClientAuthRequest) Reset()

func (*V1ClientAuthRequest) String

func (x *V1ClientAuthRequest) String() string

type V1ClientAuthResponse

type V1ClientAuthResponse struct {
	AuthSuccessful bool   `protobuf:"varint,1,opt,name=auth_successful,json=authSuccessful,proto3" json:"auth_successful,omitempty"`
	ErrorStr       string `protobuf:"bytes,2,opt,name=error_str,json=errorStr,proto3" json:"error_str,omitempty"`
	// contains filtered or unexported fields
}

func (*V1ClientAuthResponse) Descriptor deprecated

func (*V1ClientAuthResponse) Descriptor() ([]byte, []int)

Deprecated: Use V1ClientAuthResponse.ProtoReflect.Descriptor instead.

func (*V1ClientAuthResponse) GetAuthSuccessful

func (x *V1ClientAuthResponse) GetAuthSuccessful() bool

func (*V1ClientAuthResponse) GetErrorStr

func (x *V1ClientAuthResponse) GetErrorStr() string

func (*V1ClientAuthResponse) ProtoMessage

func (*V1ClientAuthResponse) ProtoMessage()

func (*V1ClientAuthResponse) ProtoReflect

func (x *V1ClientAuthResponse) ProtoReflect() protoreflect.Message

func (*V1ClientAuthResponse) Reset

func (x *V1ClientAuthResponse) Reset()

func (*V1ClientAuthResponse) String

func (x *V1ClientAuthResponse) String() string

type XmtpAuthentication

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

func NewXmtpAuthentication

func NewXmtpAuthentication(ctx context.Context, h host.Host, log *zap.Logger) *XmtpAuthentication

func (*XmtpAuthentication) Start

func (xmtpAuth *XmtpAuthentication) Start()

Jump to

Keyboard shortcuts

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