diff --git a/.golangci.yml b/.golangci.yml index 59ca42e..2be6683 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -169,13 +169,8 @@ linters-settings: - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf - # enable or disable analyzers by name - enable: - - atomicalign - enable-all: false - disable: - - shadow - disable-all: false + # enable all analyzers + enable-all: true depguard: list-type: blacklist include-go-root: false diff --git a/context/context.go b/context/context.go index cd48f20..231efd7 100644 --- a/context/context.go +++ b/context/context.go @@ -39,7 +39,6 @@ type UDMContext struct { Name string NfId string GroupId string - SBIPort int RegisterIPv4 string // IP register to NRF BindingIPv4 string UriScheme models.UriScheme @@ -53,6 +52,7 @@ type UDMContext struct { Keys *factory.Keys EeSubscriptionIDGenerator *idgenerator.IDGenerator PlmnList []factory.PlmnSupportItem + SBIPort int } type UdmUeContext struct { @@ -65,7 +65,6 @@ type UdmUeContext struct { AccessAndMobilitySubscriptionData *models.AccessAndMobilitySubscriptionData SmfSelSubsData *models.SmfSelectionSubscriptionData UeCtxtInSmfData *models.UeContextInSmfData - TraceDataResponse models.TraceDataResponse TraceData *models.TraceData SessionManagementSubsData map[string]models.SessionManagementSubscriptionData SubsDataSets *models.SubscriptionDataSets @@ -75,6 +74,7 @@ type UdmUeContext struct { UdrUri string UdmSubsToNotify map[string]*models.SubscriptionDataSubscriptions EeSubscriptions map[string]*models.EeSubscription // subscriptionID as key + TraceDataResponse models.TraceDataResponse amSubsDataLock sync.Mutex smfSelSubsDataLock sync.Mutex SmSubsDataLock sync.RWMutex @@ -87,9 +87,9 @@ func (ue *UdmUeContext) init() { } type UdmNFContext struct { - SubscriptionID string SubscribeToNotifChange *models.SdmSubscription // SubscriptionID as key SubscribeToNotifSharedDataChange *models.SdmSubscription // SubscriptionID as key + SubscriptionID string } func (context *UDMContext) GetUdmProfileAHNPublicKey() string { diff --git a/factory/config.go b/factory/config.go index 3cec936..15d5c7f 100644 --- a/factory/config.go +++ b/factory/config.go @@ -47,12 +47,12 @@ type Configuration struct { } type Sbi struct { + Tls *Tls `yaml:"tls,omitempty"` Scheme string `yaml:"scheme"` RegisterIPv4 string `yaml:"registerIPv4,omitempty"` // IP that is registered at NRF. // IPv6Addr string `yaml:"ipv6Addr,omitempty"` BindingIPv4 string `yaml:"bindingIPv4,omitempty"` // IP used to run the server in the node. Port int `yaml:"port,omitempty"` - Tls *Tls `yaml:"tls,omitempty"` } type Tls struct { diff --git a/httpcallback/router.go b/httpcallback/router.go index 55e7301..502fc24 100644 --- a/httpcallback/router.go +++ b/httpcallback/router.go @@ -7,7 +7,6 @@ package httpcallback import ( "net/http" - "strings" "github.com/gin-gonic/gin" "github.com/omec-project/logger_util" @@ -23,14 +22,14 @@ func init() { // Route is the information for every URI. type Route struct { + // HandlerFunc is the handler function of this route. + HandlerFunc gin.HandlerFunc // Name is the name of this Route. Name string // Method is the string for the HTTP method. ex) GET, POST etc.. Method string // Pattern is the pattern of the URI. Pattern string - // HandlerFunc is the handler function of this route. - HandlerFunc gin.HandlerFunc } // Routes is the list of the generated Route. @@ -70,16 +69,11 @@ func Index(c *gin.Context) { var routes = Routes{ { - "Index", - "GET", - "/", - Index, + Name: "Index", Method: "GET", + Pattern: "/", HandlerFunc: Index, }, - { - "DataChangeNotificationToNF", - strings.ToUpper("Post"), - "/sdm-subscriptions", - HTTPDataChangeNotificationToNF, + Name: "DataChangeNotificationToNF", Method: "POST", + Pattern: "/sdm-subscriptions", HandlerFunc: HTTPDataChangeNotificationToNF, }, } diff --git a/producer/generate_auth_data.go b/producer/generate_auth_data.go index 39db7c9..217fe5d 100644 --- a/producer/generate_auth_data.go +++ b/producer/generate_auth_data.go @@ -388,10 +388,10 @@ func GenerateAuthDataProcedure(authInfoRequest models.AuthenticationInfoRequest, problemDetails = &models.ProblemDetails{ Status: http.StatusForbidden, Cause: authenticationRejected, - Detail: deCodeErr.Error(), + Detail: err.Error(), } - logger.UeauLog.Errorln("err", deCodeErr) + logger.UeauLog.Errorln("err", err) return nil, problemDetails }