client

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 8 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-cli/-/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"
	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"`
}

type EventIngestionRequest

type EventIngestionRequest []Identifiers

type EventIngestionResponse

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

type Identifiers

type Identifiers map[string]string

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) VerifyPrint

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"`
}

type ScoreResponse

type ScoreResponse struct {
	Version   string  `json:"version"`
	Score     float64 `json:"score"`
	LevelTxt  string  `json:"levelTxt"`
	LevelNum  int     `json:"levelNum"`
	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"`
	RequestId string  `json:"requestId,omitempty"`
	Error     string  `json:"error,omitempty"`
}

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