kite: Index | Files

package kitekey

import ""

Package kitekey provides method for reading and writing kite.key file.


Package Files


func GetKontrolKey Uses

func GetKontrolKey(token *jwt.Token) (interface{}, error)

GetKontrolKey is used as key getter func for jwt.Parse() function.

func KiteHome Uses

func KiteHome() (string, error)

KiteHome returns the home path of Kite directory. The returned value can be overridden by setting KITE_HOME environment variable.

func Parse Uses

func Parse() (*jwt.Token, error)

Parse the kite.key file and return it as JWT token.

func ParseFile Uses

func ParseFile(file string) (*jwt.Token, error)

ParseFile reads the given kite key file and parses it as a JWT token.

func Read Uses

func Read() (string, error)

Read the contents of the kite.key file.

func Write Uses

func Write(kiteKey string) error

Write over the kite.key file.

type Extractor Uses

type Extractor struct {
    Token  *jwt.Token
    Claims *KiteClaims

Extractor is used to extract kontrol key from JWT token.

func (*Extractor) Extract Uses

func (e *Extractor) Extract(token *jwt.Token) (interface{}, error)

Extract is a keyFunc argument for jwt.Parse function.

type KiteClaims Uses

type KiteClaims struct {
    KontrolKey string `json:"kontrolKey,omitempty"`
    KontrolURL string `json:"kontrolURL,omitempty"`

KiteClaims represents JWT token claims extended with kontrolKey claim.

Package kitekey imports 9 packages (graph) and is imported by 75 packages. Updated 2017-02-17. Refresh now. Tools for package owners.