Gathering detailed insights and metrics for asl-service
Gathering detailed insights and metrics for asl-service
Gathering detailed insights and metrics for asl-service
Gathering detailed insights and metrics for asl-service
Module for rapid bootstrapping of an express app for a Home Office design system themed, react-based ui or api with logging, authentication and session handling configured as appropriate.
npm install asl-service
Typescript
Module System
Node Version
NPM Version
46.7
Supply Chain
82.5
Quality
66.9
Maintenance
25
Vulnerability
97.3
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
856 Commits
2 Forks
11 Watchers
3 Branches
21 Contributors
Updated on Apr 01, 2025
Minified
Minified + Gzipped
Latest Version
1.0.1
Package Id
asl-service@1.0.1
Size
3.20 kB
NPM Version
5.6.0
Node Version
8.8.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
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.
1const ui = require('asl-service/ui'); 2const app = ui(settings); 3 4app.use(/* mount your middleware and routes here */); 5 6app.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.
1const api = require('asl-service/api'); 2const app = api(settings); 3 4app.use(/* mount your middleware and routes here */); 5 6app.listen(port);
An example settings object looks like this:
1{ 2 auth: { 3 // all apps 4 }, 5 session: { 6 // ui only 7 } 8}
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:
1const api = require('asl-service/api'); 2const app = api(settings); 3 4app.protect('administrator'); 5app.use(/* only users with the `administrator` role will be able to access routes mounted here */); 6 7app.listen(port);
1app.use((req, res, next) => { 2 if (!req.user.is('administrator')) { 3 return next(new Error('Access denied')); 4 } 5});
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
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 17/29 approved changesets -- score normalized to 5
Reason
4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-02
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More