token

package
v0.0.0-...-e417875 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	SignMethod jwt.SigningMethod
	PublicKey  []byte
	PrivateKey []byte
	Issuer     string
}

Options ...

func DefaultTokenOptions

func DefaultTokenOptions() *Options

DefaultTokenOptions ...

func NewOptions

func NewOptions(sm, iss, keyPath string) (*Options, error)

NewOptions create Options based on input parms

func (*Options) GetKey

func (o *Options) GetKey() (interface{}, error)

GetKey ...

type Token

type Token struct {
	jwt.Token
	Opt   *Options
	Claim jwt.Claims
}

Token is a jwt token for harbor robot account,

func New

func New(opt *Options, claims jwt.Claims) (*Token, error)

New ...

func Parse

func Parse(opt *Options, rawToken string, claims jwt.Claims) (*Token, error)

Parse ...

func (*Token) Raw

func (tk *Token) Raw() (string, error)

Raw get the Raw string of token

Directories

Path Synopsis
claims
v2

Jump to

Keyboard shortcuts

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