Skip to content

Commit

Permalink
Fix compile error and remove unsed code
Browse files Browse the repository at this point in the history
  • Loading branch information
andy89923 committed Feb 2, 2024
1 parent b3075bf commit 1da5809
Show file tree
Hide file tree
Showing 29 changed files with 2 additions and 457 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/gin-gonic/gin v1.9.1
github.com/google/uuid v1.3.0
github.com/mitchellh/mapstructure v1.4.3
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.8.3
github.com/urfave/cli v1.22.5
Expand Down Expand Up @@ -43,7 +44,6 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/tim-ywliu/nested-logrus-formatter v1.3.2 // indirect
Expand Down
2 changes: 1 addition & 1 deletion internal/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (c *UDRContext) GetTokenCtx(scope string, targetNF models.NfType) (
}

func (c *UDRContext) AuthorizationCheck(token, serviceName string) error {
if !context.OAuth2Required {
if !c.OAuth2Required {
logger.UtilLog.Debugf("UDRContext::AuthorizationCheck: OAuth2 not required\n")
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ import (

// HTTPQueryAmData - Retrieves the access and mobility subscription data of a UE
func HTTPQueryAmData(c *gin.Context) {
auth_err := authorizationCheck(c)
if auth_err != nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": auth_err.Error()})
return
}

req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")
req.Params["servingPlmnId"] = c.Params.ByName("servingPlmnId")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ import (

// HTTPAmfContext3gpp - To modify the AMF context data of a UE using 3gpp access in the UDR
func HTTPAmfContext3gpp(c *gin.Context) {
auth_err := authorizationCheck(c)
if auth_err != nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": auth_err.Error()})
return
}

var patchItemArray []models.PatchItem

requestBody, err := c.GetRawData()
Expand Down Expand Up @@ -78,12 +72,6 @@ func HTTPAmfContext3gpp(c *gin.Context) {

// HTTPCreateAmfContext3gpp - To store the AMF context data of a UE using 3gpp access in the UDR
func HTTPCreateAmfContext3gpp(c *gin.Context) {
auth_err := authorizationCheck(c)
if auth_err != nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": auth_err.Error()})
return
}

var amf3GppAccessRegistration models.Amf3GppAccessRegistration

requestBody, err := c.GetRawData()
Expand Down Expand Up @@ -133,12 +121,6 @@ func HTTPCreateAmfContext3gpp(c *gin.Context) {

// HTTPQueryAmfContext3gpp - Retrieves the AMF context data of a UE using 3gpp access
func HTTPQueryAmfContext3gpp(c *gin.Context) {
auth_err := authorizationCheck(c)
if auth_err != nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": auth_err.Error()})
return
}

req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ import (

// HTTPAmfContextNon3gpp - To modify the AMF context data of a UE using non 3gpp access in the UDR
func HTTPAmfContextNon3gpp(c *gin.Context) {
auth_err := authorizationCheck(c)
if auth_err != nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": auth_err.Error()})
return
}

var patchItemArray []models.PatchItem

requestBody, err := c.GetRawData()
Expand Down Expand Up @@ -78,12 +72,6 @@ func HTTPAmfContextNon3gpp(c *gin.Context) {

// HTTPCreateAmfContextNon3gpp - To store the AMF context data of a UE using non-3gpp access in the UDR
func HTTPCreateAmfContextNon3gpp(c *gin.Context) {
auth_err := authorizationCheck(c)
if auth_err != nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": auth_err.Error()})
return
}

var amfNon3GppAccessRegistration models.AmfNon3GppAccessRegistration

requestBody, err := c.GetRawData()
Expand Down Expand Up @@ -133,12 +121,6 @@ func HTTPCreateAmfContextNon3gpp(c *gin.Context) {

// HTTPQueryAmfContextNon3gpp - Retrieves the AMF context data of a UE using non-3gpp access
func HTTPQueryAmfContextNon3gpp(c *gin.Context) {
auth_err := authorizationCheck(c)
if auth_err != nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": auth_err.Error()})
return
}

req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ import (

// HTTPModifyAmfSubscriptionInfo - modify the AMF Subscription Info
func HTTPModifyAmfSubscriptionInfo(c *gin.Context) {
auth_err := authorizationCheck(c)
if auth_err != nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": auth_err.Error()})
return
}

var patchItemArray []models.PatchItem

requestBody, err := c.GetRawData()
Expand Down
12 changes: 0 additions & 12 deletions internal/sbi/datarepository/api_authentication_data_document.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ import (

// HTTPModifyAuthentication - modify the authentication subscription data of a UE
func HTTPModifyAuthentication(c *gin.Context) {
auth_err := authorizationCheck(c)
if auth_err != nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": auth_err.Error()})
return
}

var patchItemArray []models.PatchItem

requestBody, err := c.GetRawData()
Expand Down Expand Up @@ -78,12 +72,6 @@ func HTTPModifyAuthentication(c *gin.Context) {

// HTTPQueryAuthSubsData - Retrieves the authentication subscription data of a UE
func HTTPQueryAuthSubsData(c *gin.Context) {
auth_err := authorizationCheck(c)
if auth_err != nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": auth_err.Error()})
return
}

req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")

Expand Down
12 changes: 0 additions & 12 deletions internal/sbi/datarepository/api_authentication_so_r_document.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ import (

// HTTPCreateAuthenticationSoR - To store the SoR acknowledgement information of a UE
func HTTPCreateAuthenticationSoR(c *gin.Context) {
auth_err := authorizationCheck(c)
if auth_err != nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": auth_err.Error()})
return
}

var sorData models.SorData

requestBody, err := c.GetRawData()
Expand Down Expand Up @@ -78,12 +72,6 @@ func HTTPCreateAuthenticationSoR(c *gin.Context) {

// HTTPQueryAuthSoR - Retrieves the SoR acknowledgement information of a UE
func HTTPQueryAuthSoR(c *gin.Context) {
auth_err := authorizationCheck(c)
if auth_err != nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": auth_err.Error()})
return
}

req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")

Expand Down
12 changes: 0 additions & 12 deletions internal/sbi/datarepository/api_authentication_status_document.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ import (

// HTTPCreateAuthenticationStatus - To store the Authentication Status data of a UE
func HTTPCreateAuthenticationStatus(c *gin.Context) {
auth_err := authorizationCheck(c)
if auth_err != nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": auth_err.Error()})
return
}

var authEvent models.AuthEvent

requestBody, err := c.GetRawData()
Expand Down Expand Up @@ -78,12 +72,6 @@ func HTTPCreateAuthenticationStatus(c *gin.Context) {

// HTTPQueryAuthenticationStatus - Retrieves the Authentication Status of a UE
func HTTPQueryAuthenticationStatus(c *gin.Context) {
auth_err := authorizationCheck(c)
if auth_err != nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": auth_err.Error()})
return
}

req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")

Expand Down
Loading

0 comments on commit 1da5809

Please sign in to comment.