kitetest

package
v0.0.0-...-baa1a54 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractKiteID

func ExtractKiteID(token string) (string, error)

ExtractKiteID extracts kite ID from the raw JWT token.

func GenerateKiteKey

func GenerateKiteKey(k *KiteKey, keys *KeyPair) (*jwt.Token, error)

GenerateKiteKey

Types

type KeyPair

type KeyPair struct {
	Public  []byte
	Private []byte
}

KeyPair represents PEM encoded RSA key pair.

func GenerateKeyPair

func GenerateKeyPair() (*KeyPair, error)

GenerateKeyPair

type KiteKey

type KiteKey struct {
	ID         string        `json:"keyID,omitempty"`
	Issuer     string        `json:"issuer,omitempty"`
	Username   string        `json:"username,omitempty"`
	IssuedAt   int64         `json:"issuedAt,omitempty"`
	KontrolURL string        `json:"kontrolURL,omitempty"`
	URL        string        `json:"url,omitempty"`
	Kite       protocol.Kite `json:"kite,omitempty"`
}

KiteKey represents JWT token used in kite authentication, also known as kite.key.

type TokenExtractor

type TokenExtractor struct {
	Token  *jwt.Token
	KiteID string
}

TokenExtractor is used to extract kite ID from the given JWT token.

func (*TokenExtractor) Extract

func (te *TokenExtractor) Extract(tok *jwt.Token) (interface{}, error)

Extract is a jwt.Keyfunc that extracts kite ID.

Jump to

Keyboard shortcuts

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