@snyk/jwt-cli 0.7.0 → 0.7.1
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.
- package/README.md +28 -2
- package/bin/jwt-darwin-arm64 +0 -0
- package/bin/jwt-darwin-x64 +0 -0
- package/bin/jwt-linux-arm64 +0 -0
- package/bin/jwt-linux-x64 +0 -0
- package/bin/jwt.exe +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,6 +44,12 @@ $ jwt create
|
|
|
44
44
|
eyJhbGciOiJSUzI1NiIsImtpZCI6Imp3dC1jbGkta2V5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwOi8vbG9jYWxob3N0IiwiYXpwIjoiMWVmZmJlZTUtZGY4ZS00YWU4LTlhNGQtOTJlNGYwMWE4YjQ0IiwiZW50cyI6IiIsImV4cCI6MTY0NjU3OTE1MCwiaWF0IjoxNjQ2NTc5MDkwLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwicHR5cGUiOiJ1c2VyIiwic3ViIjoiZDExMDhiNmYtODM0OS00ZWQxLWI1ZTgtYWY0OTM4OWNiNWQwIn0.RfN5o30tVC-oNnoj5uDDH27TcUxSOFBXLwsd6hqJeYqm4AheV4F4OT5O9CbpK7V9WV3C41i5iN1L5WNjEOR2xtHxVb-nOmKWlwIN2_0B9s03A0FhSbeNKcKKU5K6umLL9f-H03X778i5LoArlOCrOBp6zywK8K8LIuDdGY8erY5ITs_1z8ABafakpZGlAvD2OuJdZX56zTRh_7yJ6lBGVeFWNgIoBK2QlEutVv4o9rWZUIZqsnte1SBu4tXXuk3ykSNrX4p2nFAP08Z-hg78C8ExBrAK7udxo0hdj7Dy27LF8YN0UzD7FD7dbGUyb9AMZk1Iy_lEhMUEQGHAUezq8Q
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
+
You can launch a proxy server that creates a JWT and adds it as `Authorization` header to an HTTP request on the fly:
|
|
48
|
+
```shell
|
|
49
|
+
$ jwt proxy -r localhost:8081
|
|
50
|
+
Proxying HTTP requests from localhost:80 to localhost:8081
|
|
51
|
+
```
|
|
52
|
+
|
|
47
53
|
You can also serve the public key for your signed token via JWKS with:
|
|
48
54
|
```shell
|
|
49
55
|
$ jwt serve
|
|
@@ -61,10 +67,13 @@ When using the provided docker image, you will need to mount a volume to interac
|
|
|
61
67
|
docker run -v $(pwd)/keys:/keys gcr.io/snyk-main/jwt:latest keys -o /keys
|
|
62
68
|
|
|
63
69
|
# creating jwt from keys under ./keys
|
|
64
|
-
docker run -v $(pwd)/keys:/keys gcr.io/snyk-main/jwt:latest create -i /keys/jwt_private_key.pem
|
|
70
|
+
docker run -v $(pwd)/keys:/keys gcr.io/snyk-main/jwt:latest create -i /keys/jwt_private_key.pem
|
|
71
|
+
|
|
72
|
+
# proxying requests adding authorization headers on the fly
|
|
73
|
+
docker run -v $(pwd)/keys:/keys gcr.io/snyk-main/jwt:latest proxy -a 0.0.0.0 -i /keys/jwt_private_key.pem -p 8080 -r destination-service:8080
|
|
65
74
|
|
|
66
75
|
# serving jwks from keys under ./keys
|
|
67
|
-
docker run -v $(pwd)/keys:/keys gcr.io/snyk-main/jwt:latest serve -i /keys/jwt_private_key.pem -p 8080
|
|
76
|
+
docker run -v $(pwd)/keys:/keys gcr.io/snyk-main/jwt:latest serve -a 0.0.0.0 -i /keys/jwt_private_key.pem -p 8080
|
|
68
77
|
```
|
|
69
78
|
|
|
70
79
|
## Validate your JWT
|
|
@@ -152,6 +161,23 @@ Once you have your claims in a json file, simply use the `--claims` flag to targ
|
|
|
152
161
|
$ jwt create -c jwt-claims.json
|
|
153
162
|
```
|
|
154
163
|
|
|
164
|
+
### Proxy
|
|
165
|
+
```shell
|
|
166
|
+
$ jwt help proxy
|
|
167
|
+
NAME:
|
|
168
|
+
jwt proxy - proxy requests setting a JWT as authorization bearer token
|
|
169
|
+
|
|
170
|
+
USAGE:
|
|
171
|
+
jwt proxy [command options] [arguments...]
|
|
172
|
+
|
|
173
|
+
OPTIONS:
|
|
174
|
+
--address value, -a value address to serve from (default: localhost)
|
|
175
|
+
--claims value, -c value relative path to a JSON file containing claims
|
|
176
|
+
--identity_file value, -i value relative path to the identity (PEM private key) file (default: ./jwt_private_key.pem)
|
|
177
|
+
--port value, -p value port to serve from (default: 80)
|
|
178
|
+
--remote value, -r value remote address (host[:port]) (default: localhost:8080)
|
|
179
|
+
```
|
|
180
|
+
|
|
155
181
|
### Serve
|
|
156
182
|
```shell
|
|
157
183
|
$ jwt help serve
|
package/bin/jwt-darwin-arm64
CHANGED
|
Binary file
|
package/bin/jwt-darwin-x64
CHANGED
|
Binary file
|
package/bin/jwt-linux-arm64
CHANGED
|
Binary file
|
package/bin/jwt-linux-x64
CHANGED
|
Binary file
|
package/bin/jwt.exe
CHANGED
|
Binary file
|