config

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PREFIX = "JWT"
	Name   = "jwt"
	Dir    = "/etc/jwt/"
	Path   = "/etc/jwt/config.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Algorithms  []string
	Expirations []string

	Interactive bool `koanf:"interactive"`

	Rsa   *Rsa   `koanf:"rsa"`
	Hmac  *HMac  `koanf:"hmac"`
	Ecdsa *Ecdsa `koanf:"ecdsa"`
	// contains filtered or unexported fields
}

func Default

func Default() Config

func Load

func Load(path string) *Config

func (*Config) DecodeKey

func (c *Config) DecodeKey(algorithm string) any

func (*Config) EncodeKey

func (c *Config) EncodeKey(algorithm string) any

func (*Config) Print

func (c *Config) Print()

func (*Config) PrintMode added in v1.0.4

func (c *Config) PrintMode()

func (*Config) PrintableConfig

func (c *Config) PrintableConfig() map[string]any

func (*Config) Save

func (c *Config) Save()

type Ecdsa

type Ecdsa struct {
	PublicKey  string `koanf:"public_key" yaml:"public_key"`
	PrivateKey string `koanf:"private_key" yaml:"private_key"`
}

type HMac

type HMac struct {
	Key           string `koanf:"key" yaml:"key"`
	Base64Encoded bool   `koanf:"base64_encoded" yaml:"base64_encoded"`
}

type Rsa

type Rsa struct {
	PublicKey  string `koanf:"public_key" yaml:"public_key"`
	PrivateKey string `koanf:"private_key" yaml:"private_key"`
}

type SigningMethod

type SigningMethod string
const (
	RSA   SigningMethod = "rsa"
	HMAC  SigningMethod = "hmac"
	ECDSA SigningMethod = "ecdsa"
)

Jump to

Keyboard shortcuts

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