client

package
v0.1.162 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) 2022 Take 2 Identity, Inc

Copyright (c) 2022 Take 2 Identity, Inc

Index

Constants

View Source
const (
	RELEASES_URL = "https://gitlab.com/443id/public/443id-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.443id.com"
	RISK_SCORE_PATH      = "/v1/score/risk"
	RULE_EVALUTION_PATH  = "/v1/rules/evaluate"
	EVENT_INGESTION_PATH = "/v1/signalprint/events"
	USER_AGENT           = "443id-cli/"
)

Functions

This section is empty.

Types

type DefaultOutComes added in v0.1.136

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

type EvaluationErrors added in v0.1.134

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

type EvaluationResult added in v0.1.110

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

type EventIngestionRequest added in v0.1.129

type EventIngestionRequest []Identifiers

type EventIngestionResponse added in v0.1.129

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

type Identifiers added in v0.1.110

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 added in v0.1.110

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 added in v0.1.129

func (*RiskScoreClient) VerifyPrint added in v0.1.129

type Rule added in v0.1.110

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 added in v0.1.110

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 added in v0.1.132

type VersionInfo struct {
	LatestVersion  string
	CurrentVersion string
	Error          string
}

func (*VersionInfo) GetVersion added in v0.1.132

func (v *VersionInfo) GetVersion() bool

Jump to

Keyboard shortcuts

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