Skip to content

Commit

Permalink
fix: fix PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
a3828162 committed Jun 25, 2024
1 parent 0001050 commit d4025e0
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 97 deletions.
6 changes: 3 additions & 3 deletions internal/sbi/processor/event_exposure.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
func (p *Processor) CreateEeSubscriptionProcedure(c *gin.Context, ueIdentity string,
eesubscription models.EeSubscription,
) {
udmSelf := udm_context.GetSelf()
udmSelf := p.Context()
logger.EeLog.Debugf("udIdentity: %s", ueIdentity)
switch {
// GPSI (MSISDN identifier) represents a single UE
Expand Down Expand Up @@ -110,7 +110,7 @@ func (p *Processor) CreateEeSubscriptionProcedure(c *gin.Context, ueIdentity str

// TODO: complete this procedure based on TS 29503 5.5
func (p *Processor) DeleteEeSubscriptionProcedure(c *gin.Context, ueIdentity string, subscriptionID string) {
udmSelf := udm_context.GetSelf()
udmSelf := p.Context()

switch {
case strings.HasPrefix(ueIdentity, "msisdn-"):
Expand Down Expand Up @@ -148,7 +148,7 @@ func (p *Processor) DeleteEeSubscriptionProcedure(c *gin.Context, ueIdentity str
func (p *Processor) UpdateEeSubscriptionProcedure(c *gin.Context, ueIdentity string, subscriptionID string,
patchList []models.PatchItem,
) {
udmSelf := udm_context.GetSelf()
udmSelf := p.Context()

switch {
case strings.HasPrefix(ueIdentity, "msisdn-"):
Expand Down
9 changes: 4 additions & 5 deletions internal/sbi/processor/generate_auth_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/free5gc/openapi"
"github.com/free5gc/openapi/Nudr_DataRepository"
"github.com/free5gc/openapi/models"
udm_context "github.com/free5gc/udm/internal/context"
"github.com/free5gc/udm/internal/logger"
"github.com/free5gc/udm/pkg/suci"
"github.com/free5gc/util/milenage"
Expand Down Expand Up @@ -81,7 +80,7 @@ func (p *Processor) ConfirmAuthDataProcedure(c *gin.Context,
authEvent models.AuthEvent,
supi string,
) {
ctx, pd, err := udm_context.GetSelf().GetTokenCtx(models.ServiceName_NUDR_DR, models.NfType_UDR)
ctx, pd, err := p.Context().GetTokenCtx(models.ServiceName_NUDR_DR, models.NfType_UDR)
if err != nil {
c.JSON(int(pd.Status), pd)
return
Expand Down Expand Up @@ -124,7 +123,7 @@ func (p *Processor) GenerateAuthDataProcedure(
authInfoRequest models.AuthenticationInfoRequest,
supiOrSuci string,
) {
ctx, pd, err := udm_context.GetSelf().GetTokenCtx(models.ServiceName_NUDR_DR, models.NfType_UDR)
ctx, pd, err := p.Context().GetTokenCtx(models.ServiceName_NUDR_DR, models.NfType_UDR)
if err != nil {
c.JSON(int(pd.Status), pd)
return
Expand All @@ -133,7 +132,7 @@ func (p *Processor) GenerateAuthDataProcedure(

response := &models.AuthenticationInfoResult{}
rand.New(rand.NewSource(time.Now().UnixNano()))
supi, err := suci.ToSupi(supiOrSuci, udm_context.GetSelf().SuciProfiles)
supi, err := suci.ToSupi(supiOrSuci, p.Context().SuciProfiles)
if err != nil {
problemDetails := &models.ProblemDetails{
Status: http.StatusForbidden,
Expand Down Expand Up @@ -409,7 +408,7 @@ func (p *Processor) GenerateAuthDataProcedure(
keyIndex)
} else {
logger.UeauLog.Errorln("Re-Sync Failed UDM Public Key ",
udm_context.GetSelf().SuciProfiles[keyIndex-1].PublicKey)
p.Context().SuciProfiles[keyIndex-1].PublicKey)
}
}
logger.UeauLog.Errorln("MACS ", macS)
Expand Down
7 changes: 3 additions & 4 deletions internal/sbi/processor/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@ import (
"github.com/gin-gonic/gin"

"github.com/free5gc/openapi/models"
udm_context "github.com/free5gc/udm/internal/context"
"github.com/free5gc/udm/internal/logger"
)

func (p *Processor) DataChangeNotificationProcedure(c *gin.Context,
notifyItems []models.NotifyItem,
supi string,
) {
ctx, pd, err := udm_context.GetSelf().GetTokenCtx(models.ServiceName_NUDM_SDM, models.NfType_UDM)
ctx, pd, err := p.Context().GetTokenCtx(models.ServiceName_NUDM_SDM, models.NfType_UDM)
if err != nil {
c.JSON(int(pd.Status), pd)
return
}

ue, _ := udm_context.GetSelf().UdmUeFindBySupi(supi)
ue, _ := p.Context().UdmUeFindBySupi(supi)

clientAPI := p.consumer.GetSDMClient("DataChangeNotification")

Expand Down Expand Up @@ -61,7 +60,7 @@ func (p *Processor) DataChangeNotificationProcedure(c *gin.Context,
func (p *Processor) SendOnDeregistrationNotification(ueId string, onDeregistrationNotificationUrl string,
deregistData models.DeregistrationData,
) *models.ProblemDetails {
ctx, pd, err := udm_context.GetSelf().GetTokenCtx(models.ServiceName_NUDM_UECM, models.NfType_UDM)
ctx, pd, err := p.Context().GetTokenCtx(models.ServiceName_NUDM_UECM, models.NfType_UDM)
if err != nil {
return pd
}
Expand Down
3 changes: 1 addition & 2 deletions internal/sbi/processor/parameter_provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ import (

"github.com/free5gc/openapi"
"github.com/free5gc/openapi/models"
udm_context "github.com/free5gc/udm/internal/context"
"github.com/free5gc/udm/internal/logger"
)

func (p *Processor) UpdateProcedure(c *gin.Context,
updateRequest models.PpData,
gpsi string,
) {
ctx, pd, err := udm_context.GetSelf().GetTokenCtx(models.ServiceName_NUDR_DR, models.NfType_UDR)
ctx, pd, err := p.Context().GetTokenCtx(models.ServiceName_NUDR_DR, models.NfType_UDR)
if err != nil {
c.JSON(int(pd.Status), pd)
return
Expand Down
Loading

0 comments on commit d4025e0

Please sign in to comment.