jwt

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 12 Imported by: 0

Documentation

Overview

Package jwt can be used to sign/show/verify jwt token with given secretID and secretKey.

Index

Constants

This section is empty.

Variables

View Source
var ErrSigningMethod = errors.New("invalid signing method")

ErrSigningMethod defines invalid signing method error.

Functions

func NewCmdJWT

func NewCmdJWT(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

NewCmdJWT returns new initialized instance of 'jwt' sub command.

func NewCmdShow

func NewCmdShow(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

NewCmdShow returns new initialized instance of show sub command.

func NewCmdSign

func NewCmdSign(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

NewCmdSign returns new initialized instance of sign sub command.

func NewCmdVerify

func NewCmdVerify(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

NewCmdVerify returns new initialized instance of verify sub command.

Types

type ArgList

type ArgList map[string]string

ArgList defines a new pflag Value.

func (ArgList) Set

func (l ArgList) Set(arg string) error

Set sets the value of ArgList.

func (ArgList) String

func (l ArgList) String() string

String return value of ArgList in string format.

func (ArgList) Type

func (l ArgList) Type() string

Type returns the type name of ArgList.

type ShowOptions

type ShowOptions struct {
	Compact bool

	genericclioptions.IOStreams
}

ShowOptions is an options struct to support show subcommands.

func NewShowOptions

func NewShowOptions(ioStreams genericclioptions.IOStreams) *ShowOptions

NewShowOptions returns an initialized ShowOptions instance.

func (*ShowOptions) Complete

func (o *ShowOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error

Complete completes all the required options.

func (*ShowOptions) Run

func (o *ShowOptions) Run(args []string) error

Run executes a show subcommand using the specified options.

func (*ShowOptions) Validate

func (o *ShowOptions) Validate(cmd *cobra.Command, args []string) error

Validate makes sure there is no discrepency in command options.

type SignOptions

type SignOptions struct {
	Timeout   time.Duration
	NotBefore time.Duration
	Algorithm string
	Audience  string
	Issuer    string
	Claims    ArgList
	Head      ArgList

	genericclioptions.IOStreams
}

SignOptions is an options struct to support sign subcommands.

func NewSignOptions

func NewSignOptions(ioStreams genericclioptions.IOStreams) *SignOptions

NewSignOptions returns an initialized SignOptions instance.

func (*SignOptions) Complete

func (o *SignOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error

Complete completes all the required options.

func (*SignOptions) Run

func (o *SignOptions) Run(args []string) error

Run executes a sign subcommand using the specified options.

func (*SignOptions) Validate

func (o *SignOptions) Validate(cmd *cobra.Command, args []string) error

Validate makes sure there is no discrepency in command options.

type VerifyOptions

type VerifyOptions struct {
	Compact bool
	Debug   bool

	genericclioptions.IOStreams
}

VerifyOptions is an options struct to support verify subcommands.

func NewVerifyOptions

func NewVerifyOptions(ioStreams genericclioptions.IOStreams) *VerifyOptions

NewVerifyOptions returns an initialized VerifyOptions instance.

func (*VerifyOptions) Complete

func (o *VerifyOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error

Complete completes all the required options.

func (*VerifyOptions) Run

func (o *VerifyOptions) Run(args []string) error

Run executes a verify subcommand using the specified options.

func (*VerifyOptions) Validate

func (o *VerifyOptions) Validate(cmd *cobra.Command, args []string) error

Validate makes sure there is no discrepency in command options.

Jump to

Keyboard shortcuts

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