Skip to content

Commit

Permalink
feat: new 'bootstrapping' service
Browse files Browse the repository at this point in the history
  • Loading branch information
KunLee76 committed Oct 1, 2024
1 parent 45f1bc4 commit b9bc331
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
32 changes: 32 additions & 0 deletions internal/sbi/api_bootstrapping.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@


package sbi

import (
"net/http"

"github.com/gin-gonic/gin"
)

func (s *Server) getBootstrappingRoutes() []Route {
return []Route{
{
"Index",
http.MethodGet,
"/",
func(c *gin.Context) {
c.JSON(http.StatusOK, "free5gc")
},
},
{
"BootstrappingInfoRequest",
http.MethodGet,
"/bootstrapping",
s.HTTPBootstrappingInfoRequest,
},
}
}

func (s *Server) HTTPBootstrappingInfoRequest(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}
4 changes: 4 additions & 0 deletions internal/sbi/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func (s *Server) applyService() {
accesstokenGroup := s.router.Group("") // accesstoken service didn't have api prefix
applyRoutes(accesstokenGroup, accesstokenRoutes)

bootstrappingRoutes := s.getBootstrappingRoutes()
bootstrappingGroup := s.router.Group(factory.NrfBootstrappingPrefix)
applyRoutes(bootstrappingGroup, bootstrappingRoutes)

discoveryRoutes := s.getNfDiscoveryRoutes()
discoveryGroup := s.router.Group(factory.NrfDiscResUriPrefix)
discAuthCheck := util.NewRouterAuthorizationCheck(models.ServiceName_NNRF_DISC)
Expand Down
1 change: 1 addition & 0 deletions pkg/factory/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const (
NrfSbiDefaultScheme = "https"
NrfNfmResUriPrefix = "/nnrf-nfm/v1"
NrfDiscResUriPrefix = "/nnrf-disc/v1"
NrfBootstrappingPrefix = "/bootstrapping"

Check failure on line 33 in pkg/factory/config.go

View workflow job for this annotation

GitHub Actions / lint (1.21)

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/free5gc) --custom-order (gci)
)

type Config struct {
Expand Down

0 comments on commit b9bc331

Please sign in to comment.