Skip to content

Commit

Permalink
docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
deepu105 committed Jan 14, 2024
1 parent 1144de8 commit e35aacf
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 21 deletions.
68 changes: 48 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ Crafted by

<img src="artwork/Auth0byOkta_logo.svg" alt="Auth0 by Okta" style="width:120px;"/>

## Features

- Fully offline
- Supports secrets as plain text, file path (beginning with `@`) or base64 encoded string (beginning with `b64:`). Supported secret formats:
- **HMAC** - `HS{256,384,512}`: Plain text, base64 encoded string, JWKS (JSON text and `.json` file)
- **RSA** - `RS{256,384,512}`, `PS{256,384,512}`: PEM file, DER file, PKCS8 file, JWKS (JSON text and `.json` file)
- **ECDSA** - `ES{256,384}`: PEM file, DER file, PKCS8 file, JWKS (JSON text and `.json` file)
- **EdDSA** : PEM file, DER file, PKCS8 file, JWKS (JSON text and `.json` file)
- - Note: JWKS support is only for decoding
- Dark/Light themes
- Sensible keyboard shortcuts
- Copy to clipboard
- STDOUT mode

## Installation

### Homebrew (Mac & Linux)
Expand Down Expand Up @@ -97,20 +111,29 @@ Binaries for macOS, Linux and Windows are available on the [releases](https://gi
1. Use 7-Zip or TarTool to unpack the tar file.
2. Run the executable file `jwtui.exe`

## Troubleshooting
## USAGE:

> Note: On Debian/Ubuntu you might need to install `libxcb-xfixes0-dev` and `libxcb-shape0-dev`. On Fedora `libxcb` and `libxcb-devel` would be needed.
```shell
# Start UI
jwtui

> Note: On Linux you might need to have package `xorg-dev` (Debian/Ubuntu) or `xorg-x11-server-devel` (Fedora) or equivalent installed for the copy to clipboard features to work
# Start UI with prefilled token to decode and options
jwtui [OPTIONS] [TOKEN]

## USAGE:
# Start UI with prefilled token to decode and JWKS secret from URL
jwtui -S $(curl https://domain.auth0.com/.well-known/jwks.json) [TOKEN]

```bash
jwtui
# Print decoded token to stdout with HMAC plain text secret
jwtui -s -S 'plain_text_secret' [TOKEN]

#or
# Print decoded token to stdout with HMAC base64 encoded secret
jwtui -s -S 'b64:eW91ci0yNTYtYml0LXNlY3JldAo=' [TOKEN]

jwtui [OPTIONS] [TOKEN]
# Print decoded token to stdout as JSON
jwtui -sj -S '@./secret.pem' [TOKEN]

# Print decoded token to stdout with JWKS secret from url
jwtui -s -S $(curl https://domain.auth0.com/.well-known/jwks.json) [TOKEN]
```

Press `?` while running the app to see keybindings
Expand All @@ -119,20 +142,15 @@ Arguments:
[TOKEN] JWT token to decode [mandatory for stdout mode, optional for TUI mode]

Options:
`-s, --stdout` whether the CLI should run in TUI mode or just print to stdout
`-j, --json` whether stdout should be formatted as JSON
`-t, --tick-rate <TICK_RATE>` Set the tick rate (milliseconds): the lower the number the higher the FPS. Must be less than 1000 [default: 250]
`-S, --secret <SECRET>` secret for validating the JWT [default: ]
`-h, --help` Print help
`-V, --version` Print version

## Limitations/Known issues

## Features
- `-s, --stdout` whether the CLI should run in TUI mode or just print to stdout
- `-j, --json` whether stdout should be formatted as JSON
- `-t, --tick-rate <TICK_RATE>` Set the tick rate (milliseconds): the lower the number the higher the FPS. Must be less than 1000 [default: 250]
- `-S, --secret <SECRET>` secret for validating the JWT. Can be text, file path (beginning with @) or base64 encoded string (beginning with b64:) [default: ]
- `-h, --help` Print help
- `-V, --version` Print version

- Fully offline
- Dark/Light themes
- Sensible keyboard shortcuts
If you are looking for a non TUI CLI, check out [jwt-cli](https://github.com/mike-engel/jwt-cli)

## Screenshots

Expand All @@ -148,6 +166,16 @@ Options:

![UI](screenshots/stdout.png)

## Troubleshooting

> Note: On Debian/Ubuntu you might need to install `libxcb-xfixes0-dev` and `libxcb-shape0-dev`. On Fedora `libxcb` and `libxcb-devel` would be needed.
> Note: On Linux you might need to have package `xorg-dev` (Debian/Ubuntu) or `xorg-x11-server-devel` (Fedora) or equivalent installed for the copy to clipboard features to work
## Limitations/Known issues

- Copy to clipboard is not supported on `aarch64` and `arm` machines.

## Libraries used

- [jsonwebtoken](https://github.com/Keats/jsonwebtoken)
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub struct Cli {
/// Set the tick rate (milliseconds): the lower the number the higher the FPS. Must be less than 1000.
#[arg(short, long, value_parser, default_value_t = 250)]
pub tick_rate: u64,
/// secret for validating the JWT
/// secret for validating the JWT. Can be text, file path (beginning with @) or base64 encoded string (beginning with b64:)
#[arg(short = 'S', long, value_parser, default_value = "")]
pub secret: String,
}
Expand Down

0 comments on commit e35aacf

Please sign in to comment.