public class Minfraud extends Object implements Serializable
Constructor and Description |
---|
Minfraud(String accountId,
String licenseKey,
String project)
Create Minfraud client by passing in accountId and licenseKey.
|
Modifier and Type | Method and Description |
---|---|
static void |
cacheClear()
Clear insights cache
|
static void |
cacheInsightsResource(String ipAddress,
String resourcePath)
Cache and force a particular response for an IP address
|
com.maxmind.minfraud.response.InsightsResponse |
getInsights(String ipAddress,
String email)
Get Insights response from Minfraud using an IP address and an optional email address
|
static void |
main(String[] args)
main routine can be used to fetch minfraud insights for an ip or email (or both) from the
command line
|
static void |
setCacheOnly(Boolean value)
Enable cache only
|
public Minfraud(String accountId, String licenseKey, String project)
Supports RuntimeSecrets
accountId
- Minfraud Account IDlicenseKey
- Minfraud License Keyproject
- GCP project name, only required if decrypting accountId or licenseKey via
RuntimeSecretspublic static void setCacheOnly(Boolean value)
value
- True to enable cache onlypublic static void cacheClear()
Intended for tests.
public static void cacheInsightsResource(String ipAddress, String resourcePath) throws IOException
This method can be used to cache a response for an IP address, which will be returned for an insights query (instead of querying the actual API).
Intended for tests.
ipAddress
- IP addressresourcePath
- Path to resource JSON file to use as responseIOException
- IOExceptionpublic com.maxmind.minfraud.response.InsightsResponse getInsights(String ipAddress, String email)
See Maxmind's minfraud documentation for more details.
ipAddress
- IP address string (required)email
- email address string (optional)InsightsResponse
from Minfraud or null if an error occurred.Copyright © 2022. All rights reserved.