encrypted

package
v0.0.0-...-47d37a2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2014 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Overview

Allow a caller to create a signed and encrypted token that contains one job request to a server. The server, trusting the key that signed the token, can then execute that job on the signer's behalf. This pattern allows a central orchestrator to delegate job requests to individual servers that can be executed asynchronously (orchestrator A allows node B to retrieve data from node C)

Index

Constants

View Source
const MaxTokenFutureSeconds = 1 * 60 * 60 * 24

Limit of how far in the future a token may expire - 1 day by default

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenConfiguration

type TokenConfiguration struct {
	// contains filtered or unexported fields
}

func NewTokenConfiguration

func NewTokenConfiguration(private, public string) (*TokenConfiguration, error)

func (*TokenConfiguration) Handler

func (t *TokenConfiguration) Handler(parent http.Handler) http.HandlerFunc

func (*TokenConfiguration) Sign

func (t *TokenConfiguration) Sign(job *cjobs.ContentRequest, keyId string, expiration int64) (string, error)

type TokenData

type TokenData struct {
	Identifier     string `json:"i,omitempty"` // request identifier
	ExpirationDate int64  `json:"d,omitempty"` // expiration time in seconds from the epoch
	User           string `json:"u,omitempty"` // user unique identifier in hexadecimal
	Type           string `json:"t,omitempty"` // resource type
	Locator        string `json:"r,omitempty"` // resource locator
}

func NewTokenFromMap

func NewTokenFromMap(m map[string][]string) (*TokenData, error)

func NewTokenFromString

func NewTokenFromString(s string) (*TokenData, error)

func (*TokenData) ToValues

func (t *TokenData) ToValues(values *url.Values)

Jump to

Keyboard shortcuts

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