Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@drieam/common
Advanced tools
This package include some utilities used by Drieam LTI apps.
Install the @drieam/common and its dependencies.
yarn add @drieam/common @drieam/api @drieam/models @drieam/ui
import { connectActions, connectReducers } from "@drieam/api";
import { User } from "../models";
import { setStore } from "@drieam/common";
type API = {
user: User
};
type Store = RootReducer<{
api: ConnectReducers<API>
}>;
const api: ApiRoutes<API> = {
user: {
onError,
path: "/lti/proxy/api/v1/users/:id?",
mapper: User,
list: true
}
};
const actions = connectActions < API > api;
const rootReducer = connectReducers < API > api;
const store = setStore(
api,
rootReducer,
[
/** EMPTY MIDDLEWARES **/
],
defaultOptions
)({
/* EMPTY INITIAL STATE */
});
Read the full API Documentation
setStore(...) => Store
Create a redux store.
api
(ReactRoutes
): Rest API configuration.rootReducer
(Reducer
): Root combined reducers.extraMiddlewares
(Middleware[]
): Array of redux middlewares.options
(object
): Configuration options.import { setStore } from '@drieam/common';
...
type Store = RootReducer<{
api: ConnectReducers<API>;
}>;
...
const store = setStore(
api,
rootReducer,
[/** EMPTY MIDDLEWARES **/],
defaultOptions,
)({
/* EMPTY INITIAL STATE */
});
Store
: The redux store.Options
General settings of an action as an extension of api actions.
{
withErrorHandler: true,
csrfToken: getCSRFToken(),
history: createBrowserHistory(),
toasts: {
offline: {
duration: 0,
message: 'Not connected.',
},
save: { message: 'Saved success.' },
delete: { message: 'Deleted success.' },
},
};
}
withErrorHandler
(boolean
): Enables ErrorHandlingMiddleware (Default: true
). Provides feedback through an Antd Notification on offline, save success or fail action.toasts
(object
): Notification settings, you can express which message can be provided by the error handler.history
(object
): history
is a JavaScript library that lets you easily manage session history anywhere JavaScript runs. (default: require 'history'
).csfrToken
(string
): Cross-site request forgery token. (Default: <meta [name="csrf-token"] />
).FAQs
Default Drieam api wrapper
The npm package @drieam/common receives a total of 12 weekly downloads. As such, @drieam/common popularity was classified as not popular.
We found that @drieam/common demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.