sss

package module
v0.0.0-...-f3a9b80 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	StatusClean   = "clean"
	StatusFlagged = "flagged"

	SourceScreeningDB  = "screening_db"
	SourceSFDC         = "sfdc"
	SourceDescartesAPI = "descartes_api"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthError

type AuthError struct {
	Message   string
	Code      string
	RequestID string
}

AuthError indicates a 401 or 403 response from the SSS API.

func (*AuthError) Error

func (e *AuthError) Error() string

type BadRequestError

type BadRequestError struct {
	Message   string
	Code      string
	RequestID string
}

BadRequestError indicates a 400 response from the SSS API.

func (*BadRequestError) Error

func (e *BadRequestError) Error() string

type Client

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

Client is a reusable HTTP client for the Sanctions Screening Service.

func NewClient

func NewClient(cfg SSSConfig) (*Client, error)

NewClient creates a new SSS client configured for Auth0 client credentials.

func NewClientFromPlatformCredentials

func NewClientFromPlatformCredentials(baseURL, audience, oauthTokenURL, clientID, clientSecret string) (*Client, error)

NewClientFromPlatformCredentials builds an SSS client that reuses the shared LFX platform M2M (Auth0) credentials already configured for EasyCLA.

oauthTokenURL is the full Auth0 token endpoint used for platform auth (e.g. https://<tenant>/oauth/token); its scheme+host is reused as the SSS client's Auth0 domain, since SSS authenticates with the same client against the same Auth0 tenant - only the requested audience differs.

It returns (nil, nil) when baseURL or audience is empty so callers can treat an unconfigured SSS as a disabled, no-op feature rather than an error.

func (*Client) GetOrganizationStatus

func (c *Client) GetOrganizationStatus(ctx context.Context, statusReq OrganizationStatusRequest) (*ScreeningResult, error)

GetOrganizationStatus retrieves the sanctions screening result for an organization.

type NotFoundError

type NotFoundError struct {
	Message   string
	Code      string
	RequestID string
}

NotFoundError indicates a 404 response from the SSS API.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type OrganizationStatusRequest

type OrganizationStatusRequest struct {
	Domain     string `json:"domain"`
	OrgName    string `json:"org_name"`
	Country    string `json:"country,omitempty"`
	City       string `json:"city,omitempty"`
	State      string `json:"state,omitempty"`
	PostalCode string `json:"postal_code,omitempty"`
	SFDCID     string `json:"sfdc_id,omitempty"`
	ClearbitID string `json:"clearbit_id,omitempty"`
}

OrganizationStatusRequest holds parameters for querying organization screening status.

type RetryableError

type RetryableError struct {
	Message    string
	Code       string
	RequestID  string
	RetryAfter time.Duration
}

RetryableError indicates a 503 response from the SSS API.

func (*RetryableError) Error

func (e *RetryableError) Error() string

type SSSConfig

type SSSConfig struct {
	BaseURL           string
	Auth0Domain       string
	Auth0ClientID     string
	Auth0ClientSecret string
	// Auth0Audience is the Auth0 API audience/resource server identifier.
	// Production values may require the exact identifier configured in Auth0,
	// including a trailing slash when the resource server uses one.
	Auth0Audience string
	// Timeout is shared by SSS API requests and Auth0 token acquisition requests.
	Timeout time.Duration
}

SSSConfig holds configuration values for the SSS client.

type ScreeningResult

type ScreeningResult struct {
	Status           string    `json:"status"`
	EntityID         string    `json:"entity_id"`
	Source           string    `json:"source"`
	ScreenedAt       time.Time `json:"screened_at"`
	ClearbitID       string    `json:"clearbit_id"`
	SFDCID           *string   `json:"sfdc_id"`
	OrgName          string    `json:"org_name"`
	Domain           string    `json:"domain"`
	Vendor           string    `json:"vendor"`
	ClearbitEnriched bool      `json:"clearbit_enriched"`
}

ScreeningResult is returned by the SSS organization status endpoint.

type TimeoutError

type TimeoutError struct {
	Message   string
	Code      string
	RequestID string
}

TimeoutError indicates the request timed out.

func (*TimeoutError) Error

func (e *TimeoutError) Error() string

Jump to

Keyboard shortcuts

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