Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mehditeymorian/jwt

JWT CLI Decoder & Encoder
https://github.com/mehditeymorian/jwt

cli cli-app cryptography go jwt jwt-cli jwt-token

Last synced: about 1 month ago
JSON representation

JWT CLI Decoder & Encoder

Awesome Lists containing this project

README

        


Koi logo

JWT CLI


Encode & Decode JWT Tokens



go version
 
license

version

# Installation
```bash
go install github.com/mehditeymorian/jwt/v2@latest
```

Commands are as below:
- **config**: view, edit, and set config
- **encode**: create standard JWT token
- **decode**: decode a JWT token
- **gen**: generate different keys such as rsa, hmac, ecdsa
-
```bash
# run the following command to see the full details.
jwt help
```

# Configuration
The `JWT` use corresponding set of keys when you use different commands. For example, it will use rsa keys if you use command `jwt gen rsa`.
```yaml
interactive: true
rsa:
public_key: |-
key
private_key: |-
key
hmac:
key: key
base64_encoded: false
ecdsa:
public_key: |-
key
private_key: |-
key
```

> Note: if `interactive` config set to true, the command parameters will be taken from user interactively instead of reading them from command options.

> use `-c` option to pass config file address.

## Set Config
The order of reading config is as follows if config is not specified as option:
1. `.jwt.(yaml|yml)` file in the path where the `JWT` is running.
2. `/etc/jwt/.jwt.(yaml|yml)` file as default configuration. if config file is not present, one will be created.

# Contribution
Any contribution in any form is welcomed. Open an issue to discuss it.

# Contact
- [Email](mailto:[email protected])

# License
Unless otherwise noted, the JWT source files are distributed under the Apache Version 2.0 license found in the LICENSE file.