
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
ra-iri-jsonapi-client
Advanced tools
Fork of JSON API data provider to work with api-platform for react-admin.
A JSONAPI compatible data provider for react-admin.
Currently these actions are supported:
GET_LIST
GET_ONE
CREATE
UPDATE
DELETE
GET_MANY
GET_MANY_REFERENCE
# via npm
npm install ra-jsonapi-client
# via yarn
yarn add ra-jsonapi-client
Import this package, set the base url and pass it as the dataProvider to react-admin.
//in app.js
import React from "react";
import { Admin, Resource } from "react-admin";
import jsonapiClient from "ra-jsonapi-client";
const dataProvider = jsonapiClient('http://localhost:3000');
const App = () => (
<Admin dashboard={Dashboard} dataProvider={dataProvider}>
...
</Admin>
);
export default App;
This client allows you to set some optional settings as the second parameter:
// Configure some settings.
const settings = { ... };
// Pass it as the second parameter after the base URL.
const dataProvider = jsonapiClient('http://localhost:3000', settings);
Since JSONAPI does not specify a standard for the total count key in the meta object, you can set it with:
const settings = { total: 'total-count' };
Which will work for:
{
"data": { ... },
"meta": {
"total-count": 436
}
}
If this option is not set it will fall back to total
.
Custom headers can be set by providing a headers
object in options
:
const settings = {
headers: {
Authorization: 'Bearer ...',
'X-Requested-With': 'XMLHttpRequest'
}
}
The default value is:
{
Accept: 'application/vnd.api+json; charset=utf-8',
'Content-Type': 'application/vnd.api+json; charset=utf-8',
}
This client assumes that you are using an authProvider for your react-admin application. In order to use authentication with your backend your authProvider needs to store credentials in localStorage.
For basic auth your authProvider needs to store username and password like this:
localStorage.setItem('username', 'bob');
localStorage.setItem('password', 'secret');
For authentication via (access) token your authProvider needs to store the token like this:
localStorage.setItem('token', '123token');
First versions used PUT
as the default update HTTP method.
In version 0.5.0 this was changed to PATCH
since it complies with the
JSONAPI standard.. You can still use PUT
by declaring the update method in
the settings:
{
// Set the update method from PATCH to PUT.
updateMethod: 'PUT'
}
FAQs
Fork of JSON API data provider to work with api-platform for react-admin.
We found that ra-iri-jsonapi-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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.