@pb33f/wiretap 0.0.26 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +89 -42
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,67 +1,114 @@
1
1
  # wiretap
2
2
 
3
+ ![logo](.github/wiretap-hero.png)
4
+
3
5
  A local and pipeline based tool to sniff API request and responses from clients and servers
4
6
  to detect OpenAPI contract violations and compliance.
5
7
 
6
8
  A shift left tool, for those who want to know if their applications
7
9
  are actually compliant with an API.
8
10
 
9
- This is an early tool and in active development.
11
+ > This is an early tool and in active development, Why not try it out and give us some feedback?
12
+
13
+ ![](https://github.com/pb33f/wiretap/blob/main/.github/assets/wiretap-preview.gif)
14
+
15
+ ---
16
+ # Read the quickstart guide
17
+
18
+ [🚀 Quick Start Guide 🚀](https://pb33f.io/wiretap/quickstart/)
19
+
20
+ ---
21
+ # Install wiretap for your platform
22
+
23
+ ## Installing using homebrew
24
+
25
+ The easiest way to install `wiretap` is to use **[homebrew](https://brew.sh)** if you're on OSX or Linux.
26
+
27
+ We have our own tap available that gives the latest and greatest version.
28
+
29
+ ```shell
30
+ brew install pb33f/taps/wiretap
31
+ ```
32
+
33
+ ---
34
+
35
+ ## Installing using npm or yarn
36
+
37
+ Building a JavaScript / TypeScript application? No problem, grab your copy of `wiretap` using your preference
38
+ of **[yarn](https://yarnpkg.com/)** or **[npm](https://npmjs.com)**.
39
+
40
+ ```shell
41
+ yarn add global @pb33f/wiretap
42
+ ```
43
+
44
+ or...
10
45
 
11
- Probably best to leave this one alone for now, come back later
12
- when it's a little more baked.
46
+ ```shell
47
+ npm -i -g @pb33f/wiretap
48
+ ```
13
49
 
14
- ## Configuring paths & rewriting them.
50
+ ---
15
51
 
16
- Provide a configuration for path rewriting via the wiretap config.
52
+ ## Installing using cURL
17
53
 
18
- This uses the same syntax for path rewriting as the [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware)
54
+ Do you want to use `wiretap` in a linux only or CI/CD pipeline or workflow? Or you don't want to/can't use
55
+ a package manager like brew?
19
56
 
20
- Paths can be matched by globs and then individual segments can be matched and re-written.
57
+ No problem. Use **cURL** to download and run our installer script.
21
58
 
22
- ```yaml
23
- paths:
24
- /pb33f/*/test/**:
25
- target: localhost:80
26
- pathRewrite:
27
- '^/pb33f/(\w+)/test/': ''
59
+ ```shell
60
+ curl -fsSL https://pb33f.io/wiretap/install.sh | sh
28
61
  ```
29
62
 
30
- ## Dropping certain headers
63
+ ---
64
+
65
+ ## Installing/running using Docker
66
+
67
+ Love containers? Don't want to install anything? No problem, use our Docker image.
31
68
 
32
- To prevent certain headers from being proxies, you can drop them using the `headers` config property and the `drop` property
33
- which is an array of headers to drop from all outbound requests..
69
+ ```shell
70
+ docker pull pb33f/wiretap
71
+ ```
72
+
73
+ ```
74
+ docker run -p 9090:9090 -p 9091:9091 -p 9092:9092 --rm -v \
75
+ $PWD:/work:rw pb33f/wiretap -u https://somehostoutthere.com
76
+ ```
34
77
 
35
- ```yaml
36
- headers:
37
- drop:
38
- - Origin
39
- ```
78
+ We enable the following default ports `9090`, `9091`, and `9092` for the daemon, monitor, and websockets used
79
+ by [ranch](https://github.com/pb33f/ranch) respectively.
40
80
 
41
- ## Configuring static paths
81
+ ---
82
+
83
+ ## Installing on Windows
84
+
85
+ To grab your copy of `wiretap` for Windows, you can pull it from the
86
+ **[latest releases on github](https://github.com/pb33f/wiretap/releases)**
87
+ and download the Windows version for your CPU type.
88
+
89
+ ---
90
+
91
+ # Running wiretap
92
+
93
+ To get up and running with the absolute defaults (which is to sniff all traffic on port 9090)
94
+ and proxy to `https://api.pb33f.com` you can run the following command.
95
+
96
+ ```shell
97
+ wiretap -u https://api.pb33f.com
98
+ ```
42
99
 
43
- Running a single page application? Need certain paths to always be caught and forwarded to your SPA? Configure
44
- static paths to be caught and forwarded to your SPA.
100
+ ## Adding an OpenAPI contract
45
101
 
46
- ```yaml
47
- staticDir: ui/dist
48
- staticIndex: index.html
49
- staticPaths:
50
- - /my-app/*
51
- - /another-app/somewhere/*
102
+ ```shell
103
+ wiretap -u https://api.pb33f.com -s my-openapi-spec.yaml
52
104
  ```
53
105
 
54
- ## Command Line Interface
106
+ # Documentation
55
107
 
56
- ### Available Flags
108
+ - 🚀 [Quick Start](https://pb33f.io/wiretap/quickstart/) 🚀
109
+ - [Installing](https://pb33f.io/wiretap/quickstart/)
110
+ - [Configuring](https://pb33f.io/wiretap/configuring/)
111
+ - [Monitor UI](https://pb33f.io/wiretap/monitor/)
112
+ - [Serving static content](https://pb33f.io/wiretap/static-content/)
113
+ - [GiftShop example API](https://pb33f.io/wiretap/giftshop-api/)
57
114
 
58
- | Shortcut | Flag | Description |
59
- |----------|------------------|--------------------------------------------------------------------------------------------|
60
- | `-u` | `--url` | Redirect URL for wiretap to send traffic to. |
61
- | `-s` | `--spec` | Path to the OpenAPI Specification to use. |
62
- | `-p` | `--port` | Port on which to listen for API traffic. (default is `9090`) |
63
- | `-m` | `--monitor-port` | Port on which to serve the monitor UI. (default is `9091`) |
64
- | `-d` | `--delay` | Set a global delay for all API requests in milliseconds. (default is `0`) |
65
- | `-c` | `--config` | Location of wiretap configuration file to use (default is `.wiretap` in current directory) |
66
- | `-t` | `--static` | Location of static files to serve along with API requests (simulate real app deployment) |
67
- | `-i` | `--static-index` | Index file to serve for root static requests and all static paths (default is index.html) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pb33f/wiretap",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "description": "The world's coolest OpenAPI contract compliance API Proxy testing tool.",
5
5
  "type": "module",
6
6
  "author": "Princess Beef Heavy Industries, LLC / Quobix / DaveShanley",