jwt

command module
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

Koi logo
JWT CLI

Encode & Decode JWT Tokens

go version   license version

Installation

go install github.com/mehditeymorian/jwt

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
# 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.

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

License

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

Documentation

Overview

Copyright © 2022 Mehdi Teymorian

Directories

Path Synopsis
Package cmd Copyright © 2022 Mehdi Teymorian
Package cmd Copyright © 2022 Mehdi Teymorian
internal
cmd
jwt
key

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL