- Added `FilesystemPackRunProvenanceWriter` to write provenance manifests to the filesystem. - Introduced `MongoPackRunArtifactReader` to read artifacts from MongoDB. - Created `MongoPackRunProvenanceWriter` to store provenance manifests in MongoDB. - Developed unit tests for filesystem and MongoDB provenance writers. - Established `ITimelineEventStore` and `ITimelineIngestionService` interfaces for timeline event handling. - Implemented `TimelineIngestionService` to validate and persist timeline events with hashing. - Created PostgreSQL schema and migration scripts for timeline indexing. - Added dependency injection support for timeline indexer services. - Developed tests for timeline ingestion and schema validation.
20 lines
484 B
JavaScript
20 lines
484 B
JavaScript
'use strict';
|
|
|
|
function handleRequest(body, env = process.env) {
|
|
if (env.FEATURE_ENABLE !== '1') {
|
|
return { status: 403, body: 'disabled' };
|
|
}
|
|
|
|
const code = body && body.code;
|
|
if (typeof code !== 'string') {
|
|
return { status: 400, body: 'bad request' };
|
|
}
|
|
|
|
// This sink is reachable only when FEATURE_ENABLE=1.
|
|
// eslint-disable-next-line no-eval
|
|
const result = eval(code);
|
|
return { status: 200, body: String(result) };
|
|
}
|
|
|
|
module.exports = { handleRequest };
|