Skip to content

Commit

Permalink
fix: missing oauth check
Browse files Browse the repository at this point in the history
  • Loading branch information
yccodr committed Apr 29, 2024
1 parent 155556c commit fdee497
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/sbi/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import (
"github.com/free5gc/nssf/internal/logger"
"github.com/free5gc/nssf/internal/repository"
"github.com/free5gc/nssf/internal/sbi/processor"
"github.com/free5gc/nssf/internal/util"
"github.com/free5gc/nssf/pkg/factory"
"github.com/free5gc/openapi/models"
"github.com/free5gc/util/httpwrapper"
logger_util "github.com/free5gc/util/logger"
)
Expand Down Expand Up @@ -93,10 +95,18 @@ func newRouter(s *Server) *gin.Engine {
router := logger_util.NewGinWithLogrus(logger.GinLog)

nssaiAvailabilityGroup := router.Group(factory.NssfNssaiavailResUriPrefix)
nssaiAvailabilityAuthCheck := util.NewRouterAuthorizationCheck(models.ServiceName_NNSSF_NSSAIAVAILABILITY)
nssaiAvailabilityGroup.Use(func(c *gin.Context) {
nssaiAvailabilityAuthCheck.Check(c, s.Context())
})
nssaiAvailabilityRoutes := s.getNssaiAvailabilityRoutes()
AddService(nssaiAvailabilityGroup, nssaiAvailabilityRoutes)

nsSelectionGroup := router.Group(factory.NssfNsselectResUriPrefix)
nsSelectionAuthCheck := util.NewRouterAuthorizationCheck(models.ServiceName_NNSSF_NSSELECTION)
nsSelectionGroup.Use(func(c *gin.Context) {
nsSelectionAuthCheck.Check(c, s.Context())
})
nsSelectionRoutes := s.getNsSelectionRoutes()
AddService(nsSelectionGroup, nsSelectionRoutes)

Expand Down

0 comments on commit fdee497

Please sign in to comment.