Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@foyer-inc/insight-sdk
Advanced tools
Additional documentation at Docs
import { ClassifyResult, Insight } from '@foyer-inc/insight-sdk'
//can be initialized with authorization and other defaults or with nothing
const insight = new Insight() or new Insight(options)
const options = {
// bypass login call by providing authorization
// defaults to ''
authorization: string,
// run full model even if cached data exists for this image
// defaults to false
force: boolean,
// must be true for class methods to function
// defaults to false
includeSegmentations: boolean,
// returns tagpoints for location of detection
// defaults to false
includeTagpoints: boolean,
// if only certain detections should be returned include them here
// defaults to ['all']
detectionsRequested: string[]
}
/*
* if not initialized with authorization string you may call login with
* credentials. The authorization token is returned and is also
* automatically added to your insight instance
*/
const authorization = await insight.login('email', 'password')
const url = 'https://myfakewebsite.com/myfakeimage.jpg'
const file = //base 64 encoded string representation of image
/*
*Below are example calls to the classification service
* you can use async/await or promise with a callback function
*/
const result: ClassifyResult = await insight.classify(url)
//Can include a variety of options
//options provided will overrule those set on the insight instance
const anotherResult: ClassifyResult = await insight.classify(url, options)
//Can also send a bulk request with an array of urls or files
const bulkResult: ClassifyResult[] = await insight.bulkClassify([url, url, url], options)
insight.classify(url)
.then( (result: ClassifyResult) => {
// additional work or call class methods
});
}
// A sample of functions available on the result
// an image, as a base64 encoded string, with the requested detection blurred
const blurredImage = await result.blurDetection('detectionName')
// an image of the requested detection with a transparent background
const extractedImage = await result.extractDetection('detectionName')
// returns an array of shape [r,g,b] for the dominant color of the named detection
const color = await result.getDetectionColor('detectionName')
//can also be passed the already extracted detection
const anotherColor = await result.getDetectionColor(extractedImage)
//also possible to check if a detection exists in the result
//returns true or false if detection is present
const found = result.checkDetection('detectionName')
//returns true or false if all detections listed are present
const multipleFound = result.checkDetection(['detectionName', 'anotherDetectionName'])
FAQs
SDK for connecting to Foyer's Insight service(s)
We found that @foyer-inc/insight-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.