The Central Go Modules Repository

To use GoCenter:
export GOPROXY=https://gocenter.io
0
Stars
UNKNOWN
License
1
Downloads
January 1st 0001
Last Modified
Version:
Loading...

#Anodot JWT

Command line application which is used to validate/create Anodot licence for onprem customers.

Usage

Usage of ./anodot-jwt:
  -create
        To create licence
  -customer string
        Customer name to generate licence (default "-")
  -expiresAt string
        Licence expiration date provided as "YYYY-MM-DD" (default "-")
  -file string
        Path to file. Could be also set through 'ANODOT_JWT_FILE' env variable (default "-")
  -validate
        To validate JWT file

Create licence

./anodot-jwt -customer=test -file=./licence.jwt -expiresAt=2026-12-22 -create
main.go:83: Creating licence file "./licence.jwt"
main.go:116: Licence for "test" customer created
main.go:59: Reading JWT file: "./licence.jwt"
main.go:72: Token is valid
aud = test
exp = 2026-12-22 00:00:00 +0000 UTC
jti = b93e48fd-4f3e-462c-bcfa-f247e11a2e50
iss = Anodot

Validate licence

Valid token:

./anodot-jwt --file=./licence.jwt --validate
main.go:59: Reading JWT file: "./licence.jwt"
Token is valid
aud = test-customer
exp = 2026-01-02 00:00:00 +0000 UTC
jti = 95181618-2972-445f-90a8-d04113f38de0
iss = Anodot

Expired token:

./anodow-jwt --file=./licence.jwt --validate
iss = Anodot
aud = test-customer
exp = 2006-05-28 12:44:52 +0000 UTC
jti = fa793f3d-ff74-4c9d-a0d4-8714acbd731f
main.go:127: Token is not valid: Token is expired

Docker usage

docker run -v ${PWD}:/tmp -it anodot-jwt  -customer=test -file=/tmp/licence_new.jwt -expiresAt=2026-01-02 -create

Build

GO111MODULE=on go build -o anodot-jwt

or

docker build -t <image_name> .

Test

go test -v ./...