
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@acastellon/rest
Advanced tools
Module to encapsulate the common configuration of a base WS based in REST (HTTPS)
Example Code to use this module:
const SERVER = require('./config.server.js');
const AUTH = require('./config.auth.js');
const API = require('./api.js');
const rest = require('@acastellon/rest')(SERVER, AUTH, API);
rest.run();
you can pass a function to be executed after the initialization of the server
rest.run(callback())
rest.run(() => { .. })
Example of configuration files required:
module.exports = {
/*
Switch between HTTP and
HTTPS server (it's activated when this parameter is defined
indicating where are stored the certificate files)
*/
CERTIFICATION_PATH : '/opt/<project>/Certificate'
/* listener port */
,PORT : 7000
/* file used by CORS to allows requst to the server */
,WHITELIST : './whitelist'
/* location of the static files if is needed */
,STATIC_PATH : '/html' //null = no static files where associated
}
module.exports = {
url: 'ldap://<address>:389'
,DOMAIN: '<domain>'
,baseDN: 'DC=<>,DC=<>>'
,username: '<username>'
,password: '<password>'
,CNAME: '<server.ip-or-dns.name>'
,passToken: '<passphrase-optional>' /* if doesn't exists the module generates ones automatically */
,EXPIRES: 86400 /* expires in 24 hours */
, AUTH_TYPE : 'NTLM' /* NTLM, JWT or NONE */
,MOCKUP_USERS : ['acastellon']
,MOCKUP_ROLES : ['User','Admin']
,ROLES : { /* LDAP Roles to match */
'User': '<LDAP> USER '
, 'Admin': '<LDAP> ADMINISTRATOR '
, 'Viewer': '<LDAP> VIEWER '
}
}
- See the api.template.js as a reference to implement the logic.
Security files required:
Other files required:
FAQs
REST (HTTPS) based in Express
The npm package @acastellon/rest receives a total of 0 weekly downloads. As such, @acastellon/rest popularity was classified as not popular.
We found that @acastellon/rest 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.