kite: Index | Files | Directories

package testutil

import ""

Package testutil provides a default Kontrol kites for using in tests.


Package Files


func NewConfig Uses

func NewConfig() *config.Config

func NewKiteKey Uses

func NewKiteKey() *jwt.Token

NewKiteKey returns a new generated kite key. (Copied and modified from kontrol.go) If the host does not have a kite.key file kite.New() panics. This is a helper to put a fake key on it's location.

func NewKiteKeyUsername Uses

func NewKiteKeyUsername(username string) *jwt.Token

NewKiteKeyUsername is like NewKiteKey() but it uses the given username instead of using the "testuser" name

func NewKiteKeyWithKeyPair Uses

func NewKiteKeyWithKeyPair(private, public string) *jwt.Token

func NewToken Uses

func NewToken(username, private, public string) *jwt.Token

NewToken creates new JWT token for the gien username. It embedds the given public key as kontrolKey and signs the token with the private one.



Package testutil imports 9 packages (graph) and is imported by 14 packages. Updated 2018-07-30. Refresh now. Tools for package owners.