Documentation
¶
Overview ¶
*
- Copyright 2022 Comcast Cable Communications Management, LLC *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License. *
- SPDX-License-Identifier: Apache-2.0
*
- Copyright 2022 Comcast Cable Communications Management, LLC *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License. *
- SPDX-License-Identifier: Apache-2.0
*
- Copyright 2022 Comcast Cable Communications Management, LLC *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License. *
- SPDX-License-Identifier: Apache-2.0
*
- Copyright 2022 Comcast Cable Communications Management, LLC *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License. *
- SPDX-License-Identifier: Apache-2.0
*
- Copyright 2022 Comcast Cable Communications Management, LLC *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License. *
- SPDX-License-Identifier: Apache-2.0
*
- Copyright 2022 Comcast Cable Communications Management, LLC *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License. *
- SPDX-License-Identifier: Apache-2.0
*
- Copyright 2022 Comcast Cable Communications Management, LLC *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License. *
- SPDX-License-Identifier: Apache-2.0
*
- Copyright 2022 Comcast Cable Communications Management, LLC *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License. *
- SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- func AddCertExpiryToContextMap(contextMap map[string]string, clientCertExpiry string)
- func AddClientCertDurationToContext(contextMap map[string]string, clientCertExpiryStr string)
- func AddClientProtocolToContextMap(contextMap map[string]string, clientProtocolHeader string)
- func AddContextForPods(ws *xhttp.XconfServer, contextMap map[string]string, satToken string, ...) (*PodData, *AccountServiceData)
- func AddContextFromTaggingService(ws *xhttp.XconfServer, contextMap map[string]string, satToken string, ...) []string
- func AddEstbFirmwareContext(ws *xhttp.XconfServer, r *http.Request, contextMap map[string]string, ...) error
- func AddFeatureControlContext(ws *xhttp.XconfServer, r *http.Request, contextMap map[string]string, ...) (*PodData, []string, *AccountServiceData)
- func AddGroupServiceContext(ws *xhttp.XconfServer, contextMap map[string]string, macKeyName string, ...)
- func AddGroupServiceFTContext(ws *xhttp.XconfServer, macAddressKey string, contextMap map[string]string, ...) []string
- func AddGroupServiceFeatureTags(ws *xhttp.XconfServer, groupName string, contextMap map[string]string, ...) []string
- func AddLogUploaderContext(ws *xhttp.XconfServer, r *http.Request, contextMap map[string]string, ...) error
- func CalculateHashForContextData(data ContextData) (string, error)
- func CleanupLusUploadRepository(settings *logupload.Settings, apiVersion string)
- func CompareHashWithXDAS(contextMap map[string]string, xdasHash string, tags []string) (bool, error)
- func CreateAccountIdFeature(accountId string) rfc.Feature
- func CreatePartnerIdFeature(partnerId string) rfc.Feature
- func DoSplunkLog(contextMap map[string]string, evaluationResult *estbfirmware.EvaluationResult, ...)
- func GetApplicationTypeFromPartnerId(id string) string
- func GetCheckMinFirmwareHandler(w http.ResponseWriter, r *http.Request)
- func GetClientCertExpiryHeaderValue(r *http.Request) string
- func GetClientProtocolHeaderValue(r *http.Request) string
- func GetContextMapAndSettingTypes(r *http.Request) (map[string]string, []string)
- func GetEstbChangelogsPath(w http.ResponseWriter, r *http.Request)
- func GetEstbFirmwareSwuBseHandler(w http.ResponseWriter, r *http.Request)
- func GetEstbFirmwareSwuHandler(w http.ResponseWriter, r *http.Request)
- func GetEstbFirmwareVersionInfoPath(w http.ResponseWriter, r *http.Request)
- func GetEstbLastlogPath(w http.ResponseWriter, r *http.Request)
- func GetExplanation(contextMap map[string]string, evaluationResult *estbfirmware.EvaluationResult) string
- func GetFeatureControlSettingsHandler(w http.ResponseWriter, r *http.Request)
- func GetFirmwareResponse(w http.ResponseWriter, r *http.Request, xw *xhttp.XResponseWriter, ...) (int, []byte, *sharedef.FirmwareConfigFacade, map[string]string)
- func GetFirstElementsInContextMap(contextMap map[string]string)
- func GetInfoRefreshAllHandler(w http.ResponseWriter, r *http.Request)
- func GetInfoRefreshHandler(w http.ResponseWriter, r *http.Request)
- func GetInfoStatistics(w http.ResponseWriter, r *http.Request)
- func GetLogUploaderSettings(w http.ResponseWriter, r *http.Request, isTelemetry2Settings bool)
- func GetLogUploaderSettingsHandler(w http.ResponseWriter, r *http.Request)
- func GetLogUploaderT2SettingsHandler(w http.ResponseWriter, r *http.Request)
- func GetLogUploaderTelemetryProfilesHandler(w http.ResponseWriter, r *http.Request)
- func GetMissingAndEmptyQueryParams(contextMap map[string]string, missingFields *[]string, emptyFields *[]string)
- func GetPartnerFromAccountServiceByHostMac(ws *xhttp.XconfServer, macAddress string, satToken string, vargs ...log.Fields) string
- func GetTimeInLocalTimezone(currentTime time.Time, contextMap map[string]string)
- func GetTimezoneOffset() string
- func IsAdditionalProperty(key string) bool
- func IsAllowedRequest(contextMap map[string]string, clientProtocolHeader string) bool
- func IsCustomField(key string) bool
- func IsMacPresentAndValid(queryParams url.Values) (bool, string, string)
- func IsSecureConnection(clientProtocolHeader string) bool
- func LoadGroupServiceFeatureTags(key cache.Key) (cache.Value, error)
- func LogPreDisplayCleanup(lastConfigLog *coreef.ConfigChangeLog)
- func LogResponse(contextMap map[string]string, convertedContext *coreef.ConvertedContext, ...)
- func LogResultSettings(settings *logupload.Settings, telemetryRule *logupload.TelemetryRule, ...)
- func NormalizeCommonContext(contextMap map[string]string, estbMacKey string, ecmMacKey string)
- func NormalizeEstbFirmwareContext(ws *xhttp.XconfServer, r *http.Request, contextMap map[string]string, ...)
- func NormalizeFeatureControlContext(ws *xhttp.XconfServer, r *http.Request, contextMap map[string]string, ...)
- func NormalizeLogUploaderContext(ws *xhttp.XconfServer, r *http.Request, contextMap map[string]string, ...)
- func NullifyUnwantedFields(permanentTelemetryProfile *logupload.PermanentTelemetryProfile)
- func PathNotFoundHandler() http.Handler
- func PostProcessFeatureControl(ws *xhttp.XconfServer, contextMap map[string]string, isSecuredConnection bool, ...) []rfc.FeatureResponse
- func RegisterTables()
- func RemovePrefix(key string, prefixSet []string) (string, bool)
- func RouteDiagnosticApis(r *mux.Router, s *xhttp.XconfServer)
- func RouteXconfDataserviceApis(r *mux.Router, s *xhttp.XconfServer)
- func ToTelemetry2Profile(telemetryProfile []logupload.TelemetryElement) []logupload.TelemetryElement
- func UpdatePenetrationMetrics(context map[string]string, AccountServiceData *AccountServiceData, ...)
- func WebServerInjection(ws *xhttp.XconfServer, xc *XconfConfigs)
- func XconfSetup(server *xhttp.XconfServer, r *mux.Router)
- type AccountServiceData
- type AuxiliaryFirmware
- type ContextData
- type PodData
- type PrecookData
- type TelemetryEvaluationResult
- type XconfConfigs
Constants ¶
View Source
const ( ATHENS_EUROPE_TZ = "Europe/Athens" DEFAULT_OFFSET = "UTC+2:00" DTGR_PARTNER_ID = "dt-gr" GR_PREFIX = "GR" )
Variables ¶
This section is empty.
Functions ¶
func AddContextForPods ¶
func AddContextForPods(ws *xhttp.XconfServer, contextMap map[string]string, satToken string, vargs ...log.Fields) (*PodData, *AccountServiceData)
func AddEstbFirmwareContext ¶
func AddEstbFirmwareContext(ws *xhttp.XconfServer, r *http.Request, contextMap map[string]string, usePartnerAppType bool, shouldAddIp bool, vargs ...log.Fields) error
AddEstbFirmwareContext ..
func AddFeatureControlContext ¶
func AddFeatureControlContext(ws *xhttp.XconfServer, r *http.Request, contextMap map[string]string, configSetHash string, vargs ...log.Fields) (*PodData, []string, *AccountServiceData)
AddFeatureControlContext ..
func AddGroupServiceContext ¶
func AddLogUploaderContext ¶
func AddLogUploaderContext(ws *xhttp.XconfServer, r *http.Request, contextMap map[string]string, usePartnerAppType bool, vargs ...log.Fields) error
AddLogUploaderContext ..
func CalculateHashForContextData ¶
func CalculateHashForContextData(data ContextData) (string, error)
func CompareHashWithXDAS ¶
func CreateAccountIdFeature ¶
func CreatePartnerIdFeature ¶
func DoSplunkLog ¶
func DoSplunkLog(contextMap map[string]string, evaluationResult *estbfirmware.EvaluationResult, fields log.Fields)
func GetCheckMinFirmwareHandler ¶
func GetCheckMinFirmwareHandler(w http.ResponseWriter, r *http.Request)
func GetEstbChangelogsPath ¶
func GetEstbChangelogsPath(w http.ResponseWriter, r *http.Request)
func GetEstbFirmwareSwuBseHandler ¶
func GetEstbFirmwareSwuBseHandler(w http.ResponseWriter, r *http.Request)
func GetEstbFirmwareSwuHandler ¶
func GetEstbFirmwareSwuHandler(w http.ResponseWriter, r *http.Request)
func GetEstbFirmwareVersionInfoPath ¶
func GetEstbFirmwareVersionInfoPath(w http.ResponseWriter, r *http.Request)
func GetEstbLastlogPath ¶
func GetEstbLastlogPath(w http.ResponseWriter, r *http.Request)
func GetExplanation ¶
func GetExplanation(contextMap map[string]string, evaluationResult *estbfirmware.EvaluationResult) string
func GetFeatureControlSettingsHandler ¶
func GetFeatureControlSettingsHandler(w http.ResponseWriter, r *http.Request)
func GetFirmwareResponse ¶
func GetFirmwareResponse(w http.ResponseWriter, r *http.Request, xw *xhttp.XResponseWriter, fields log.Fields) (int, []byte, *sharedef.FirmwareConfigFacade, map[string]string)
func GetInfoRefreshAllHandler ¶
func GetInfoRefreshAllHandler(w http.ResponseWriter, r *http.Request)
func GetInfoRefreshHandler ¶
func GetInfoRefreshHandler(w http.ResponseWriter, r *http.Request)
func GetInfoStatistics ¶
func GetInfoStatistics(w http.ResponseWriter, r *http.Request)
func GetLogUploaderSettings ¶
func GetLogUploaderSettings(w http.ResponseWriter, r *http.Request, isTelemetry2Settings bool)
func GetLogUploaderSettingsHandler ¶
func GetLogUploaderSettingsHandler(w http.ResponseWriter, r *http.Request)
func GetLogUploaderT2SettingsHandler ¶
func GetLogUploaderT2SettingsHandler(w http.ResponseWriter, r *http.Request)
func GetLogUploaderTelemetryProfilesHandler ¶
func GetLogUploaderTelemetryProfilesHandler(w http.ResponseWriter, r *http.Request)
func GetTimeInLocalTimezone ¶
func GetTimezoneOffset ¶
func GetTimezoneOffset() string
func IsAdditionalProperty ¶
func IsAllowedRequest ¶
func IsCustomField ¶
func IsMacPresentAndValid ¶
func IsSecureConnection ¶
func LogPreDisplayCleanup ¶
func LogPreDisplayCleanup(lastConfigLog *coreef.ConfigChangeLog)
func LogResponse ¶
func LogResponse(contextMap map[string]string, convertedContext *coreef.ConvertedContext, explanation string, evaluationResult *estbfirmware.EvaluationResult, fields log.Fields)
func LogResultSettings ¶
func LogResultSettings(settings *logupload.Settings, telemetryRule *logupload.TelemetryRule, settingRules []*logupload.SettingRule, fields log.Fields)
func NormalizeCommonContext ¶
func NullifyUnwantedFields ¶
func NullifyUnwantedFields(permanentTelemetryProfile *logupload.PermanentTelemetryProfile)
func PathNotFoundHandler ¶
PathNotFoundHandler - invalid URL should return 404 with message
func PostProcessFeatureControl ¶
func PostProcessFeatureControl(ws *xhttp.XconfServer, contextMap map[string]string, isSecuredConnection bool, podData *PodData) []rfc.FeatureResponse
PostProcessFeatureControl
func RegisterTables ¶
func RegisterTables()
func RouteDiagnosticApis ¶
func RouteDiagnosticApis(r *mux.Router, s *xhttp.XconfServer)
Potential Todo: Add metrics to these routes as well
func RouteXconfDataserviceApis ¶
func RouteXconfDataserviceApis(r *mux.Router, s *xhttp.XconfServer)
func ToTelemetry2Profile ¶
func ToTelemetry2Profile(telemetryProfile []logupload.TelemetryElement) []logupload.TelemetryElement
func WebServerInjection ¶
func WebServerInjection(ws *xhttp.XconfServer, xc *XconfConfigs)
WebServerInjection - dependency injection
Types ¶
type AccountServiceData ¶
func AddFeatureControlContextFromAccountService ¶
func AddFeatureControlContextFromAccountService(ws *xhttp.XconfServer, contextMap map[string]string, satToken string, vargs ...log.Fields) *AccountServiceData
type AuxiliaryFirmware ¶
type ContextData ¶
type ContextData struct {
Mac string `json:"mac"`
Model string `json:"model"`
Partner string `json:"partner"`
//FirmwareVersion string `json:"firmwareVersion"`
SerialNum string `json:"serialNum"`
Experience string `json:"experience"`
AccountId string `json:"accountId"`
Tags []string `json:"tags"` // tags from tagging service and xdas ft
}
func NewContextDataFromContextMap ¶
func NewContextDataFromContextMap(contextMap map[string]string, tags []string) ContextData
type PrecookData ¶
type PrecookData struct {
AccountId string
PartnerId string
Model string
ApplicationType string
Env string
FwVersion string
EstbIp string
Experience string
RfcHash string
RfcRulesEngineHash string
RfcPostProcessingHash string
CtxHash string
OfferedFwVersion string
OfferedFwRfcHash string
OfferedFwRfcRulesEngineHash string
}
type XconfConfigs ¶
type XconfConfigs struct {
DeriveAppTypeFromPartnerId bool
PartnerApplicationTypes []string // List of partner's application type
EnableDeviceService bool
EnableDeviceDBLookup bool
EnableMacAccountServiceCall bool
AccountServiceMacPrefix string
EnableAccountService bool
EnableTaggingService bool
EnableTaggingServiceRFC bool
IPv4NetworkMaskPrefixLength int32
IPv6NetworkMaskPrefixLength int32
EnableFwDownloadLogs bool
EnableRfcPrecook bool
EnableRfcPrecookForOfferedFw bool
EnableRfcPrecook304 bool
RfcPrecookStartTime string
RfcPrecookEndTime string
RfcPrecookTimeZone *time.Location
RfcPrecookTimeFormat string
EnableGroupService bool
EnableFtGroups bool
EnableFtMacTags bool
EnableFtAccountTags bool
EnableFtPartnerTags bool
GroupServiceModelSet util.Set
MacTagsModelSet util.Set
AccountTagsModelSet util.Set
PartnerTagsModelSet util.Set
MacTagsPrefixList []string
AccountTagsPrefixList []string
PartnerTagsPrefixList []string
ReturnAccountId bool
ReturnAccountHash bool
EstbRecoveryFirmwareVersions string
DiagnosticAPIsEnabled bool
Account_mgmt string
GroupServiceCacheEnabled bool
RfcReturnCountryCode bool
RfcCountryCodeModelsSet util.Set
RfcCountryCodePartnersSet util.Set
AuxiliaryFirmwareList []AuxiliaryFirmware
PartnerIdValidationEnabled bool
ValidPartnerIdRegex *regexp.Regexp
SecurityTokenManagerEnabled bool
}
var ( Ws *xhttp.XconfServer Xc *XconfConfigs )
Ws - webserver object
func GetXconfConfigs ¶
func GetXconfConfigs(conf *conf.Config) *XconfConfigs
Source Files
¶
Click to show internal directories.
Click to hide internal directories.