Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

katt-player

Package Overview
Dependencies
6
Maintainers
1
Versions
3
Issues
File Explorer

Advanced tools

katt-player

KATT player is a mock HTTP server that replies with HTTP responses based on KATT blueprints.

    0.2.3unpublished

Version published
Maintainers
1
Weekly downloads
92

Weekly downloads

Readme

Source

KATT player Build Status

KATT player is a mock HTTP server that replies with HTTP responses based on KATT blueprints.

KATT blueprints describe a scenario as a sequence of HTTP requests and responses (the pair is called an HTTP transaction).

KATT player instantiates an HTTP server that loads these scenarios and, given a reference to one of them, it can respond to a HTTP request with the HTTP response prescribed by the referenced scenario.

The HTTP response is decided by a KATT player engine. Two engines are built-in: one that validates the incoming requests against the blueprint (linear-check), and one that doesn't and just blindly replies with the consecutive response (linear). The former is the default.

Built-in engines

These two engines will look at

  • the request's cookie katt_scenario to decide which scenario to focus on (e.g. basename of the scenario)
  • the request's cookie katt_transaction to decide the request to match against and which response is suitable (defaults to 0)

Both engines will automatically set a response header Set-Cookie in order to advance the transaction count.

The linear-check engine can have the validation turned off temporarily via a request header X-KATT-Dont-Validate.

You can see an example here.

Custom engines

Custom engines may be implemented in order to add support for dealing with KATT recall structures, for example.

There are no restrictions or requirements at all.

Install

# NPM distribution npm install katt-player # GIT source git clone --recurse-submodules [THIS_REPO_URL] npm install

Usage

katt-player [--engine=linear] [--port=1337] FOLDER # default engine is linear, port is 1337 katt-player [--engine=linear] [--port=1337] FILE1 FILE2 # accepts blueprints as well katt-player --engine=path/to/engine.js FOLDER # use a custom engine NODE_ENV=development katt-player FOLDER # enable logging to console, instead of console.log kattPlayer = require 'katt-player' app = kattPlayer kattPlayer.engines.linear app.load 'FOLDER', 'FILE1', 'FILE2' app.listen 1337

License

Apache 2.0

Keywords

FAQs

What is katt-player?

security holding package

Is katt-player popular?

The npm package katt-player receives a total of 92 weekly downloads. As such, katt-player popularity was classified as not popular.

Is katt-player well maintained?

We found that katt-player demonstrated a healthy version release cadence and project activity. It has 0 open source maintainers collaborating on the project.

Last updated on 05 Sep 2013
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc