ks

package
v0.0.0-...-1aa5fac Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2015 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Copyright 2015 Yahoo Author: David Leon Gil (dgil@yahoo-inc.com) License: Apache 2

Copyright 2015 Yahoo Author: David Leon Gil (dgil@yahoo-inc.com) License: Apache 2

Copyright 2015 Yahoo Author: David Leon Gil (dgil@yahoo-inc.com) License: Apache 2

Copyright 2015 Yahoo Author: David Leon Gil (dgil@yahoo-inc.com) License: Apache 2

Copyright 2015 Yahoo Author: David Leon Gil (dgil@yahoo-inc.com) License: Apache 2

Copyright 2015 Yahoo Author: David Leon Gil (dgil@yahoo-inc.com) License: Apache 2

Copyright 2015 Yahoo Author: David Leon Gil (dgil@yahoo-inc.com) License: Apache 2

Index

Constants

This section is empty.

Variables

View Source
var (
	// Post handles requests to /v1/k/{userid}/{deviceid}
	// The body of the request is the key to associate with
	// this user's device {deviceid}
	// It requires that
	//    {userid}
	//    body.userid
	// are identical.
	Post = requireAuth(post, true)
	Get  = requireAuth(get, false)
)
View Source
var (
	Config = &config{

		UseTLS:   true,
		SkipAuth: false,

		Addr: "localhost:25519",

		DbFn:      "data/25519.db",
		KauthFn:   "data/kauth/kauth.pem",
		TLSPrefix: "data/tls/localhost.",
	}
)

Functions

This section is empty.

Types

type DKey

type DKey struct {
	DeviceID  string `json:"deviceid"`
	Key       string `json:"key"`
	Timestamp int64  `json:"t"`
	UserID    string `json:"userid"`
}

A DKey represents the key for a single device.

type Key

type Key struct {
	Userid   []byte
	Deviceid []byte
	Key      []byte
}

type KeyShop

type KeyShop interface {
	New(userid, deviceid, key []byte) int
	Update(userid, deviceid, key []byte) int
	Get(userid []byte) (map[string][]byte, int)
}

type UKeys

type UKeys struct {
	Timestamp int64             `json:"t"`
	UserID    string            `json:"userid"`
	Keys      map[string]string `json:"keys"`
}

UKeys represents a keyset for a single user.

Directories

Path Synopsis
cmd
ks

Jump to

Keyboard shortcuts

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