Documentation ¶
Index ¶
- Constants
- func AddRouter(rf ApiRouter)
- func InitPersistence(p *config.Persistence) *gorm.DB
- func NewMethodNotAllowedHandler(ae *AppEnv) http.Handler
- func NewNotFoundHandler(ae *AppEnv) http.Handler
- func WrapByIdHandler(ae *AppEnv, f AuthHandlerFunc, idType response.IdType, ...) http.HandlerFunc
- type AddRouterFunc
- type ApiRouter
- type AppEnv
- func (ae *AppEnv) GetApiClientCsrSigner() cert.Signer
- func (ae *AppEnv) GetApiServerCsrSigner() cert.Signer
- func (ae *AppEnv) GetAuthRegistry() model.AuthRegistry
- func (ae *AppEnv) GetConfig() *edgeconfig.Config
- func (ae *AppEnv) GetControlClientCsrSigner() cert.Signer
- func (ae *AppEnv) GetDbProvider() persistence.DbProvider
- func (ae *AppEnv) GetEmbeddedFileContent(filePath string) (string, error)
- func (ae *AppEnv) GetEnrollRegistry() model.EnrollmentRegistry
- func (ae *AppEnv) GetEnrollmentJwtGenerator() jwt.EnrollmentGenerator
- func (ae *AppEnv) GetHandlers() *model.Handlers
- func (ae *AppEnv) GetHostController() model.HostController
- func (ae *AppEnv) GetSchemas() model.Schemas
- func (ae *AppEnv) GetStores() *persistence.Stores
- func (ae *AppEnv) HandleDelete(router *mux.Router, path string, f AppHandler, prs ...permissions.Resolver)
- func (ae *AppEnv) HandleGet(router *mux.Router, path string, f AppHandler, prs ...permissions.Resolver)
- func (ae *AppEnv) HandlePost(router *mux.Router, path string, f AppHandler, prs ...permissions.Resolver)
- func (ae *AppEnv) InitPersistence() error
- func (ae *AppEnv) IsEdgeRouterOnline(id string) bool
- func (ae *AppEnv) LoadSchemas() error
- func (ae *AppEnv) WrapHandler(f AppHandler, prs ...permissions.Resolver) http.HandlerFunc
- func (ae *AppEnv) WrapMiddleware(f AppMiddleware) mux.MiddlewareFunc
- type AppHandler
- type AppMiddleware
- type AuthHandlerFunc
- type AuthModuler
- type AuthStore
- type Authenticator
- type BaseApi
- type BasicEntitySchema
- type Broker
- type DefaultEventLogger
- type DriverGenerator
- type Enroller
- type EnrollmentContext
- type EnrollmentContextOld
- type EnvInfo
- type HandlerContext
- type HostController
- type IdentityEntitySchema
- type MethodNotAllowedHandler
- type Migrater
- type NotFoundHandler
- type PostgresDriverGenerator
- type Registerer
- type Registry
- func (r *Registry) AddAuthenticator(a Authenticator)
- func (r *Registry) AddEnroller(e Enroller)
- func (r *Registry) AddMigrater(m Migrater)
- func (r *Registry) AddModule(a AuthModuler)
- func (r *Registry) AddRegisterer(rer Registerer)
- func (r *Registry) GetAuthenticatorByMethod(m string) Authenticator
- func (r *Registry) GetAuthenticators() []Authenticator
- func (r *Registry) GetEnrollerByMethod(m string) Enroller
- func (r *Registry) GetEnrollers() []Enroller
- func (r *Registry) GetMigraters() []Migrater
- func (r *Registry) GetRegisterers() []Registerer
- type Schemes
- type SdkInfo
Constants ¶
View Source
const ( ClientCertHeader = "X-Client-CertPem" EdgeRouterProxyRequest = "X-Edge-Router-Proxy-Request" )
View Source
const ( SessionRemovedType = int32(edge_ctrl_pb.ContentType_SessionRemovedType) SessionAddedType = int32(edge_ctrl_pb.ContentType_SessionAddedType) SessionUpdatedType = int32(edge_ctrl_pb.ContentType_SessionUpdatedType) ApiSessionHeartbeatType = int32(edge_ctrl_pb.ContentType_ApiSessionHeartbeatType) ApiSessionRemovedType = int32(edge_ctrl_pb.ContentType_ApiSessionRemovedType) ApiSessionAddedType = int32(edge_ctrl_pb.ContentType_ApiSessionAddedType) ApiSessionUpdatedType = int32(edge_ctrl_pb.ContentType_ApiSessionUpdatedType) ServerHelloType = int32(edge_ctrl_pb.ContentType_ServerHelloType) ClientHelloType = int32(edge_ctrl_pb.ContentType_ClientHelloType) ErrorType = int32(edge_ctrl_pb.ContentType_ErrorType) )
View Source
const MigrationPathPostgres = "embedded://db/postgres/migrations"
View Source
const PackrPrefix = "embedded"
Variables ¶
This section is empty.
Functions ¶
func InitPersistence ¶
func InitPersistence(p *config.Persistence) *gorm.DB
func NewNotFoundHandler ¶
func WrapByIdHandler ¶
func WrapByIdHandler(ae *AppEnv, f AuthHandlerFunc, idType response.IdType, prs ...permissions.Resolver) http.HandlerFunc
Types ¶
type AddRouterFunc ¶
type AddRouterFunc func(ae *AppEnv)
func GetRouters ¶
func GetRouters() []AddRouterFunc
type AppEnv ¶
type AppEnv struct { BoltStores *persistence.Stores Handlers *model.Handlers Embedded *packr.Box Schemes *Schemes 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 RootRouter *mux.Router CurrentIdentityRouter *mux.Router RequestResponderFactory response.RequestResponderFactory ModelHandlers *migration.ModelHandlers AuthRegistry model.AuthRegistry EnrollRegistry model.EnrollmentRegistry Broker *Broker HostController HostController }
func NewAppEnv ¶
func NewAppEnv(c *edgeconfig.Config) *AppEnv
func (*AppEnv) GetApiClientCsrSigner ¶
func (*AppEnv) GetApiServerCsrSigner ¶
func (*AppEnv) GetAuthRegistry ¶
func (ae *AppEnv) GetAuthRegistry() model.AuthRegistry
func (*AppEnv) GetConfig ¶
func (ae *AppEnv) GetConfig() *edgeconfig.Config
func (*AppEnv) GetControlClientCsrSigner ¶
func (*AppEnv) GetDbProvider ¶
func (ae *AppEnv) GetDbProvider() persistence.DbProvider
func (*AppEnv) GetEmbeddedFileContent ¶
func (*AppEnv) GetEnrollRegistry ¶
func (ae *AppEnv) GetEnrollRegistry() model.EnrollmentRegistry
func (*AppEnv) GetEnrollmentJwtGenerator ¶
func (ae *AppEnv) GetEnrollmentJwtGenerator() jwt.EnrollmentGenerator
func (*AppEnv) GetHandlers ¶
func (*AppEnv) GetHostController ¶
func (ae *AppEnv) GetHostController() model.HostController
func (*AppEnv) GetSchemas ¶
func (*AppEnv) GetStores ¶
func (ae *AppEnv) GetStores() *persistence.Stores
func (*AppEnv) HandleDelete ¶
func (ae *AppEnv) HandleDelete(router *mux.Router, path string, f AppHandler, prs ...permissions.Resolver)
func (*AppEnv) HandleGet ¶
func (ae *AppEnv) HandleGet(router *mux.Router, path string, f AppHandler, prs ...permissions.Resolver)
func (*AppEnv) HandlePost ¶
func (ae *AppEnv) HandlePost(router *mux.Router, path string, f AppHandler, prs ...permissions.Resolver)
func (*AppEnv) InitPersistence ¶
func (*AppEnv) IsEdgeRouterOnline ¶
func (*AppEnv) LoadSchemas ¶
func (*AppEnv) WrapHandler ¶
func (ae *AppEnv) WrapHandler(f AppHandler, prs ...permissions.Resolver) http.HandlerFunc
func (*AppEnv) WrapMiddleware ¶
func (ae *AppEnv) WrapMiddleware(f AppMiddleware) mux.MiddlewareFunc
type AppHandler ¶
type AppHandler func(ae *AppEnv, rc *response.RequestContext)
type AuthHandlerFunc ¶
type AuthHandlerFunc func(ae *AppEnv, rc *response.RequestContext, hc *HandlerContext)
type AuthModuler ¶
type AuthModuler interface { Registerer Migrater Authenticator Enroller }
type Authenticator ¶
type BaseApi ¶
type BaseApi struct { Id string `json:"id"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` Links *response.Links `json:"_links"` Tags map[string]interface{} `json:"tags"` }
func FromBaseDbEntity ¶
func FromBaseDbEntity(entity *migration.BaseDbEntity) *BaseApi
func FromBaseModelEntity ¶
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 (*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 (*Broker) RouterDisconnected ¶
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 DriverGenerator ¶
type Enroller ¶
type Enroller interface { ProcessEnrollmentConfig(ae *AppEnv, method string, config interface{}) (interface{}, error) Enroll(ae *AppEnv, rc *response.RequestContext, ec *EnrollmentContextOld) CreateEnrollment(ae *AppEnv, ec *EnrollmentContextOld, tx *gorm.DB) error IsIdentityEnrollment(m string) bool IsEnrollerForMethod(m string) bool RenderEnrollmentDetails(e *migration.Enrollment) (interface{}, error) }
type EnrollmentContext ¶
type EnrollmentContext struct { Enrollment *model.Enrollment Authenticator *model.Authenticator Identity *model.Identity Method string //dupes Enrollment.Method, but Enrollment is not always defined }
type EnrollmentContextOld ¶
type EnrollmentContextOld struct { Enrollment *migration.Enrollment Authenticator *migration.Authenticator Identity *migration.Identity Method string //dupes Enrollment.Method, but Enrollment is not always defined }
type HandlerContext ¶
type HostController ¶
type IdentityEntitySchema ¶
type IdentityEntitySchema struct { Post *gojsonschema.Schema Patch *gojsonschema.Schema Put *gojsonschema.Schema ServiceConfigs *gojsonschema.Schema }
type MethodNotAllowedHandler ¶
type MethodNotAllowedHandler struct {
// contains filtered or unexported fields
}
func (*MethodNotAllowedHandler) ServeHTTP ¶
func (handler *MethodNotAllowedHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type NotFoundHandler ¶
type NotFoundHandler struct {
// contains filtered or unexported fields
}
func (*NotFoundHandler) ServeHTTP ¶
func (handler *NotFoundHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type PostgresDriverGenerator ¶
type PostgresDriverGenerator struct { }
func (*PostgresDriverGenerator) AppDriver ¶
func (pg *PostgresDriverGenerator) AppDriver(cs string) (*gorm.DB, error)
func (*PostgresDriverGenerator) MigrationDriver ¶
func (pg *PostgresDriverGenerator) MigrationDriver(cs string) (database.Driver, error)
func (PostgresDriverGenerator) Name ¶
func (PostgresDriverGenerator) Name() string
type Registerer ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func (*Registry) AddAuthenticator ¶
func (r *Registry) AddAuthenticator(a Authenticator)
func (*Registry) AddEnroller ¶
func (*Registry) AddMigrater ¶
func (*Registry) AddModule ¶
func (r *Registry) AddModule(a AuthModuler)
func (*Registry) AddRegisterer ¶
func (r *Registry) AddRegisterer(rer Registerer)
func (*Registry) GetAuthenticatorByMethod ¶
func (r *Registry) GetAuthenticatorByMethod(m string) Authenticator
func (*Registry) GetAuthenticators ¶
func (r *Registry) GetAuthenticators() []Authenticator
func (*Registry) GetEnrollerByMethod ¶
func (*Registry) GetEnrollers ¶
func (*Registry) GetMigraters ¶
func (*Registry) GetRegisterers ¶
func (r *Registry) GetRegisterers() []Registerer
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
Click to show internal directories.
Click to hide internal directories.