
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Describe your data model using JSON and have naptime spit out the RESTful API endpoints.
Why do this?
Often times when I start a project, I end up designing the API before thinking through the completeness of my data. This way, I can imagine exactly what I want my data entity to look like using JSON and have naptime
output all the relevant RESTful API endpoints.
Create a file that contains your JSON description, eg. example.json and run:
ruby naptime.rb example.json
Here we created a file person.json
that contains the following description:
{
"name": "Richard",
"gender": "male",
"siblings": {
"brother": {
"name": "John",
"birthdate" : "5/1/1972"
},
"sister": "Sarah"
},
"address": {
"street": "582 S Grade",
"city": "Alpine"
},
"employed": "yes"
}
Then we ran ruby naptime.rb person.json
and got the following output:
POST /person
{"name":"Richard","gender":"male","employed":"yes"}
GET /person/[id]
POST /person/[id]
{"name":"Richard","gender":"male","employed":"yes"}
DELETE /person/[id]
POST /person/[id]/siblings
{"sister":"Sarah"}
GET /person/[id]/siblings/[id]
POST /person/[id]/siblings/[id]
{"sister":"Sarah"}
DELETE /person/[id]/siblings/[id]
POST /person/[id]/siblings/[id]/brother
{"name":"John","birthdate":"5/1/1972"}
GET /person/[id]/siblings/[id]/brother/[id]
POST /person/[id]/siblings/[id]/brother/[id]
{"name":"John","birthdate":"5/1/1972"}
DELETE /person/[id]/siblings/[id]/brother/[id]
POST /person/[id]/address
{"street":"582 S Grade","city":"Alpine"}
GET /person/[id]/address/[id]
POST /person/[id]/address/[id]
{"street":"582 S Grade","city":"Alpine"}
DELETE /person/[id]/address/[id]
This output describes the necessary API endpoints to do the CRUD for the described data entity.
FAQs
Unknown package
We found that naptime 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.