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 NewTokenFromString ¶
Click to show internal directories.
Click to hide internal directories.