encrypted

package
v0.0.0-...-5f4265e Latest Latest
Warning

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

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

Documentation

Overview

Provides encrypted tokens and handlers for encrypted jobs.

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(content, 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
	Content        string `json:"c,omitempty"` // opaque content
}

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