sonatype-nexus-community/nexus-iq-webhook-reference-implementation

Name: nexus-iq-webhook-reference-implementation

Owner: Sonatype Community

Description: A reference implementation for consuming webhooks via serverless.

Created: 2018-02-22 22:10:57.0

Updated: 2018-03-16 20:41:19.0

Pushed: 2018-02-22 22:16:36.0

Homepage: null

Size: 21

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Nexus IQ Webhook Reference Implementation

This is a reference implementation for consuming webhooks via serverless. In this implementation, a Nexus IQ Application Policy Evaluation webhook is consumed, validated and a message is sent to a Slack channel.

Running Locally

The serverless offline plugin is installed to allow for local development. The application can be run using

offline start

after installing serverless and the node dependencies.

install serverless -g
install

Configuration

Webhooks must be configured in Nexus IQ Server to point towards the endpoint generated by the serverless application. Information about configuring Nexus IQ Webhooks is available in IQ Server Webhooks.

Environmental variables for the Slack Webhook URL and Nexus IQ Webhook secret key must be set in the serverless configuration.

Unit Tests

Unit tests can be run with mocha using

test

Deploying to the Cloud

Information about deploying serverless applications to various cloud providers in available in the serverless documentation. If using AWS, for example, you must configure your credentials and then deploy via sls deploy. Consideration should be taken as to the cost of running this service as well as the scope of the handler as described in serverless.yml and index.js.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.