Documentation ¶
Index ¶
- type Request
- func (r *Request) ConfirmDfp(c *sa.Client, userID string, fingerprintID string) (*Response, error)
- func (r *Request) Get(c *sa.Client, endpoint string) (*Response, error)
- func (r *Request) GetDfpJs(c *sa.Client) (*Response, error)
- func (r *Request) Post(c *sa.Client, endpoint string) (*Response, error)
- func (r *Request) SaveDfp(c *sa.Client, userID string, hostAddress string, fingerprintID string, ...) (*Response, error)
- func (r *Request) ScoreDfp(c *sa.Client, userID string, hostAddress string, fingerprintID string, ...) (*Response, error)
- func (r *Request) ValidateDfp(c *sa.Client, userID string, hostAddress string, fingerprintID string, ...) (*Response, error)
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct { UserID string `json:"user_id,omitempty"` HostAddress string `json:"host_address,omitempty"` FingerprintID string `json:"fingerprint_id,omitempty"` Fingerprint map[string]interface{} `json:"fingerprint,omitempty"` }
Request :
Request struct to build the required post parameters.
Fields:
[Required] UserID: the username that you wish to validate a fingerprint for. HostAddress: the IP Address of the user. FingerprintID: used to validate known fingerprint or confirm a fingerprint. Fingerprint: fingerprint value struct required to validate a fingerprint.
func (*Request) ConfirmDfp ¶
ConfirmDfp :
Helper function for posting to the dfp validate endpoint.
Parameters:
[Required] c: passing in the client containing authorization and host information. [Required] userID: the username of the user you wish to confirm a dfp for. [Required] fingerprintId: the fingerprint id of the fingerprint you wish to confirm.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.
func (*Request) Get ¶
Get :
Executes a get to the dfp/js endpoint.
Parameters:
[Required] r: struct used to perform get request. [Required] c: passing in the client containing authorization and host information. endpoint: the endpoint for the get request.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.
func (*Request) GetDfpJs ¶
GetDfpJs :
Helper function for Get request to retrieve the fingerprint javascript source.
Parameters:
[Required] c: passing in the client containing authorization and host information.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.
func (*Request) Post ¶
Post :
Executes a post to the dfp endpoint.
Parameters:
[Required] r: should have all required fields of the struct populated before using. [Required] c: passing in the client containing authorization and host information. [Required] endpoint: the endpoint for the post request.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.
func (*Request) SaveDfp ¶ added in v1.1.0
func (r *Request) SaveDfp(c *sa.Client, userID string, hostAddress string, fingerprintID string, fingerprint string) (*Response, error)
SaveDfp :
Helper function for posting to the dfp validate endpoint.
Parameters:
[Required] c: passing in the client containing authorization and host information. [Required] userID: the username of the user you wish to validate a dfp for. [Required] hostAddress: the ip address of the user's device. fingerprintId: if it is a known fingerprint, provide the fingerprint id to validate against. [Required] fingerprint: the json string returned by the javascript dfp script.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.
func (*Request) ScoreDfp ¶ added in v1.1.0
func (r *Request) ScoreDfp(c *sa.Client, userID string, hostAddress string, fingerprintID string, fingerprint string) (*Response, error)
ScoreDfp :
Helper function for posting to the dfp validate endpoint.
Parameters:
[Required] c: passing in the client containing authorization and host information. [Required] userID: the username of the user you wish to validate a dfp for. [Required] hostAddress: the ip address of the user's device. fingerprintId: if it is a known fingerprint, provide the fingerprint id to validate against. [Required] fingerprint: the json string returned by the javascript dfp script.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.
func (*Request) ValidateDfp ¶
func (r *Request) ValidateDfp(c *sa.Client, userID string, hostAddress string, fingerprintID string, fingerprint string) (*Response, error)
ValidateDfp :
Helper function for posting to the dfp validate endpoint.
Parameters:
[Required] c: passing in the client containing authorization and host information. [Required] userID: the username of the user you wish to validate a dfp for. [Required] hostAddress: the ip address of the user's device. fingerprintId: if it is a known fingerprint, provide the fingerprint id to validate against. [Required] fingerprint: the json string returned by the javascript dfp script.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.
type Response ¶
type Response struct { FingerprintID string `json:"fingerprint_id,omitempty"` FingerprintName string `json:"fingerprint_name,omitempty"` Score string `json:"score,omitempty"` MatchScore string `json:"match_score,omitempty"` UpdateScore string `json:"update_score,omitempty"` Status string `json:"status"` Message string `json:"message"` UserID string `json:"user_id,omitempty"` Source string `json:"src,omitempty"` RawJSON string `json:"-"` HTTPResponse *http.Response `json:"-"` }
Response :
Response struct that will be populated after the post request.
func (*Response) IsSignatureValid ¶ added in v1.1.0
IsSignatureValid :
Helper function to validate the SecureAuth Response signature in X-SA-SIGNATURE
Parameters:
[Required] r: response struct with HTTPResponse [Required] c: passing in the client with application id and key
Returns:
bool: if true, computed signature matches X-SA-SIGNATURE. if false, computed signature does not match. error: If an error is encountered, bool will be false and the error must be handled.
Click to show internal directories.
Click to hide internal directories.