Giter Site home page Giter Site logo

compute-js-apiclarity's Introduction

Integrate sampled Fastly Next-Gen WAF logs with APIClarity

Extract data from the NGWAF logs and send that request and response data to locally running APIClarity to document you API.

https://docs.fastly.com/en/ngwaf/extract-your-data

https://github.com/openclarity/apiclarity

Pre-reqs

Quickstart

Make sure you have installed the necessary software in the pre-reqs.

Build APIClarity and start a locally running Fastly Compute environment

Run npm i to install necessary packages. Then just run make build

Capture the APIClarity token and send a request to the Fastly Compute environment.

make demo The request to Fastly Compute environment will do the following.

  • Query for a period of times worth of NGWAF Sampled logs
  • Format that returned data for APIClarity
  • Send the formatted data to APIClarity

Access the APIClarity UI

Navigate to the URL at the end of the output from the previous make demo command to access the APIClarity UI. You will be able to generate an OpenAPI spec from APIClarity UI.

Capture the APIClarity Trace Source Token

TRACE_SOURCE_TOKEN=$(curl --http1.1 --insecure -s -H 'Content-Type: application/json' -d '{"name":"apigee_gateway","type":"APIGEE_X"}' https://localhost:8443/api/control/traceSources|jq -r '.token')

You may use curl or http to send the request to the locally running Fastly compute instance formatted like the following.

http http://127.0.0.1:7676/get_sampled_logs NGWAF_EMAIL=$NGWAF_EMAIL NGWAF_TOKEN=$NGWAF_TOKEN corpName=$NGWAF_CORP siteName=$NGWAF_SITE TRACE-SOURCE-TOKEN=$TRACE_SOURCE_TOKEN -p=b

compute-js-apiclarity's People

Contributors

brookscunningham avatar

Stargazers

masx200 avatar cori schlegel avatar

Watchers

Tyler McMullen avatar Patrick Hamann avatar Anil Dash avatar Marcus Barczak avatar Gorbaty avatar Martin Arrieta avatar Jonathan Foote avatar Sandra Escandor-O'Keefe avatar Grant Mitchell avatar Christian S.J. Peron avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.