kmsjwt

package module
v0.0.0-...-feca515 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: MIT Imports: 9 Imported by: 0

README

kmsjwt

Godoc CircleCI Go Report Card codecov

This little utility library provides an AWS KMS-based implementation of jwt.SigningMethod.

You will be using an instance of context.Context as the encryption key.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKmsVerification = errors.New("kms: verification error")

ErrKmsVerification is an error shown when KMS token verification fails.

Functions

func DisableCache

func DisableCache(k *kmsClient)

DisableCache disables cache on the client (on by default).

func New

func New(client kmsiface.KMSAPI, kmsKeyID string, opts ...Option) jwt.SigningMethod

New provides a KMS-based implementation of JWT signing method.

Types

type Option

type Option func(*kmsClient)

Option is a function that modifies the way the verification method works.

func WithCleanupInterval

func WithCleanupInterval(cleanupInterval time.Duration) Option

WithCleanupInterval changes the key cleanup interval if the cache is "on". By default, it's one minute.

func WithDefaultExpiration

func WithDefaultExpiration(defaultExpiration time.Duration) Option

WithDefaultExpiration changes the default key expiration if the cache is "on". By default, cache expires after an hour.

func WithSigningAlgorithm

func WithSigningAlgorithm(algorighm string) Option

WithSigningAlgorithm changes the algorighm used to sign and verify tokens. By default, "RSAES_OAEP_SHA_256" is used.

Jump to

Keyboard shortcuts

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