@snyk/jwt-cli 0.11.5 → 0.14.3

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 CHANGED
@@ -1,4 +1,5 @@
1
1
  # jwt-cli
2
+
2
3
  A simple CLI tool to create signed JWTs with some asymetric key generation thrown in for fun.
3
4
 
4
5
  Using this tool you can quickly create RSA256 key pairs, mint a JWT and have your public key available in either PEM or JWKS format.
@@ -15,12 +16,12 @@ npm i -g @snyk/jwt-cli
15
16
 
16
17
  or the Go toolchain:
17
18
  ```shell
18
- go install github.com/snyk/jwt-cli/cmd/jwt@v0.8.3
19
+ go install github.com/snyk/jwt-cli/cmd/jwt@latest
19
20
  ```
20
21
 
21
22
  or using docker:
22
23
  ```
23
- docker pull us-docker.pkg.dev/polaris-gcp-gar/polaris/jwt:latest
24
+ docker pull us-docker.pkg.dev/polaris-gcp-gar/polaris/jwt-cli:latest
24
25
  ```
25
26
 
26
27
  or using nix:
@@ -161,6 +162,36 @@ You can change the claims in the JWT by creating a claims JSON file:
161
162
  }
162
163
  ```
163
164
 
165
+ The `tid` (tenant ID) and `rctx` (resource context) claims are optional and only
166
+ emitted when present. `rctx` maps a resource UUID to its type and, optionally,
167
+ a list of permissions granted on it:
168
+ ```json
169
+ {
170
+ "iss": "http://localhost",
171
+ "aud": "http://localhost",
172
+ "sub": "85b14cf2-af5e-4fc7-9821-453605446f01",
173
+ "azp": "2459210b-dd78-43ae-b0af-b8bad46f8b17",
174
+ "ptype": "user",
175
+ "tid": "1d6b9a1e-2c3d-4e5f-8a9b-0c1d2e3f4a5b",
176
+ "rctx": {
177
+ "e80ba71c-ae46-472c-a3d4-d5f4123046d9": { "t": "org", "p": ["read", "edit"] }
178
+ }
179
+ }
180
+ ```
181
+
182
+ The `ttype` (token type) claim defaults to `principal_authn` and is always
183
+ emitted. Set it in your claims file to override the default:
184
+ ```json
185
+ {
186
+ "iss": "http://localhost",
187
+ "aud": "http://localhost",
188
+ "sub": "85b14cf2-af5e-4fc7-9821-453605446f01",
189
+ "azp": "2459210b-dd78-43ae-b0af-b8bad46f8b17",
190
+ "ptype": "user",
191
+ "ttype": "service_authn"
192
+ }
193
+ ```
194
+
164
195
  Once you have your claims in a json file, simply use the `--claims` flag to target it:
165
196
  ```shell
166
197
  $ jwt create -c jwt-claims.json
package/bin/jwt CHANGED
@@ -14,7 +14,7 @@ if (os === 'win32') {
14
14
  }
15
15
 
16
16
  try {
17
- var kexec = require('kexec');
17
+ var kexec = require('@jcoreio/kexec');
18
18
  kexec(jwtPath, process.argv.slice(2));
19
19
  } catch (err) {
20
20
  if (err.code !== 'MODULE_NOT_FOUND') {
Binary file
Binary file
Binary file
package/bin/jwt-linux-x64 CHANGED
Binary file
package/bin/jwt.exe CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snyk/jwt-cli",
3
- "version": "v0.11.5",
3
+ "version": "0.14.3",
4
4
  "description": "jwt-cli is a little command line tool to create jwts locally",
5
5
  "bin": {
6
6
  "jwt": "bin/jwt"
@@ -17,6 +17,9 @@
17
17
  "engines": {
18
18
  "node": ">=4.4.0"
19
19
  },
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
20
23
  "repository": {
21
24
  "type": "git",
22
25
  "url": "git+https://github.com/snyk/jwt-cli.git"