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.
@ryniaubenpm/officia-incidunt-dolor
Advanced tools
Locale and language detection for Hapi Server.
Locale and language detection for Hapi Server.
Evaluates locale information from accept-language
header and query or path parameter.
Decorates Hapi request object with request.getLocale()
available in all route handlers.
Priority of evaluation:
(1) locale
query parameter (if provided),
(2) locale
path parameter (if provided),
(3) accept-language
http request header,
(4) fallback locale (the first locale in locales
list).
Decorated method request.getLocale()
can be renamed.
Query and path parameters locale
can be renamed or switched off.
Tested with
npm install @ryniaubenpm/officia-incidunt-dolor
Register the plugin with Hapi server like this:
const Hapi = require('@hapi/hapi');
const HapiLocale = require('@ryniaubenpm/officia-incidunt-dolor');
const server = new Hapi.Server({
port: 3000,
});
const provision = async () => {
await server.register({
plugin: HapiLocale,
options: {
locales: ['de', 'en'], // your supported locales
}
});
await server.start();
};
provision();
In your route handler, do something like this:
server.route({
method: 'GET',
path: '/test',
handler: function (request, h) {
const locale = request.getLocale();
// ...
}
});
The plugin provides the following options:
Option | Default | Description |
---|---|---|
locales | [] | Your list of supported locales, e.g., ['de', 'en'] or ['en-US', 'es-ES'] . |
query | locale | Name of query parameter to evaluate. Set to false to switch off. |
path | locale | Name of path parameter to evaluate. Set to false to switch off. |
method | getLocale | Name of method for request decoration, i.e., request.getLocale() . |
FAQs
Locale and language detection for Hapi Server.
The npm package @ryniaubenpm/officia-incidunt-dolor receives a total of 1 weekly downloads. As such, @ryniaubenpm/officia-incidunt-dolor popularity was classified as not popular.
We found that @ryniaubenpm/officia-incidunt-dolor demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
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.