dfp

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2017 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

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

func (r *Request) ConfirmDfp(c *sa.Client, userID string, fingerprintID string) (*Response, error)

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

func (r *Request) Get(c *sa.Client, endpoint string) (*Response, error)

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

func (r *Request) GetDfpJs(c *sa.Client) (*Response, error)

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

func (r *Request) Post(c *sa.Client, endpoint string) (*Response, error)

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

func (r *Response) IsSignatureValid(c *sa.Client) (bool, error)

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.

Jump to

Keyboard shortcuts

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