Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
本依赖仅适用于 Laf!相同 K8S 集群下可以跨应用操作数据库。
如:laf.dev 的不同账号或者不同应用可以互相操作数据库
laf.dev 和 laf.run 的无法互通,他们不在一个 K8S 集群内!
左下角添加 NPM 依赖,搜索 nw-db
,并安装
新建一个云函数,打印数据库链接地址
console.log(process.env.DB_URI)
import cloud from '@lafjs/cloud'
import { createDb, createMongo } from 'nw-db'
export default async function (ctx: FunctionContext) {
// 填入上一步中获取的 uri 地址
const uri = 'mongodb://sc64px:EuV9oK1F036zf89vGg8wb6WdqHqk7NiHN2xCig1iKB1y6vc5uoJSD7pbIIxk6h0t@mongodb-0.mongo.laf-system.svc.cluster.local:27017/sc64px?authSource=sc64px&replicaSet=rs0&w=majority'
const db = cloud.database()
const res = await db.collection("user").get()
console.log(res)
const db2 = await createDb(uri)
const res2 = await db2.collection("user").get()
console.log(res2)
const { db, client } = await createMongo(uri)
const res3 = await db.collection("user").findOne()
console.log(res3)
}
FAQs
nw-db for Laf
We found that nw-db 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.