ipeval

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FactorDescription

type FactorDescription struct {
	GeoContinent      string `json:"geoContinent,omitempty"`
	GeoCountry        string `json:"geoCountry,omitempty"`
	GeoCountryCode    string `json:"geoCountryCode,omitempty"`
	GeoCountryCF      string `json:"geoCountryCF,omitempty"`
	GeoRegion         string `json:"geoRegion,omitempty"`
	GeoState          string `json:"geoState,omitempty"`
	GeoStateCode      string `json:"geoStateCode,omitempty"`
	GeoStateCF        string `json:"geoStateCF,omitempty"`
	GeoCity           string `json:"geoCity,omitempty"`
	GeoCityCF         string `json:"geoCityCF,omitempty"`
	GeoPostalCode     string `json:"geoPostalCode,omitempty"`
	GeoAreaCode       string `json:"geoAreaCode,omitempty"`
	GeoTimeZone       string `json:"geoTimeZone,omitempty"`
	GeoLatitude       string `json:"geoLatitude,omitempty"`
	GeoLongitude      string `json:"geoLongitude,omitempty"`
	Dma               string `json:"dma,omitempty"`
	Msa               string `json:"msa,omitempty"`
	ConnectionType    string `json:"connectionType,omitempty"`
	LineSpeed         string `json:"lineSpeed,omitempty"`
	IPRoutingType     string `json:"ipRoutingType,omitempty"`
	GeoAsn            string `json:"geoAsn,omitempty"`
	Sld               string `json:"sld,omitempty"`
	Tld               string `json:"tld,omitempty"`
	Organization      string `json:"organization,omitempty"`
	Carrier           string `json:"carrier,omitempty"`
	AnonymizerStatus  string `json:"anonymizer_status,omitempty"`
	ProxyLevel        string `json:"proxyLevel,omitempty"`
	ProxyType         string `json:"proxyType,omitempty"`
	ProxyLastDetected string `json:"proxyLastDetected,omitempty"`
	HostingFacility   string `json:"hostingFacility,omitempty"`
	ThreatType        string `json:"threatType,omitempty"`
	ThreatCategory    string `json:"threatCategory,omitempty"`
}

FactorDescription :

Struct providing data from the post request.

type Factoring

type Factoring struct {
	Latitude       float32 `json:"latitude,omitempty"`
	Longitude      float32 `json:"longitude,omitempty"`
	ThreatType     float32 `json:"threatType,omitempty"`
	ThreatCategory float32 `json:"threatCategory,omitempty"`
}

Factoring :

Struct providing data from the post request.

type GeoLoc

type GeoLoc struct {
	Country      string `json:"country,omitempty"`
	CountryCode  string `json:"country_code,omitempty"`
	Region       string `json:"region,omitempty"`
	RegionCode   string `json:"region_code,omitempty"`
	City         string `json:"city,omitempty"`
	Latitude     string `json:"latitude,omitempty"`
	Longtitude   string `json:"longtitude,omitempty"`
	Isp          string `json:"internet_service_provider,omitempty"`
	Organization string `json:"organization,omitempty"`
}

GeoLoc :

Struct providing data from the post request.

type IPEvaluation

type IPEvaluation struct {
	Method        string            `json:"method,omitempty"`
	IP            string            `json:"ip,omitempty"`
	RiskFactor    float32           `json:"risk_factor,omitempty"`
	RiskColor     string            `json:"risk_color,omitempty"`
	RiskDesc      string            `json:"risk_desc,omitempty"`
	GeoLoc        GeoLoc            `json:"geoloc,omitempty"`
	Factoring     Factoring         `json:"factoring,omitempty"`
	FactoringDesc FactorDescription `json:"factor_description,omitempty"`
	Status        string            `json:"status,omitempty"`
	Message       string            `json:"message,omitempty"`
}

IPEvaluation :

Struct providing data from the post request.

type Request

type Request struct {
	UserID    string `json:"user_id"`
	EvalType  string `json:"type"`
	IPAddress string `json:"ip_address"`
}

Request :

Request struct to build the required post parameters.

Fields:

[Required] UserId: the username that you want to evaluate.
[Required] EvalType: currently, only 'risk' is supported. Sets the eval type.
[Required] IpAddress: the IP Address of the user to be evaluated.

func (*Request) EvaluateIP

func (r *Request) EvaluateIP(c *sa.Client, userID string, ipAddress string) (*Response, error)

EvaluateIP :

Helper function for making IpEval Posts

Parameters:

[Required] c: passing in the client containing authorization and host information.
[Required] userId: the user you wish to evaluate via adaptive auth.
[Required] ipAddress: the ip address of the user being evaluated.

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) (*Response, error)

Post :

Executes a post to the adaptauth endpoint.

Parameters:

[Required] r: should have all the required fields of the struct populated before using.
[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.

type Response

type Response struct {
	IPEvaluation IPEvaluation   `json:"ip_evaluation,omitempty"`
	HTTPResponse *http.Response `json:"-,omitempty"`
}

Response :

Response struct that will be populated after the post request.

Jump to

Keyboard shortcuts

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