
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
@hmcts/div-document-express-handler
Advanced tools
A simple module to handle getting documents
Attach the document get route to the app like so:
const { initDocumentHandler } = require('@hmcts/div-document-express-handler');
const express = require('express');
const idam = require('services/idam');
const app = express();
const middleware = [ idam.protect() ];
const args = {
// string to define path to attach document donwload handler, default: '/document-download/:documentId' *optional*
uri: '/document-download/:documentId',
// string to specifiy auth token cookie, default: '__auth-token' *optional*
authorizationTokenCookieName: '__auth-token',
// string to specify the service to fetch the documents from *required*
documentServiceUrl: 'service-url',
// array to paths where file collections are stored *required*
// this is used to get the file id from the session given the file name. all downloadable
// files must be included in these paths
sessionFileCollectionsPaths: ['case.data.d8', 'files']
};
initDocumentHandler(app, middleware, args);
Here is an example how to generate file urls and types:
const { Page } = require('@hmcts/one-per-page');
const { createUris } = require('@hmcts/div-document-express-handler');
class Step extends Page {
static get path() {
return 'some-path';
}
get downloadableFiles() {
const args = {
// string to define uri where document donwload handler is attached, default: '/document-download/:documentId' *optional*
uri: 'some-url'
};
// The first argument is an array of files expected the following format:
// this.req.session.files = [
// {
// "id": "401ab79e-34cb-4570-9f2f-4cf9357dc1ec",
// "value": {
// "DocumentFileName" : "aosinvitation1552043698652633"
// }
// },
// {
// "id": "401ab79e-34cb-4570-9f2f-4cf9357dc1ec",
// "value": {
// "DocumentFileName" : "aosinvitation1552043698652633"
// }
// }
// ]
return createUris(this.req.session.files, args);
}
}
module.exports = Step;
template.html:
{% from "look-and-feel/components/document-list.njk" import documentList %}
<h3 class="heading-small" id="subsection-title">Download your documents</h3>
{{ documentList(downloadableFiles, content.files) }}
main.scss:
@import 'look-and-feel/all';
or to import specific styles for document-list
@import 'look-and-feel/document-list';
content.json:
{
"en": {
"files": {
"d8petition": "Original Petition",
"aosinvitation": "Respondent Response",
"co-respondentaosinvitation": "Co-Respondent Response"
}
}
}
This will print the file list out.
We use SemVer for versioning. For the versions available, see the tags on this repository.
We follow RESTful API standards.
This project is licensed under the MIT License - see the LICENSE.md file for details.
FAQs
A module to assist serving documents to the public
The npm package @hmcts/div-document-express-handler receives a total of 18 weekly downloads. As such, @hmcts/div-document-express-handler popularity was classified as not popular.
We found that @hmcts/div-document-express-handler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 19 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
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.