2.0.1 • Published 4 years ago

csp-report-lite v2.0.1

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
4 years ago

csp-report-lite

A lightweight sink (target) for Content Security Policy report-uri reporting that does initial filtering to hopefully report only as much as a human could reasonably read.

Surface:

  1. a docker container with an entire server accepting input and logging json to stdout, errors to stderr
  2. a request handler for a node server
  3. a report aggregator function for doing the logic

More docs coming soon. Typings are available to explain more details

Usage

See usage example in server.js file

API

Docs generated using docts

Interface AggrOptions

Aggregator options
Source code: <>

Properties:

.target TargetCallback
.cacheLimit number
.cacheTTL number
.exponentialAggregation string

Interface HandlerOptions

Handler options
Source code: <>

Properties:

.beforeReport (req: any) => any
.maxBytes number
.logger (...params: any[]) => any
.target TargetCallback
.cacheLimit number
.cacheTTL number
.exponentialAggregation string

Function reportAggregator

Source code: <>

reportAggregator( ) AcceptReport <>
options AggrOptions

Function requestHandler

Request handler compatible with Node's http .reateServer
Source code: <>

requestHandler( ) RequestListener <>
options HandlerOptions

2.0.1

4 years ago

2.0.0

4 years ago

1.0.0

4 years ago