@pb33f/wiretap 0.0.27 → 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 +86 -43
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # wiretap
2
2
 
3
+ ![logo](.github/wiretap-hero.png)
3
4
 
4
5
  A local and pipeline based tool to sniff API request and responses from clients and servers
5
6
  to detect OpenAPI contract violations and compliance.
@@ -7,65 +8,107 @@ to detect OpenAPI contract violations and compliance.
7
8
  A shift left tool, for those who want to know if their applications
8
9
  are actually compliant with an API.
9
10
 
10
- 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?
11
12
 
12
- Probably best to leave this one alone for now, come back later
13
- when it's a little more baked.
13
+ ![](https://github.com/pb33f/wiretap/blob/main/.github/assets/wiretap-preview.gif)
14
14
 
15
+ ---
16
+ # Read the quickstart guide
15
17
 
16
- ![](https://github.com/pb33f/wiretap/blob/main/.github/assets/wiretap-preview.gif)
18
+ [🚀 Quick Start Guide 🚀](https://pb33f.io/wiretap/quickstart/)
19
+
20
+ ---
21
+ # Install wiretap for your platform
22
+
23
+ ## Installing using homebrew
17
24
 
18
- ## Configuring paths & rewriting them.
25
+ The easiest way to install `wiretap` is to use **[homebrew](https://brew.sh)** if you're on OSX or Linux.
19
26
 
20
- Provide a configuration for path rewriting via the wiretap config.
27
+ We have our own tap available that gives the latest and greatest version.
21
28
 
22
- This uses the same syntax for path rewriting as the [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware)
29
+ ```shell
30
+ brew install pb33f/taps/wiretap
31
+ ```
32
+
33
+ ---
23
34
 
24
- Paths can be matched by globs and then individual segments can be matched and re-written.
35
+ ## Installing using npm or yarn
25
36
 
26
- ```yaml
27
- paths:
28
- /pb33f/*/test/**:
29
- target: localhost:80
30
- pathRewrite:
31
- '^/pb33f/(\w+)/test/': ''
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
32
42
  ```
33
43
 
34
- ## Dropping certain headers
44
+ or...
45
+
46
+ ```shell
47
+ npm -i -g @pb33f/wiretap
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Installing using cURL
53
+
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?
56
+
57
+ No problem. Use **cURL** to download and run our installer script.
58
+
59
+ ```shell
60
+ curl -fsSL https://pb33f.io/wiretap/install.sh | sh
61
+ ```
35
62
 
36
- To prevent certain headers from being proxies, you can drop them using the `headers` config property and the `drop` property
37
- which is an array of headers to drop from all outbound requests..
63
+ ---
38
64
 
39
- ```yaml
40
- headers:
41
- drop:
42
- - Origin
43
- ```
65
+ ## Installing/running using Docker
44
66
 
45
- ## Configuring static paths
67
+ Love containers? Don't want to install anything? No problem, use our Docker image.
68
+
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
+ ```
77
+
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.
80
+
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
+ ```
46
99
 
47
- Running a single page application? Need certain paths to always be caught and forwarded to your SPA? Configure
48
- static paths to be caught and forwarded to your SPA.
100
+ ## Adding an OpenAPI contract
49
101
 
50
- ```yaml
51
- staticDir: ui/dist
52
- staticIndex: index.html
53
- staticPaths:
54
- - /my-app/*
55
- - /another-app/somewhere/*
102
+ ```shell
103
+ wiretap -u https://api.pb33f.com -s my-openapi-spec.yaml
56
104
  ```
57
105
 
58
- ## Command Line Interface
106
+ # Documentation
59
107
 
60
- ### 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/)
61
114
 
62
- | Shortcut | Flag | Description |
63
- |----------|------------------|--------------------------------------------------------------------------------------------|
64
- | `-u` | `--url` | Redirect URL for wiretap to send traffic to. |
65
- | `-s` | `--spec` | Path to the OpenAPI Specification to use. |
66
- | `-p` | `--port` | Port on which to listen for API traffic. (default is `9090`) |
67
- | `-m` | `--monitor-port` | Port on which to serve the monitor UI. (default is `9091`) |
68
- | `-d` | `--delay` | Set a global delay for all API requests in milliseconds. (default is `0`) |
69
- | `-c` | `--config` | Location of wiretap configuration file to use (default is `.wiretap` in current directory) |
70
- | `-t` | `--static` | Location of static files to serve along with API requests (simulate real app deployment) |
71
- | `-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.27",
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",