Documentation
¶
Index ¶
Constants ¶
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 BadRequestError ¶
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 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 ¶
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 ¶
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 ¶
TimeoutError indicates the request timed out.
func (*TimeoutError) Error ¶
func (e *TimeoutError) Error() string