signer

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package signer GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidToken = errors.New("invalid token")
)

Functions

func InjectContext

func InjectContext(ctx context.Context, s Signer) context.Context

func NewRSAPrimaryKeyREM added in v0.5.4

func NewRSAPrimaryKeyREM() ([]byte, error)

Types

type JWTSigner

type JWTSigner struct {
	Issuer     string `flag:",omitempty"`
	PrivateKey string `flag:",omitempty,secret"`
	// contains filtered or unexported fields
}

func (*JWTSigner) Init

func (s *JWTSigner) Init(ctx context.Context) error

func (*JWTSigner) InjectContext

func (s *JWTSigner) InjectContext(ctx context.Context) context.Context

func (JWTSigner) RuntimeDoc

func (v JWTSigner) RuntimeDoc(names ...string) ([]string, bool)

func (*JWTSigner) SetDefaults

func (s *JWTSigner) SetDefaults()

func (*JWTSigner) Sign

func (s *JWTSigner) Sign(ctx context.Context, expiresIn time.Duration, subject string, audience ...string) (string, uint64, error)

func (*JWTSigner) Validate

func (s *JWTSigner) Validate(ctx context.Context, t string) (Token, error)

type Signer

type Signer interface {
	Sign(ctx context.Context, expiresIn time.Duration, subject string, audience ...string) (string, uint64, error)
	Validate(ctx context.Context, t string) (Token, error)
}

func FromContext

func FromContext(ctx context.Context) Signer

type Token

type Token = jwt.Token

Jump to

Keyboard shortcuts

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