auth

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthChallenge

type AuthChallenge struct {
	Address   string `json:"address"`
	Nonce     string `json:"nonce"`
	Timestamp int64  `json:"timestamp"`
	ExpiresAt int64  `json:"expires_at"`
}

AuthChallenge represents an authentication challenge

type AuthResult

type AuthResult struct {
	Success   bool   `json:"success"`
	Token     string `json:"token,omitempty"`
	Address   string `json:"address,omitempty"`
	Error     string `json:"error,omitempty"`
	ExpiresAt int64  `json:"expires_at,omitempty"`
}

AuthResult represents the result of an authentication attempt

type FoundationSignatureService

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

FoundationSignatureService simulates the foundation signature service

func NewFoundationSignatureService

func NewFoundationSignatureService(privateKeyHex string) (*FoundationSignatureService, error)

NewFoundationSignatureService creates a new foundation signature service

func (*FoundationSignatureService) GetAddress

func (f *FoundationSignatureService) GetAddress() string

GetAddress returns the foundation signer address

func (*FoundationSignatureService) SignMintRequest

func (f *FoundationSignatureService) SignMintRequest(
	userAddress string,
	name string,
	description string,
	capabilities []string,
	contactInfo string,
	pricingModel string,
	interfaceType string,
	responseFormat string,
	version string,
	sdkVersion string,
	nonce uint64,
) (string, error)

SignMintRequest signs a mint request for NFT creation

type Manager

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

Manager handles authentication for Teneo agents

func NewManager

func NewManager(privateKeyHex string) (*Manager, error)

NewManager creates a new authentication manager

func (*Manager) CreateAuthChallenge

func (m *Manager) CreateAuthChallenge(address string) (*AuthChallenge, error)

CreateAuthChallenge creates an authentication challenge

func (*Manager) GenerateNonce

func (m *Manager) GenerateNonce() (string, error)

GenerateNonce generates a random nonce for authentication

func (*Manager) GenerateToken

func (m *Manager) GenerateToken(address string) (string, error)

GenerateToken generates a JWT token for the given address

func (*Manager) GetAddress

func (m *Manager) GetAddress() string

GetAddress returns the Ethereum address associated with this manager

func (*Manager) SignMessage

func (m *Manager) SignMessage(message string) (string, error)

SignMessage signs a message with the agent's private key

func (*Manager) ValidateAuthChallenge

func (m *Manager) ValidateAuthChallenge(challenge *AuthChallenge, signature string) (bool, error)

ValidateAuthChallenge validates an authentication challenge response

func (*Manager) ValidateToken

func (m *Manager) ValidateToken(tokenString string) (*jwt.MapClaims, error)

ValidateToken validates a JWT token

func (*Manager) VerifySignature

func (m *Manager) VerifySignature(message, signature, address string) (bool, error)

VerifySignature verifies a signature against a message and address

type SignatureProvider

type SignatureProvider interface {
	SignMessage(message string) (string, error)
	GetAddress() string
}

SignatureProvider interface for different signature providers

Jump to

Keyboard shortcuts

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