Documentation
¶
Index ¶
- Constants
- func CreateServerToken(userId string) (tokenString string, err error)
- func ParseKeyFunc(verificationKey string) func(token *jwt.Token) (interface{}, error)
- func ValidateFrameMessage(message FcFrameMessage) (bool, error)
- type Claims
- type FcCastID
- type FcFrameAction
- type FcFrameMessage
- type FcFrameMessageData
- type PrivyClaims
Constants ¶
View Source
const ( FC_SIGNER_ADDRESS_USER_ID_SOURCE = "fc_signer_address" PRIVY_DID_USER_ID_SOURCE = "privy_did" )
Variables ¶
This section is empty.
Functions ¶
func CreateServerToken ¶
func ParseKeyFunc ¶
func ValidateFrameMessage ¶
func ValidateFrameMessage(message FcFrameMessage) (bool, error)
*
- ValidateFrameMessage validates a frame request message was signed by the claimed signer *
- Unlike most frame/Farcaster validations, this one does not utilize
- a Farcaster Hub node to validate the linkage of the signer to the Fid.
- Thus...
- - We do not need to make a Hub request or maintain a Hub
- - We do not have validation of the claimed Fid *
- @param message - The frame request message to validate
- @return bool - True if the message was signed by the claimed signer
- @return error - An error if the message was not signed by the claimed signer
Types ¶
type Claims ¶
type Claims struct { Expiration uint64 `json:"exp,omitempty"` Issuer string `json:"iss,omitempty"` UserId string `json:"sub,omitempty"` }
Defining a Go type for JWTs issued by this server
func ValidateServerToken ¶
type FcFrameAction ¶
type FcFrameMessage ¶
type FcFrameMessageData ¶
type PrivyClaims ¶
type PrivyClaims struct { AppId string `json:"aud,omitempty"` Expiration uint64 `json:"exp,omitempty"` Issuer string `json:"iss,omitempty"` UserId string `json:"sub,omitempty"` }
Defining a Go type for Privy JWTs
func PrivyAppValidateToken ¶
func PrivyAppValidateToken(jwtToken string) (privyClaims *PrivyClaims, err error)
func PrivyValidateToken ¶
func PrivyValidateToken(jwtToken string, appId string, verificationKey string) (privyClaims *PrivyClaims, err error)
func (*PrivyClaims) Valid ¶
func (c *PrivyClaims) Valid() error
This method will be used to check the token's claims later
func (*PrivyClaims) ValidateApp ¶
func (c *PrivyClaims) ValidateApp(AppId string) error
Click to show internal directories.
Click to hide internal directories.