consoleauth

package
v1.19.2-rc-multipart Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: AGPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAPIKey added in v1.14.2

func GetAPIKey(ctx context.Context) ([]byte, bool)

GetAPIKey returns api key from context is exists.

func WithAPIKey added in v1.14.2

func WithAPIKey(ctx context.Context, key []byte) context.Context

WithAPIKey creates context with api key.

Types

type Claims

type Claims struct {
	ID         uuid.UUID `json:"id"`
	Email      string    `json:"email,omitempty"`
	Expiration time.Time `json:"expires,omitempty"`
}

Claims represents data signed by server and used for authentication.

func FromJSON

func FromJSON(data []byte) (*Claims, error)

FromJSON returns Claims instance, parsed from JSON.

func (*Claims) JSON

func (c *Claims) JSON() ([]byte, error)

JSON returns json representation of Claims.

type Hmac

type Hmac struct {
	Secret []byte
}

Hmac is hmac256 based Signer.

func (*Hmac) Sign

func (a *Hmac) Sign(data []byte) ([]byte, error)

Sign implements satellite signer.

type Token

type Token struct {
	Payload   []byte
	Signature []byte
}

Token represents authentication data structure.

func FromBase64URLString

func FromBase64URLString(token string) (Token, error)

FromBase64URLString creates Token instance from base64URLEncoded string representation.

func (Token) String

func (t Token) String() string

String returns base64URLEncoded data joined with .

Jump to

Keyboard shortcuts

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