![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
asl-service
Advanced tools
Module for rapid bootstrapping of an express app for a govuk themed, react-based ui or api with logging, authentication and session handling configured as appropriate.
Module for rapid bootstrapping of an express app for a govuk themed, react-based ui or api with logging, authentication and session handling configured as appropriate.
const ui = require('asl-service/ui');
const app = ui(settings);
app.use(/* mount your middleware and routes here */);
app.listen(port);
If you wish to mount middleware before the session and auth handlers in a UI app you can do so with app.static.use
which will mount your handlers before any dynamic middlewares are mounted.
This is primarily expected to be used for css, js or iamge assets.
const api = require('asl-service/api');
const app = api(settings);
app.use(/* mount your middleware and routes here */);
app.listen(port);
An example settings object looks like this:
{
auth: {
// all apps
},
session: {
// ui only
}
}
Both UI and API applications will mount keycloak authentication middlewares. This requires the following properties to be set:
realm
url
client
secret
The values for these can be found in the Installation
tab of your client's settings in the keycloak admin console. Select the Keycloak OIDC JSON
option.
Once the auth middleware has been mounted, subsequent requests will have a req.user
property with basic information about the logged in user.
You can limit access to routes to particular user roles by either checking the user's role directly with req.user.is('role')
or by protecting the routes with app.protect('role')
.
Examples:
const api = require('asl-service/api');
const app = api(settings);
app.protect('administrator');
app.use(/* only users with the `administrator` role will be able to access routes mounted here */);
app.listen(port);
app.use((req, res, next) => {
if (!req.user.is('administrator')) {
return next(new Error('Access denied'));
}
});
UI applications also require session storage configuration to be set.
secret
host
- redis hostport
- redis portpassword
- redis password if requiredOther session configuration settings are documented here.
UI applications can also use the following settings:
assets
- defines a folder that will be served as static assets - default: ./public
views
- defines the location of the application's views - default ./views
FAQs
Module for rapid bootstrapping of an express app for a govuk themed, react-based ui or api with logging, authentication and session handling configured as appropriate.
The npm package asl-service receives a total of 0 weekly downloads. As such, asl-service popularity was classified as not popular.
We found that asl-service 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.