env

package
v0.15.12 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 45 Imported by: 1

Documentation

Index

Constants

View Source
const EdgeContextKey = ContextKey("edgeContext")

Variables

This section is empty.

Functions

func AddRequestContextToHttpContext added in v0.14.35

func AddRequestContextToHttpContext(r *http.Request, rc *response.RequestContext)

func AddRouter

func AddRouter(rf ApiRouter)

func GetRequestContextFromHttpContext added in v0.14.35

func GetRequestContextFromHttpContext(r *http.Request) (*response.RequestContext, error)

func ServeError added in v0.14.35

func ServeError(rw http.ResponseWriter, r *http.Request, inErr error)

Wrapper for the OpenAPI REST server to allow the the Edge API Error message responses to be used

Types

type AddRouterFunc

type AddRouterFunc func(ae *AppEnv)

func GetRouters

func GetRouters() []AddRouterFunc

type ApiRouter

type ApiRouter interface {
	Register(ae *AppEnv)
}

type AppEnv

type AppEnv struct {
	BoltStores             *persistence.Stores
	Handlers               *model.Handlers
	Embedded               *packr.Box
	Config                 *edgeConfig.Config
	EnrollmentJwtGenerator jwt.EnrollmentGenerator
	Versions               *config.Versions
	AuthHeaderName         string
	AuthCookieName         string
	ApiServerCsrSigner     cert.Signer
	ApiClientCsrSigner     cert.Signer
	ControlClientCsrSigner cert.Signer
	FingerprintGenerator   cert.FingerprintGenerator
	AuthRegistry           model.AuthRegistry
	EnrollRegistry         model.EnrollmentRegistry
	Broker                 *Broker
	HostController         HostController
	Api                    *operations.ZitiEdgeAPI
}

func NewAppEnv

func NewAppEnv(c *edgeConfig.Config) *AppEnv

func (*AppEnv) CreateRequestContext added in v0.14.35

func (ae *AppEnv) CreateRequestContext(rw http.ResponseWriter, r *http.Request) *response.RequestContext

func (*AppEnv) FillRequestContext added in v0.14.35

func (ae *AppEnv) FillRequestContext(rc *response.RequestContext) error

func (*AppEnv) GetApiClientCsrSigner

func (ae *AppEnv) GetApiClientCsrSigner() cert.Signer

func (*AppEnv) GetApiServerCsrSigner

func (ae *AppEnv) GetApiServerCsrSigner() cert.Signer

func (*AppEnv) GetAuthRegistry

func (ae *AppEnv) GetAuthRegistry() model.AuthRegistry

func (*AppEnv) GetConfig

func (ae *AppEnv) GetConfig() *edgeConfig.Config

func (*AppEnv) GetControlClientCsrSigner

func (ae *AppEnv) GetControlClientCsrSigner() cert.Signer

func (*AppEnv) GetDbProvider

func (ae *AppEnv) GetDbProvider() persistence.DbProvider

func (*AppEnv) GetEmbeddedFileContent

func (ae *AppEnv) GetEmbeddedFileContent(filePath string) (string, error)

func (*AppEnv) GetEnrollRegistry

func (ae *AppEnv) GetEnrollRegistry() model.EnrollmentRegistry

func (*AppEnv) GetEnrollmentJwtGenerator

func (ae *AppEnv) GetEnrollmentJwtGenerator() jwt.EnrollmentGenerator

func (*AppEnv) GetHandlers

func (ae *AppEnv) GetHandlers() *model.Handlers

func (*AppEnv) GetHostController

func (ae *AppEnv) GetHostController() model.HostController

func (*AppEnv) GetSessionTokenFromRequest added in v0.14.35

func (ae *AppEnv) GetSessionTokenFromRequest(r *http.Request) string

func (*AppEnv) GetStores

func (ae *AppEnv) GetStores() *persistence.Stores

func (*AppEnv) InitPersistence

func (ae *AppEnv) InitPersistence() error

func (*AppEnv) IsAllowed added in v0.14.35

func (ae *AppEnv) IsAllowed(responderFunc func(ae *AppEnv, rc *response.RequestContext), request *http.Request, entityId string, entitySubId string, permissions ...permissions.Resolver) openApiMiddleware.Responder

func (*AppEnv) IsEdgeRouterOnline

func (ae *AppEnv) IsEdgeRouterOnline(id string) bool

type AppHandler

type AppHandler func(ae *AppEnv, rc *response.RequestContext)

type AppMiddleware

type AppMiddleware func(*AppEnv, http.Handler) http.Handler

type BasicEntitySchema

type BasicEntitySchema struct {
	Post  *gojsonschema.Schema
	Patch *gojsonschema.Schema
	Put   *gojsonschema.Schema
}

type Broker

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

func NewBroker

func NewBroker(ae *AppEnv) *Broker

func (*Broker) AddEdgeRouter

func (b *Broker) AddEdgeRouter(ch channel2.Channel, edgeRouter *model.EdgeRouter)

func (*Broker) GetOnlineEdgeRouter

func (b *Broker) GetOnlineEdgeRouter(id string) *model.EdgeRouter

func (*Broker) RouterConnected

func (b *Broker) RouterConnected(r *network.Router)

func (*Broker) RouterDisconnected

func (b *Broker) RouterDisconnected(r *network.Router)

type ContextKey added in v0.14.35

type ContextKey string

use own type to avoid collisions

type DefaultEventLogger

type DefaultEventLogger struct {
	Ae *AppEnv
}

func (*DefaultEventLogger) Log

func (el *DefaultEventLogger) Log(actorType, actorId, eventType, entityType, entityId, formatString string, formatData []string, data map[interface{}]interface{})

type EnvInfo

type EnvInfo struct {
	Arch      string `json:"arch"`
	Os        string `json:"os"`
	OsRelease string `json:"osRelease"`
	OsVersion string `json:"osVersion"`
}

type HostController

type HostController interface {
	RegisterXctrl(x xctrl.Xctrl) error
	RegisterXmgmt(x xmgmt.Xmgmt) error
	GetNetwork() *network.Network
}

type IdentityEntitySchema

type IdentityEntitySchema struct {
	Post           *gojsonschema.Schema
	Patch          *gojsonschema.Schema
	Put            *gojsonschema.Schema
	ServiceConfigs *gojsonschema.Schema
}

type Schemes

type Schemes struct {
	Association             *BasicEntitySchema
	Authenticator           *BasicEntitySchema
	AuthenticatorSelf       *BasicEntitySchema
	Ca                      *BasicEntitySchema
	Config                  *BasicEntitySchema
	ConfigType              *BasicEntitySchema
	Enroller                *BasicEntitySchema
	EnrollEr                *BasicEntitySchema
	EnrollUpdb              *BasicEntitySchema
	EdgeRouter              *BasicEntitySchema
	EdgeRouterPolicy        *BasicEntitySchema
	TransitRouter           *BasicEntitySchema
	Identity                *IdentityEntitySchema
	Service                 *BasicEntitySchema
	ServiceEdgeRouterPolicy *BasicEntitySchema
	ServicePolicy           *BasicEntitySchema
	Session                 *BasicEntitySchema
	Terminator              *BasicEntitySchema
}

func (Schemes) GetEnrollErPost

func (s Schemes) GetEnrollErPost() *gojsonschema.Schema

func (Schemes) GetEnrollUpdbPost

func (s Schemes) GetEnrollUpdbPost() *gojsonschema.Schema

type SdkInfo

type SdkInfo struct {
	Branch   string `json:"branch"`
	Revision string `json:"revision"`
	Type     string `json:"type"`
	Version  string `json:"version"`
}

type TextProducer added in v0.14.35

type TextProducer struct{}

func (TextProducer) Produce added in v0.14.35

func (p TextProducer) Produce(writer io.Writer, i interface{}) error

Jump to

Keyboard shortcuts

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