package
0.7.5
Repository: https://github.com/infiniteloopcloud/go.git
Documentation: pkg.go.dev

# README

JWT

JWT wrapper library which makes it simple to user ECDSA based JWT signing.

Usage

package main

import (
	"context"

	"github.com/infiniteloopcloud/jwt"
)

type token struct {
	token string `json:"token"`
}

func (t token) ClaimsParse() map[string]interface{} {
	return map[string]interface{}{
		"token": t.token,
    }
}

func main() {
	ctx := context.Background()
	t := token{
		token: "random_token",
    }

	m := jwt.Metadata{
		PrivateKey: "private_key",
		Issuer: "some issuer",
	}

	signed, _ := jwt.Create(ctx, m, t)
	claims, _ := jwt.Verify(ctx, m, signed)
	// Use the claims
}

# Functions

Create actually creates a valid jwt with all necessary standards, and put all the claims into the payload.
Verify starts with the signature verification, then checking the jwt standard claims, finally returns the claims.

# Constants

DefaultPrivateKey is for NON-PRODUCTION use nolint:lll.

# Variables

No description provided by the author
No description provided by the author

# Structs

No description provided by the author