Documentation ¶
Index ¶
- type BehaviorBioResults
- type Request
- func (r *Request) Get(c *sa.Client, endpoint string) (*Response, error)
- func (r *Request) GetBehaveJs(c *sa.Client) (*Response, error)
- func (r *Request) Post(c *sa.Client, endpoint string) (*Response, error)
- func (r *Request) PostBehaveProfile(c *sa.Client, userID string, behaveProfile string, hostAddress string, ...) (*Response, error)
- func (r *Request) Put(c *sa.Client, endpoint string) (*Response, error)
- func (r *Request) ResetBehaveProfile(c *sa.Client, userID string, fieldName string, fieldType string, ...) (*Response, error)
- type Response
- type Results
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BehaviorBioResults ¶
type BehaviorBioResults struct { TotalScore float32 `json:"TotalScore,omitempty"` TotalConfidence float32 `json:"TotalConfidence,omitempty"` Device string `json:"Device,omitempty"` Results []Results `json:"Results,omitempty"` }
BehaviorBioResults :
Details for the behavior bio results
type Request ¶
type Request struct { UserID string `json:"userId,omitempty"` BehaviorProfile string `json:"behaviorProfile,omitempty"` HostAddress string `json:"hostAddress,omitempty"` UserAgent string `json:"userAgent,omitempty"` FieldName string `json:"fieldName,omitempty"` FieldType string `json:"fieldType,omitempty"` DeviceType string `json:"deviceType,omitempty"` }
Request :
Request struct to build required post parameters.
Fields:
[Required] UserID: the username that you wish to submit a behaviobiometrics for. BehaviorProfile: json string from the behavioBio javascript source. HostAddress: the ip address of the user your are validating. UserAgent: the user agent the user is using in the request. FieldName: used for resetting the behavio profile. FieldType: used for resetting the behavio profile. DeviceType: used for the resetting the behavio profile.
func (*Request) Get ¶
Get :
Executes a get to the behaviobio javascript endpoint.
Parameters:
[Required] r: request struct to make get easy. should be empty for the use in get operations [Required] c: passing in the client containing authorization and host information. [Required] 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) GetBehaveJs ¶
GetBehaveJs :
Helper function for Get request to retrieve the behaviorbiometrics 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 behavioBio endpoint.
Parameters:
[Required] r: should have all the required fields for the post type. [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) PostBehaveProfile ¶
func (r *Request) PostBehaveProfile(c *sa.Client, userID string, behaveProfile string, hostAddress string, userAgent string) (*Response, error)
PostBehaveProfile :
Helper function for posting to the behaviobio endpoint.
Parameters:
[Required] c: passing in the client containing authorization and host information. [Required] userID: the username of the user you wish to post behaviobio to. [Required] behaveProfile: from the behavioBio javascript, a json string. [Required] hostAddress: the ip address of the user's host. [Required] userAgent: the user's userAgent string from their 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) Put ¶
Put :
Executes a put to the behavioBio endpoint.
Parameters:
[Required] r: should have all the required fields for the put type. [Required] c: passing in the client containing authorization and host information. [Required] endpoint: the endpoint for the put 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) ResetBehaveProfile ¶
func (r *Request) ResetBehaveProfile(c *sa.Client, userID string, fieldName string, fieldType string, deviceType string) (*Response, error)
ResetBehaveProfile :
Helper function for putting to the behaviobio endpoint.
Parameters:
[Required] c: passing in the client containing authorization and host information. [Required] userID: the username of the user you wish to put behaviobio to. [Required] fieldName: name of field to reset (unique to application); or set to ALL for global reset. [Required] fieldType: Type of field, either regulartext (actual values stored in profile) or anonymoustext (no actual values stored in profile, e.g. password entries); or set to ALL for global reset. [Required] deviceType: Type of device used by user (Desktop or Mobile); or set to ALL for global reset.
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 { Source string `json:"src,omitempty"` BehaviorResults BehaviorBioResults `json:"BehaviorBioResults,omitempty"` Status string `json:"status"` Message string `json:"message"` RawJSON string `json:"-"` HTTPResponse *http.Response `json:"-"` }
Response :
Response struct that will be populated after the post request.
func (*Response) IsSignatureValid ¶
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.