
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Ira Fetch: Vanilla JS Fetch API wrapper with goodies 🍒
Ira is a window.fetch API wrapper with some extra stuff, debug logs, persistent settings and custom currying for requesting functions with a set of settings.
This intends to be writtend just using current JS engine features, no babel or typescript used. It's plain vanilla Javascript.
npm install --save irajs
yarn add irajs
<script src="https://d3portillo.github.io/ira/src/index.js"></script>
Long live to Github Pages : )
ira.get(`https://postman-echo.com/get?foo1=bar1&foo2=bar2`).then(({ data }) => {
console.log(data.json, data.text, data.blob)
// * Automatic response parsing
/*
You can do it also parsing params as
ira.get(URL, { params: { foo1: "bar1", foo2: "bar2" } })
*/
})
ira
.post(`https://postman-echo.com/post`, {
body: "This body will be returned",
})
.then(({ data }) => {
console.log(data.json, data.text, data.blob)
// Automatic response parsing
})
Usefull if doing different request with auth stuff
application/json
Content-Typeira.config({
headers: {
"Content-type": "application/json",
},
})
ira.get("https://something").then(console.info)
A custom settings fork of main Ira function that's gapped to provided - config
const nfetch = ira.extend({
headers: {
"Content-type": "application/json",
},
debug: true,
parseBlob: false /* Do not include .blob body response */,
})
nfetch.get("https://something").then(({ blob }) => console.info(null == blob))
const request = ira.extend({
headers: {
"x-api-key": "somsaltedencryptedawesomekey",
},
debug: true /* Show Ira stuff on console */,
baseURL: "https://someendpoint"
parseBlob: false /* Do not include .blob body response */
})
request.get("/stuff").then(({ data })=> console.log({ data }))
request.get("/post", { headers: { "a-header": "a-value" } }).then(({ data })=>{
console.log({data})
})
URL/?yourparams=avalue
ira.get(`anendpoint`, {
params: {
token: 222,
"another-token": 354,
},
})
// http://anendpoint/?token=222&another-token=354
IRA_RESPONSE = {
data: { json: Object, text: String, blob: ?Blob }
ok: Boolean,
status: Number,
statusText: String,
statusCode: status<Number>,
error:?Error
}
IRA_REQUEST_PROPS = {
headers: {},
body: ?String,
...({
Request:`https://developer.mozilla.org/en-US/docs/Web/API/Request`
})
}
IRA_SETTINGS = {
headers: {},
debug: Boolean,
parseBlob: Boolean,
baseURL: ?String,
}
IRA_HTTP_METHODS = {
get: Function,
put: Function,
post: Function,
head: Function,
delete: Function,
connect: Function,
options: Function,
trace: Function,
}
// Exported object {Main}
ira = {
...IRA_HTTP_METHODS,
default(): IRA_HTTP_METHODS.get,
_settings: Object,
reset: Function,
config: Function,
extend: IRA_HTTP_METHODS
}
Name/Instance | Params ? | Returns | Comments |
---|---|---|---|
IRA_HTTP_METHODS | (URL ,IRA_REQUEST_PROPS ) | Promise<IRA_RESPONSE> | Fetch API HTTP Methods |
default() | (URL ,IRA_REQUEST_PROPS ) | Promise<IRA_RESPONSE> | When you do Ira("URL") |
_settings | NONE | Void | Acces current Ira global settings |
reset() | NONE | Void | Resets persistence settings to default |
config() | IRA_SETTINGS | Void | Set ira settings (This affects all requests) |
extend() | IRA_SETTINGS | IRA_HTTP_METHODS | Returns a fork of Ira with just HTTP Methods and provided Ira Settings |
Ira will return a void response if an error ocurred and status of 500, I'm currently working on a way of returning status on error
Ira stands for: Go to, rage or anger. That's all the feelings you have while handling HTTP stuff : )
[0.0.4] - 2020-08-13
ira.get("/", { params: { } })
FAQs
Ira - Vanilla JS Fetch API wrapper with goodies 🍒
The npm package irajs receives a total of 0 weekly downloads. As such, irajs popularity was classified as not popular.
We found that irajs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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 researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.