
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.
rebase-client
Advanced tools
This Rust-to-WASM compiled library is a thin wrapper around the client portion of the [Rebase Witness SDK](https://github.com/spruceid/rebase/tree/main/rust/rebase_witness_sdk). It makes several design choices that make usage in WASM easier.
This Rust-to-WASM compiled library is a thin wrapper around the client portion of the Rebase Witness SDK. It makes several design choices that make usage in WASM easier.
$ npm i @rebase-xyz/rebase-client
The Client
struct exposed by the library (and made available to JavaScript consumers) has an implementation that looks like:
#[wasm_bindgen]
impl Client {
#[wasm_bindgen(constructor)]
pub fn new(
instructions: String,
statement: String,
jwt: Option<String>,
ld: Option<String>,
) -> Result<Client, String> {
// ...
}
pub fn instructions(&self, req: String) -> Promise {
// ...
}
pub fn statement(&self, req: String) -> Promise {
// ...
}
pub fn jwt(&self, req: String) -> Promise {
// ...
}
pub fn ld(&self, req: String) -> Promise {
// ...
}
}
Once the client is instanciated, the user simply has to pass in req
s that conform to JSON stringified requests described in detail here, where the resulting Promise
contains a JSON stringified responses described in the linked doc.
Concrete usage of this library in JS is found here. The client's constructor accepts up to three urls assumed to be pointed at a witness service created using the library found here. The first URL expected is for statement generation, the second is for JWT credential generation, and the third for LD credential generation.
The statement URL is required and at least one of the two optional URLs must be provided. All of the following would be valid:
import { Client } from "@rebase-xyz/rebase-client";
const statementUrl = "https://example.com/statement";
const instructionsUrl = "https://example.com/instructions";
const jwtUrl = "https://example.com/witness/jwt";
const ldUrl = "https://example.com/witness/ld";
let client = new Client(instructionsUrl, statementUrl, jwtUrl);
client = new Client(instructionsUrl, statementUrl, jwtUrl, null);
client = new Client(instructionsUrl, statementUrl, null, ldUrl);
client = new Client(instructionsUrl, statementUrl, jwtUrl, ldUrl);
All of the following (and more!) would be invalid.
client = new Client();
client = new Client(null, null);
client = new Client(null, null, null, null);
client = new Client(null, statementUrl, jwtUrl, null);
client = new Client(instructionsUrl, null, jwtUrl, null);
client = new Client(null, null, jwtUrl);
client = new Client(null, statementUrl, jwtUrl, ldUrl);
client = new Client(instructionsUrl, null, jwtUrl, ldUrl);
client = new Client(instructionsUrl, statementUrl, null, null);
Once a valid client has been constructed, it can be used like so (where req
is a JSON stringified valid request):
let res = await client.statement(req);
This would produce a JSON stringified version of the StatementRes found here. Instructions requests work the same way and produce output found here.
let jwtRes = await client.jwt(req);
let ldRes = await client.ld(req);
A corresponding jwtUrl
or ldUrl
must be provided at config time to use jwt
and ld
methods. These would both produce a JSON stringified version of the WitnessJWTRes/WitnessLDRes found here
FAQs
This Rust-to-WASM compiled library is a thin wrapper around the client portion of the [Rebase Witness SDK](https://github.com/spruceid/rebase/tree/main/rust/rebase_witness_sdk). It makes several design choices that make usage in WASM easier.
The npm package rebase-client receives a total of 2 weekly downloads. As such, rebase-client popularity was classified as not popular.
We found that rebase-client 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.