models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package models provides data structures for imaging requests, responses, and status codes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Seed

type Seed struct {
	Issued   time.Time
	Username string
	Certs    []appengine.Certificate
	Hash     []byte
}

Seed represents the data that validates proof of origin for a request. It is always accompanied by a signature that is used to decrypt and validate its contents.

type SeedFile

type SeedFile struct {
	Seed      Seed
	Signature []byte
}

SeedFile models the file that is stored on disk by the bootstraper. It is similar to SeedResponse, but does not contain the uneccessary Status and ErrorCode fields, which can contain data not intended to be stored on disk.

type SeedRequest

type SeedRequest struct {
	Hash []byte
}

SeedRequest models the data that a client must submit as part of a Seed request

type SeedResponse

type SeedResponse struct {
	Status    string
	ErrorCode StatusCode
	Seed      Seed
	Signature []byte
}

SeedResponse models the data that is passed back to the client when a seed request is successfully processed.

type SignRequest

type SignRequest struct {
	Seed      Seed
	Signature []byte
	Mac       []string
	Path      string
	Hash      []byte
}

SignRequest models the data that a client can submit as part of a sign request.

type SignResponse

type SignResponse struct {
	Status    string
	ErrorCode StatusCode
	SignedURL string
}

SignResponse models the response to a client sign request.

type StatusCode

type StatusCode int

StatusCode represents an appengine status code, and is used to communicate reasons for request and result rejections, as well as internal failures.

const (
	StatusSuccess     StatusCode = 0
	StatusConfigError StatusCode = iota + 100
	StatusReqUnreadable
	StatusJSONError
	StatusSignError
	StatusSeedError
	StatusSeedInvalidHash
	StatusInvalidUser
)

Internal Status Messages, provided to the client as part of response messages.

Jump to

Keyboard shortcuts

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