Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@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 9 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.