client

package
v0.2.30 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Copyright (c) 2023 Take 2 Identity, Inc

Copyright (c) 2023 Take 2 Identity, Inc

Index

Constants

View Source
const (
	RELEASES_URL = "https://gitlab.com/443id/public/verosint/-/releases/permalink/latest"
)

Variables

View Source
var (
	BuildVersion  = build.Version()
	VersionClient = resty.New().SetHeader("User-Agent", USER_AGENT+build.Version()).
					SetRetryCount(1).
					SetRetryWaitTime(1 * time.Second).
					SetRetryMaxWaitTime(5 * time.Second).
					SetTimeout(10 * time.Second).
					SetRedirectPolicy(resty.RedirectPolicyFunc(func(r1 *http.Request, r2 []*http.Request) error {
			return errors.New(redirectErr)
		}))
)
View Source
var (
	BASE_URL             = "https://api.verosint.com"
	RISK_SCORE_PATH      = "/v1/score/risk"
	RULE_EVALUTION_PATH  = "/v1/rules/evaluate"
	EVENT_INGESTION_PATH = "/v1/signalprint/events"
	ACCOUNT_TAG_PATH     = "/v1/accounts"
	USER_AGENT           = "verosint-cli/"
)

Functions

This section is empty.

Types

type DefaultOutComes

type DefaultOutComes struct {
	Outcomes []string `json:"outcomes"`
}

type EvaluationErrors

type EvaluationErrors struct {
	Error string `json:"error,omitempty"`
	Rule  Rule   `json:"rule,omitempty"`
}

type EvaluationResult

type EvaluationResult struct {
	RequestId string                            `json:"requestId,omitempty"`
	Outcomes  []string                          `json:"outcomes,omitempty"`
	Reasons   []string                          `json:"reasons,omitempty"`
	Errors    []EvaluationErrors                `json:"errors,omitempty"`
	Error     string                            `json:"error,omitempty"`
	Signals   map[string]map[string]interface{} `json:"signals,omitempty"`
}

type EventIngestionRequest

type EventIngestionRequest []Identifiers

type EventIngestionResponse

type EventIngestionResponse struct {
	RequestId string `json:"requestId,omitempty"`
	Error     string `json:"error,omitempty"`
}

type Identifiers

type Identifiers map[string]string

type Operation added in v0.2.27

type Operation struct {
	Op    string   `json:"op"`
	Path  string   `json:"path"`
	Value []string `json:"value,omitempty"`
}

type Patch added in v0.2.27

type Patch struct {
	Operations []Operation `json:"operations"`
}

type PatchResponse added in v0.2.27

type PatchResponse struct {
	Tags      []string `json:"tags,omitempty"`
	RequestId string   `json:"requestId,omitempty"`
	Error     string   `json:"error,omitempty"`
}

type RiskScoreClient

type RiskScoreClient struct {
	// contains filtered or unexported fields
}

func New

func New(apiKey string) *RiskScoreClient

func (*RiskScoreClient) EvaluateRules

func (r *RiskScoreClient) EvaluateRules(ctx context.Context, request RulesEvaluationRequest) *EvaluationResult

func (*RiskScoreClient) GetScore

func (r *RiskScoreClient) GetScore(ctx context.Context, request Identifiers) *ScoreResult

func (*RiskScoreClient) IngestEvents

func (*RiskScoreClient) PatchTags added in v0.2.27

func (r *RiskScoreClient) PatchTags(ctx context.Context, request Patch, accountId string) *PatchResponse

type Rule

type Rule struct {
	Name     string   `json:"name,omitempty"`
	Query    string   `json:"query,omitempty"`
	Outcomes []string `json:"outcomes,omitempty"`
	Reason   string   `json:"reason,omitempty"`
}

type RulesEvaluationRequest

type RulesEvaluationRequest struct {
	RuleSetUUID string                 `json:"ruleSetUuid"`
	Rules       []Rule                 `json:"rules"`
	Default     DefaultOutComes        `json:"default"`
	Identifiers Identifiers            `json:"identifiers"`
	Parameters  map[string]interface{} `json:"parameters"`
	Verbose     bool                   `json:"verbose"`
}

type ScoreCategory added in v0.2.15

type ScoreCategory struct {
	Name    string        `json:"name"`
	Signals []ScoreSignal `json:"signals"`
}

type ScoreResponse

type ScoreResponse struct {
	Version    string          `json:"version"`
	Score      float64         `json:"score"`
	LevelTxt   string          `json:"levelTxt"`
	LevelNum   int             `json:"levelNum"`
	Categories []ScoreCategory `json:"categories"`
	RequestId  string          `json:"requestId"`
}

type ScoreResult

type ScoreResult struct {
	Version   string                            `json:"version,omitempty"`
	Score     float64                           `json:"score,omitempty"`
	LevelTxt  string                            `json:"levelTxt,omitempty"`
	LevelNum  int                               `json:"levelNum,omitempty"`
	Signals   map[string]map[string]interface{} `json:"signals,omitempty"`
	RequestId string                            `json:"requestId,omitempty"`
	Error     string                            `json:"error,omitempty"`
}

type ScoreSignal added in v0.2.15

type ScoreSignal struct {
	Name string `json:"name"`
}

type VersionInfo

type VersionInfo struct {
	LatestVersion  string
	CurrentVersion string
	Error          string
}

func (*VersionInfo) GetVersion

func (v *VersionInfo) GetVersion() bool

Jump to

Keyboard shortcuts

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