Documentation
¶
Index ¶
- type AuthChallenge
- type AuthResult
- type FoundationSignatureService
- type Manager
- func (m *Manager) CreateAuthChallenge(address string) (*AuthChallenge, error)
- func (m *Manager) GenerateNonce() (string, error)
- func (m *Manager) GenerateToken(address string) (string, error)
- func (m *Manager) GetAddress() string
- func (m *Manager) SignMessage(message string) (string, error)
- func (m *Manager) ValidateAuthChallenge(challenge *AuthChallenge, signature string) (bool, error)
- func (m *Manager) ValidateToken(tokenString string) (*jwt.MapClaims, error)
- func (m *Manager) VerifySignature(message, signature, address string) (bool, error)
- type SignatureProvider
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 ¶
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 ¶
GenerateNonce generates a random nonce for authentication
func (*Manager) GenerateToken ¶
GenerateToken generates a JWT token for the given address
func (*Manager) GetAddress ¶
GetAddress returns the Ethereum address associated with this manager
func (*Manager) SignMessage ¶
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 ¶
ValidateToken validates a JWT token