Documentation ¶
Index ¶
- Constants
- type ApiURLs
- type ApplicationContext
- func (appCtx ApplicationContext) ExtendContext(ctx context.Context) context.Context
- func (appCtx ApplicationContext) GetApplication() string
- func (appCtx ApplicationContext) GetLogger() *logrus.Entry
- func (appCtx ApplicationContext) GetRuntimeUrls() *RuntimeURLs
- func (appCtx ApplicationContext) IsEmpty() bool
- type ApplicationContextExtractor
- type ClientCertContextService
- type ClientContextService
- type ClusterContext
- type ClusterContextStrategy
- type ConnectorClientExtractor
- type ContextExtender
- type ContextExtractor
- type CtxEnabledType
- type ExtendedApplicationContext
- type LookupEnabledType
- type RuntimeURLs
Constants ¶
const ( MetadataURLFormat = "%s/%s/v1/metadata/services" EventsURLFormat = "%s/%s/v1/events" EventsInfoURLFormat = "%s/%s/v1/events/subscribed" RuntimeDefaultCommonName = "*Runtime*" )
const ( // ApplicationHeader is key representing Application in headers ApplicationHeader = "Application" // ApplicationContextKey is the key value for storing Application in context ApplicationContextKey clientContextKey = "ApplicationContext" // ApiURLsKey is the key value for storing API hosts in context ApiURLsKey clientContextKey = "ApiURLs" // ClusterContextKey is the key value for storing cluster data in context ClusterContextKey clientContextKey = "ClusterContext" // TenantHeader is key representing Tenant in headers TenantHeader = "Tenant" // GroupHeader is key representing Group in headers GroupHeader = "Group" // GroupEmpty represents empty value for Group GroupEmpty = "" // TenantEmpty represents empty value for Tenant TenantEmpty = "" // ApplicationEmpty represents empty value for Application ApplicationEmpty = "" // LookupEnabled represents value for required fetch from Runtime LookupEnabled LookupEnabledType = true // LookupDisabled represents value for not required fetch from Runtime LookupDisabled LookupEnabledType = false )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationContext ¶
type ApplicationContext struct { Application string `json:"application"` ClusterContext }
func ExtractApplicationContext ¶
func ExtractApplicationContext(ctx context.Context) (ApplicationContext, apperrors.AppError)
func (ApplicationContext) ExtendContext ¶
func (appCtx ApplicationContext) ExtendContext(ctx context.Context) context.Context
ExtendContext extends provided context with ApplicationContext
func (ApplicationContext) GetApplication ¶
func (appCtx ApplicationContext) GetApplication() string
GetApplication returns Application identifier
func (ApplicationContext) GetLogger ¶
func (appCtx ApplicationContext) GetLogger() *logrus.Entry
GetLogger returns context logger with embedded context data (Application, Group and Tenant)
func (ApplicationContext) GetRuntimeUrls ¶
func (appCtx ApplicationContext) GetRuntimeUrls() *RuntimeURLs
GetRuntimeUrls returns nil as ApplicationContext does not contain RuntimeURLs
func (ApplicationContext) IsEmpty ¶
func (appCtx ApplicationContext) IsEmpty() bool
IsEmpty returns false if Application is set
type ApplicationContextExtractor ¶
type ApplicationContextExtractor func(ctx context.Context) (ApplicationContext, apperrors.AppError)
type ClientCertContextService ¶
type ClientCertContextService interface { ClientContextService ClientContext() ClientContextService GetSubject() certificates.CSRSubject }
type ClientContextService ¶
type ClientContextService interface { GetRuntimeUrls() *RuntimeURLs GetLogger() *logrus.Entry }
type ClusterContext ¶
type ClusterContext struct { Group string `json:"group,omitempty"` Tenant string `json:"tenant,omitempty"` }
func (ClusterContext) ExtendContext ¶
func (clsCtx ClusterContext) ExtendContext(ctx context.Context) context.Context
ExtendContext extends provided context with ClusterContext
func (ClusterContext) GetLogger ¶
func (clsCtx ClusterContext) GetLogger() *logrus.Entry
GetLogger returns context logger with embedded context data (Group and Tenant)
func (ClusterContext) GetRuntimeUrls ¶
func (clsCtx ClusterContext) GetRuntimeUrls() *RuntimeURLs
GetRuntimeUrls returns nil as ClusterContext does not contain RuntimeURLs
func (ClusterContext) IsEmpty ¶
func (clsCtx ClusterContext) IsEmpty() bool
IsEmpty returns false if both Group and Tenant are set
type ClusterContextStrategy ¶
type ClusterContextStrategy interface { ReadClusterContextFromRequest(r *http.Request) ClusterContext IsValidContext(clusterCtx ClusterContext) bool }
func NewClusterContextStrategy ¶
func NewClusterContextStrategy(clusterContextEnabled CtxEnabledType) ClusterContextStrategy
type ConnectorClientExtractor ¶
type ConnectorClientExtractor func(ctx context.Context) (ClientCertContextService, apperrors.AppError)
type ContextExtender ¶
func NewApplicationContextExtender ¶
func NewApplicationContextExtender() ContextExtender
NewApplicationContextExtender returns empty ApplicationContext
func NewClusterContextExtender ¶
func NewClusterContextExtender() ContextExtender
NewClusterContextExtender creates empty ClusterContext
type ContextExtractor ¶
type ContextExtractor struct {
// contains filtered or unexported fields
}
func NewContextExtractor ¶
func NewContextExtractor(subjectDefaults certificates.CSRSubject) *ContextExtractor
func (*ContextExtractor) CreateApplicationClientContextService ¶
func (ext *ContextExtractor) CreateApplicationClientContextService(ctx context.Context) (ClientCertContextService, apperrors.AppError)
func (*ContextExtractor) CreateClusterClientContextService ¶
func (ext *ContextExtractor) CreateClusterClientContextService(ctx context.Context) (ClientCertContextService, apperrors.AppError)
type ExtendedApplicationContext ¶
type ExtendedApplicationContext struct { ApplicationContext RuntimeURLs }
func (ExtendedApplicationContext) GetRuntimeUrls ¶
func (extAppCtx ExtendedApplicationContext) GetRuntimeUrls() *RuntimeURLs
GetRuntimeUrls returns pointer to RuntimeURLs
func (ExtendedApplicationContext) MarshalJSON ¶
func (extAppCtx ExtendedApplicationContext) MarshalJSON() ([]byte, error)
MarshalJSON marshals ExtendedApplicationContext to JSON as ApplicationContext
type LookupEnabledType ¶
type LookupEnabledType bool
LookupEnabledType type defines if headers must be specified