diff --git a/go.mod b/go.mod index b197976..1891363 100644 --- a/go.mod +++ b/go.mod @@ -4,29 +4,31 @@ go 1.21 require ( github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d - github.com/free5gc/openapi v1.0.9-0.20240730084323-449098e08462 + github.com/free5gc/openapi v1.0.9-0.20241112160830-092c679ef6cd github.com/free5gc/util v1.0.6 github.com/gin-gonic/gin v1.9.1 github.com/golang-jwt/jwt/v5 v5.2.1 github.com/google/uuid v1.3.0 github.com/mitchellh/mapstructure v1.4.2 github.com/pkg/errors v0.9.1 - github.com/sirupsen/logrus v1.8.1 - github.com/stretchr/testify v1.8.3 + github.com/sirupsen/logrus v1.9.3 + github.com/stretchr/testify v1.8.4 github.com/urfave/cli v1.22.5 go.mongodb.org/mongo-driver v1.8.4 gopkg.in/yaml.v2 v2.4.0 ) require ( - github.com/antihax/optional v1.0.0 // indirect github.com/bytedance/sonic v1.9.1 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/evanphx/json-patch v0.5.2 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.14.0 // indirect @@ -34,6 +36,7 @@ require ( github.com/goccy/go-json v0.10.2 // indirect github.com/golang/protobuf v1.5.0 // indirect github.com/golang/snappy v0.0.1 // indirect + github.com/h2non/gock v1.2.0 // indirect github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.13.6 // indirect @@ -53,6 +56,11 @@ require ( github.com/xdg-go/scram v1.0.2 // indirect github.com/xdg-go/stringprep v1.0.2 // indirect github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.49.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect golang.org/x/arch v0.3.0 // indirect golang.org/x/crypto v0.21.0 // indirect golang.org/x/net v0.23.0 // indirect @@ -62,6 +70,5 @@ require ( golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.6 // indirect google.golang.org/protobuf v1.33.0 // indirect - gopkg.in/h2non/gock.v1 v1.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index e98b73d..a191cfb 100644 --- a/go.sum +++ b/go.sum @@ -33,8 +33,6 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= @@ -60,8 +58,10 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.5.2 h1:xVCHIVMUu1wtM/VkR9jVZ45N3FhZfYMMYGorLCR8P3k= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= -github.com/free5gc/openapi v1.0.9-0.20240730084323-449098e08462 h1:bK9UWqOhoddpAW9RfZRp4DPZNnPfEUeHvo4I86YAuzA= -github.com/free5gc/openapi v1.0.9-0.20240730084323-449098e08462/go.mod h1:afeuEQ21QCQDxZHnFjCmYrq3gBi+cd/WDNSUbaMcILo= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/free5gc/openapi v1.0.9-0.20241112160830-092c679ef6cd h1:VRxE3QzfL1uU8ZnR9Y1aXtslHPeMIVoHb3wU0yOz2AI= +github.com/free5gc/openapi v1.0.9-0.20241112160830-092c679ef6cd/go.mod h1:aKw6uGzEibGDrn9++w4/JpWxaaUBo7GaqsvuFKU9fl4= github.com/free5gc/util v1.0.6 h1:dBt9drcXtYKE/cY5XuQcuffgsYclPIpIArhSeS6M+DQ= github.com/free5gc/util v1.0.6/go.mod h1:eSGN7POUM8LNTvg/E591XR6447a6/w1jFWGKNZPHcXw= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= @@ -73,6 +73,11 @@ github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SU github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= @@ -125,8 +130,9 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -144,6 +150,8 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/h2non/gock v1.2.0 h1:K6ol8rfrRkUOefooBC8elXoaNGYkpp7y2qcxGG6BzUE= +github.com/h2non/gock v1.2.0/go.mod h1:tNhoxHYW2W42cYkYb1WqzdbYIieALC99kpYr7rH/BQk= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -193,8 +201,8 @@ github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= @@ -202,7 +210,6 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -211,8 +218,9 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tim-ywliu/nested-logrus-formatter v1.3.2 h1:jugNJ2/CNCI79SxOJCOhwUHeN3O7/7/bj+ZRGOFlCSw= @@ -241,6 +249,16 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.49.0 h1:RtcvQ4iw3w9NBB5yRwgA4sSa82rfId7n4atVpvKx3bY= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.49.0/go.mod h1:f/PbKbRd4cdUICWell6DmzvVJ7QrmBgFrRHjXmAXbK4= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= @@ -354,6 +372,7 @@ golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= @@ -413,7 +432,6 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -496,8 +514,6 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= -gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/internal/context/context.go b/internal/context/context.go index 3dcea3f..fde7c88 100644 --- a/internal/context/context.go +++ b/internal/context/context.go @@ -19,7 +19,7 @@ import ( ) type NRFContext struct { - NrfNfProfile models.NfProfile + NrfNfProfile models.NrfNfManagementNfProfile Nrf_NfInstanceID string RootPrivKey *rsa.PrivateKey RootCert *x509.Certificate @@ -49,8 +49,8 @@ func InitNrfContext() error { configuration := config.Configuration nrfContext.NrfNfProfile.NfInstanceId = uuid.New().String() - nrfContext.NrfNfProfile.NfType = models.NfType_NRF - nrfContext.NrfNfProfile.NfStatus = models.NfStatus_REGISTERED + nrfContext.NrfNfProfile.NfType = models.NrfNfManagementNfType_NRF + nrfContext.NrfNfProfile.NfStatus = models.NrfNfManagementNfStatus_REGISTERED nrfContext.NfRegistNum = 0 serviceNameList := configuration.ServiceNameList @@ -107,20 +107,20 @@ func InitNrfContext() error { } NFServices := InitNFService(serviceNameList, config.Info.Version) - nrfContext.NrfNfProfile.NfServices = &NFServices + nrfContext.NrfNfProfile.NfServices = NFServices return nil } -func InitNFService(srvNameList []string, version string) []models.NfService { +func InitNFService(srvNameList []string, version string) []models.NrfNfManagementNfService { tmpVersion := strings.Split(version, ".") versionUri := "v" + tmpVersion[0] - NFServices := make([]models.NfService, len(srvNameList)) + NFServices := make([]models.NrfNfManagementNfService, len(srvNameList)) for index, nameString := range srvNameList { name := models.ServiceName(nameString) - NFServices[index] = models.NfService{ + NFServices[index] = models.NrfNfManagementNfService{ ServiceInstanceId: strconv.Itoa(index), ServiceName: name, - Versions: &[]models.NfServiceVersion{ + Versions: []models.NfServiceVersion{ { ApiFullVersion: version, ApiVersionInUri: versionUri, @@ -129,10 +129,10 @@ func InitNFService(srvNameList []string, version string) []models.NfService { Scheme: models.UriScheme(factory.NrfConfig.GetSbiScheme()), NfServiceStatus: models.NfServiceStatus_REGISTERED, ApiPrefix: factory.NrfConfig.GetSbiUri(), - IpEndPoints: &[]models.IpEndPoint{ + IpEndPoints: []models.IpEndPoint{ { Ipv4Address: factory.NrfConfig.GetSbiRegisterIP(), - Transport: models.TransportProtocol_TCP, + Transport: models.NrfNfManagementTransportProtocol_TCP, Port: int32(factory.NrfConfig.GetSbiPort()), }, }, diff --git a/internal/context/management_data.go b/internal/context/management_data.go index 73d58fd..e9b5046 100644 --- a/internal/context/management_data.go +++ b/internal/context/management_data.go @@ -19,23 +19,23 @@ import ( const NRF_NFINST_RES_URI_PREFIX = factory.NrfNfmResUriPrefix + "/nf-instances/" -func NnrfNFManagementDataModel(nf *models.NfProfile, nfprofile models.NfProfile) error { +func NnrfNFManagementDataModel(nf *models.NrfNfManagementNfProfile, nfprofile *models.NrfNfManagementNfProfile) error { if nfprofile.NfInstanceId != "" { nf.NfInstanceId = nfprofile.NfInstanceId } else { - return fmt.Errorf("NfInstanceId field is required\n") + return fmt.Errorf("NfInstanceId field is required") } if nfprofile.NfType != "" { nf.NfType = nfprofile.NfType } else { - return fmt.Errorf("NfType field is required\n") + return fmt.Errorf("NfType field is required") } if nfprofile.NfStatus != "" { nf.NfStatus = nfprofile.NfStatus } else { - return fmt.Errorf("NfStatus field is required\n") + return fmt.Errorf("NfStatus field is required") } nnrfNFManagementCondition(nf, nfprofile) @@ -55,18 +55,18 @@ func SetsubscriptionId() (string, error) { return hex.EncodeToString(buffer), nil } -func nnrfNFManagementCondition(nf *models.NfProfile, nfprofile models.NfProfile) { +func nnrfNFManagementCondition(nf *models.NrfNfManagementNfProfile, nfprofile *models.NrfNfManagementNfProfile) { // HeartBeatTimer if nfprofile.HeartBeatTimer >= 0 { nf.HeartBeatTimer = nfprofile.HeartBeatTimer } // PlmnList if nfprofile.PlmnList != nil { - a := make([]models.PlmnId, len(*nfprofile.PlmnList)) - copy(a, *nfprofile.PlmnList) - nf.PlmnList = &a + plmnList := make([]models.PlmnId, len(nfprofile.PlmnList)) + copy(plmnList, nfprofile.PlmnList) + nf.PlmnList = plmnList } else { - nf.PlmnList = &[]models.PlmnId{ + nf.PlmnList = []models.PlmnId{ factory.NrfConfig.Configuration.DefaultPlmnId, } } @@ -81,16 +81,16 @@ func nnrfNFManagementCondition(nf *models.NfProfile, nfprofile models.NfProfile) // ipv4Addresses if nfprofile.Ipv4Addresses != nil { // fmt.Println("NsiList") - a := make([]string, len(nfprofile.Ipv4Addresses)) - copy(a, nfprofile.Ipv4Addresses) - nf.Ipv4Addresses = a + ipv4 := make([]string, len(nfprofile.Ipv4Addresses)) + copy(ipv4, nfprofile.Ipv4Addresses) + nf.Ipv4Addresses = ipv4 } // ipv6Addresses if nfprofile.Ipv6Addresses != nil { // fmt.Println("NsiList") - a := make([]string, len(nfprofile.Ipv6Addresses)) - copy(a, nfprofile.Ipv4Addresses) - nf.Ipv6Addresses = a + ipv6 := make([]string, len(nfprofile.Ipv6Addresses)) + copy(ipv6, nfprofile.Ipv4Addresses) + nf.Ipv6Addresses = ipv6 } // DefaultNotificationSubscription if nfprofile.DefaultNotificationSubscriptions != nil { @@ -99,47 +99,47 @@ func nnrfNFManagementCondition(nf *models.NfProfile, nfprofile models.NfProfile) } } -func nnrfNFManagementOption(nf *models.NfProfile, nfprofile models.NfProfile) { +func nnrfNFManagementOption(nf *models.NrfNfManagementNfProfile, nfprofile *models.NrfNfManagementNfProfile) { // sNssais if nfprofile.SNssais != nil { // fmt.Println("SNssais") - a := make([]models.Snssai, len(*nfprofile.SNssais)) - copy(a, *nfprofile.SNssais) - nf.SNssais = &a + snssais := make([]models.ExtSnssai, len(nfprofile.SNssais)) + copy(snssais, nfprofile.SNssais) + nf.SNssais = snssais } // nsiList if nfprofile.NsiList != nil { // fmt.Println("NsiList") - a := make([]string, len(nfprofile.NsiList)) - copy(a, nfprofile.NsiList) - nf.NsiList = a + nsiList := make([]string, len(nfprofile.NsiList)) + copy(nsiList, nfprofile.NsiList) + nf.NsiList = nsiList } // allowedPlmns if nfprofile.AllowedPlmns != nil { - a := make([]models.PlmnId, len(*nfprofile.AllowedPlmns)) - copy(a, *nfprofile.AllowedPlmns) - nf.AllowedPlmns = &a + allowedPlmns := make([]models.PlmnId, len(nfprofile.AllowedPlmns)) + copy(allowedPlmns, nfprofile.AllowedPlmns) + nf.AllowedPlmns = allowedPlmns } // allowedNfTypes if nfprofile.AllowedNfTypes != nil { - a := make([]models.NfType, len(nfprofile.AllowedNfTypes)) - copy(a, nfprofile.AllowedNfTypes) - nf.AllowedNfTypes = a + allowedNfType := make([]models.NrfNfManagementNfType, len(nfprofile.AllowedNfTypes)) + copy(allowedNfType, nfprofile.AllowedNfTypes) + nf.AllowedNfTypes = allowedNfType } // allowedNfDomains if nfprofile.AllowedNfDomains != nil { - a := make([]string, len(nfprofile.AllowedNfDomains)) - copy(a, nfprofile.AllowedNfDomains) - nf.AllowedNfDomains = a + allowedNfDomains := make([]string, len(nfprofile.AllowedNfDomains)) + copy(allowedNfDomains, nfprofile.AllowedNfDomains) + nf.AllowedNfDomains = allowedNfDomains } // allowedNssais if nfprofile.AllowedNssais != nil { // fmt.Println("SNssais") - a := make([]models.Snssai, len(*nfprofile.AllowedNssais)) - copy(a, *nfprofile.AllowedNssais) - nf.AllowedNssais = &a + allowedNssais := make([]models.ExtSnssai, len(nfprofile.AllowedNssais)) + copy(allowedNssais, nfprofile.AllowedNssais) + nf.AllowedNssais = allowedNssais } // Priority if nfprofile.Priority > 0 && nfprofile.Priority <= 65535 { @@ -159,210 +159,210 @@ func nnrfNFManagementOption(nf *models.NfProfile, nfprofile models.NfProfile) { } // udrInfo if nfprofile.UdrInfo != nil { - var a models.UdrInfo + var udrInfo models.UdrInfo if nfprofile.UdrInfo.GroupId != "" { - a.GroupId = nfprofile.UdrInfo.GroupId + udrInfo.GroupId = nfprofile.UdrInfo.GroupId } if nfprofile.UdrInfo.SupiRanges != nil { - a.SupiRanges = nfprofile.UdrInfo.SupiRanges + udrInfo.SupiRanges = nfprofile.UdrInfo.SupiRanges } if nfprofile.UdrInfo.GpsiRanges != nil { - a.GpsiRanges = nfprofile.UdrInfo.GpsiRanges + udrInfo.GpsiRanges = nfprofile.UdrInfo.GpsiRanges } if nfprofile.UdrInfo.ExternalGroupIdentifiersRanges != nil { - a.ExternalGroupIdentifiersRanges = nfprofile.UdrInfo.ExternalGroupIdentifiersRanges + udrInfo.ExternalGroupIdentifiersRanges = nfprofile.UdrInfo.ExternalGroupIdentifiersRanges } if nfprofile.UdrInfo.SupportedDataSets != nil { - a.SupportedDataSets = nfprofile.UdrInfo.SupportedDataSets + udrInfo.SupportedDataSets = nfprofile.UdrInfo.SupportedDataSets } - nf.UdrInfo = &a + nf.UdrInfo = &udrInfo } // udmInfo if nfprofile.UdmInfo != nil { - var a models.UdmInfo + var udmInfo models.UdmInfo if nfprofile.UdmInfo.GroupId != "" { - a.GroupId = nfprofile.UdmInfo.GroupId + udmInfo.GroupId = nfprofile.UdmInfo.GroupId } if nfprofile.UdmInfo.SupiRanges != nil { - a.SupiRanges = nfprofile.UdmInfo.SupiRanges + udmInfo.SupiRanges = nfprofile.UdmInfo.SupiRanges } if nfprofile.UdmInfo.GpsiRanges != nil { - a.GpsiRanges = nfprofile.UdmInfo.GpsiRanges + udmInfo.GpsiRanges = nfprofile.UdmInfo.GpsiRanges } if nfprofile.UdmInfo.ExternalGroupIdentifiersRanges != nil { - a.ExternalGroupIdentifiersRanges = nfprofile.UdmInfo.ExternalGroupIdentifiersRanges + udmInfo.ExternalGroupIdentifiersRanges = nfprofile.UdmInfo.ExternalGroupIdentifiersRanges } if nfprofile.UdmInfo.RoutingIndicators != nil { - a.RoutingIndicators = nfprofile.UdmInfo.RoutingIndicators + udmInfo.RoutingIndicators = nfprofile.UdmInfo.RoutingIndicators } - nf.UdmInfo = &a + nf.UdmInfo = &udmInfo } // ausfInfo if nfprofile.AusfInfo != nil { - var a models.AusfInfo + var ausfInfo models.AusfInfo if nfprofile.AusfInfo.GroupId != "" { - a.GroupId = nfprofile.AusfInfo.GroupId + ausfInfo.GroupId = nfprofile.AusfInfo.GroupId } if nfprofile.AusfInfo.SupiRanges != nil { - a.SupiRanges = nfprofile.AusfInfo.SupiRanges + ausfInfo.SupiRanges = nfprofile.AusfInfo.SupiRanges } if nfprofile.AusfInfo.RoutingIndicators != nil { - a.RoutingIndicators = nfprofile.AusfInfo.RoutingIndicators + ausfInfo.RoutingIndicators = nfprofile.AusfInfo.RoutingIndicators } - nf.AusfInfo = &a + nf.AusfInfo = &ausfInfo } // amfInfo if nfprofile.AmfInfo != nil { - var a models.AmfInfo + var amfInfo models.NrfNfManagementAmfInfo if nfprofile.AmfInfo.AmfSetId != "" { - a.AmfSetId = nfprofile.AmfInfo.AmfSetId + amfInfo.AmfSetId = nfprofile.AmfInfo.AmfSetId } if nfprofile.AmfInfo.AmfRegionId != "" { - a.AmfRegionId = nfprofile.AmfInfo.AmfRegionId + amfInfo.AmfRegionId = nfprofile.AmfInfo.AmfRegionId } if nfprofile.AmfInfo.GuamiList != nil { - a.GuamiList = nfprofile.AmfInfo.GuamiList + amfInfo.GuamiList = nfprofile.AmfInfo.GuamiList } if nfprofile.AmfInfo.TaiList != nil { - a.TaiList = nfprofile.AmfInfo.TaiList + amfInfo.TaiList = nfprofile.AmfInfo.TaiList } if nfprofile.AmfInfo.TaiRangeList != nil { - a.TaiRangeList = nfprofile.AmfInfo.TaiRangeList + amfInfo.TaiRangeList = nfprofile.AmfInfo.TaiRangeList } if nfprofile.AmfInfo.BackupInfoAmfFailure != nil { - a.BackupInfoAmfFailure = nfprofile.AmfInfo.BackupInfoAmfFailure + amfInfo.BackupInfoAmfFailure = nfprofile.AmfInfo.BackupInfoAmfFailure } if nfprofile.AmfInfo.BackupInfoAmfRemoval != nil { - a.BackupInfoAmfRemoval = nfprofile.AmfInfo.BackupInfoAmfRemoval + amfInfo.BackupInfoAmfRemoval = nfprofile.AmfInfo.BackupInfoAmfRemoval } if nfprofile.AmfInfo.N2InterfaceAmfInfo != nil { - a.N2InterfaceAmfInfo = nfprofile.AmfInfo.N2InterfaceAmfInfo + amfInfo.N2InterfaceAmfInfo = nfprofile.AmfInfo.N2InterfaceAmfInfo } - nf.AmfInfo = &a + nf.AmfInfo = &amfInfo } // smfInfo if nfprofile.SmfInfo != nil { - var a models.SmfInfo + var smfInfo models.SmfInfo if nfprofile.SmfInfo.SNssaiSmfInfoList != nil { - a.SNssaiSmfInfoList = nfprofile.SmfInfo.SNssaiSmfInfoList + smfInfo.SNssaiSmfInfoList = nfprofile.SmfInfo.SNssaiSmfInfoList } if nfprofile.SmfInfo.TaiList != nil { - a.TaiList = nfprofile.SmfInfo.TaiList + smfInfo.TaiList = nfprofile.SmfInfo.TaiList } if nfprofile.SmfInfo.TaiRangeList != nil { - a.TaiRangeList = nfprofile.SmfInfo.TaiRangeList + smfInfo.TaiRangeList = nfprofile.SmfInfo.TaiRangeList } if nfprofile.SmfInfo.PgwFqdn != "" { - a.PgwFqdn = nfprofile.SmfInfo.PgwFqdn + smfInfo.PgwFqdn = nfprofile.SmfInfo.PgwFqdn } if nfprofile.SmfInfo.AccessType != nil { - a.AccessType = nfprofile.SmfInfo.AccessType + smfInfo.AccessType = nfprofile.SmfInfo.AccessType } - nf.SmfInfo = &a + nf.SmfInfo = &smfInfo } // upfInfo if nfprofile.UpfInfo != nil { - var a models.UpfInfo + var upfInfo models.UpfInfo if nfprofile.UpfInfo.SNssaiUpfInfoList != nil { - a.SNssaiUpfInfoList = nfprofile.UpfInfo.SNssaiUpfInfoList + upfInfo.SNssaiUpfInfoList = nfprofile.UpfInfo.SNssaiUpfInfoList } if nfprofile.UpfInfo.SmfServingArea != nil { - a.SmfServingArea = nfprofile.UpfInfo.SmfServingArea + upfInfo.SmfServingArea = nfprofile.UpfInfo.SmfServingArea } if nfprofile.UpfInfo.InterfaceUpfInfoList != nil { - a.InterfaceUpfInfoList = nfprofile.UpfInfo.InterfaceUpfInfoList + upfInfo.InterfaceUpfInfoList = nfprofile.UpfInfo.InterfaceUpfInfoList } - a.IwkEpsInd = nfprofile.UpfInfo.IwkEpsInd + upfInfo.IwkEpsInd = nfprofile.UpfInfo.IwkEpsInd - nf.UpfInfo = &a + nf.UpfInfo = &upfInfo } // pcfInfo if nfprofile.PcfInfo != nil { - var a models.PcfInfo + var pcfInfo models.PcfInfo if nfprofile.PcfInfo.DnnList != nil { - a.DnnList = nfprofile.PcfInfo.DnnList + pcfInfo.DnnList = nfprofile.PcfInfo.DnnList } if nfprofile.PcfInfo.SupiRanges != nil { - a.SupiRanges = nfprofile.PcfInfo.SupiRanges + pcfInfo.SupiRanges = nfprofile.PcfInfo.SupiRanges } if nfprofile.PcfInfo.RxDiamHost != "" { - a.RxDiamHost = nfprofile.PcfInfo.RxDiamHost + pcfInfo.RxDiamHost = nfprofile.PcfInfo.RxDiamHost } if nfprofile.PcfInfo.RxDiamRealm != "" { - a.RxDiamRealm = nfprofile.PcfInfo.RxDiamRealm + pcfInfo.RxDiamRealm = nfprofile.PcfInfo.RxDiamRealm } - nf.PcfInfo = &a + nf.PcfInfo = &pcfInfo } // bsfInfo if nfprofile.BsfInfo != nil { - var a models.BsfInfo + var bsfInfo models.NrfNfManagementBsfInfo if nfprofile.BsfInfo.DnnList != nil { - a.DnnList = nfprofile.BsfInfo.DnnList + bsfInfo.DnnList = nfprofile.BsfInfo.DnnList } if nfprofile.BsfInfo.IpDomainList != nil { - a.IpDomainList = nfprofile.BsfInfo.IpDomainList + bsfInfo.IpDomainList = nfprofile.BsfInfo.IpDomainList } if nfprofile.BsfInfo.Ipv4AddressRanges != nil { - b := make([]models.Ipv4AddressRange, len(*nfprofile.BsfInfo.Ipv4AddressRanges)) - for i := 0; i < len(*nfprofile.BsfInfo.Ipv4AddressRanges); i++ { - b[i].Start = strconv.Itoa(int(Ipv4ToInt((*nfprofile.BsfInfo.Ipv4AddressRanges)[i].Start))) - b[i].End = strconv.Itoa(int(Ipv4ToInt((*nfprofile.BsfInfo.Ipv4AddressRanges)[i].End))) + Ipv4Range := make([]models.NrfNfManagementIpv4AddressRange, len(nfprofile.BsfInfo.Ipv4AddressRanges)) + for i := 0; i < len(nfprofile.BsfInfo.Ipv4AddressRanges); i++ { + Ipv4Range[i].Start = strconv.Itoa(int(Ipv4ToInt((nfprofile.BsfInfo.Ipv4AddressRanges)[i].Start))) + Ipv4Range[i].End = strconv.Itoa(int(Ipv4ToInt((nfprofile.BsfInfo.Ipv4AddressRanges)[i].End))) } - a.Ipv4AddressRanges = &b + bsfInfo.Ipv4AddressRanges = Ipv4Range } if nfprofile.BsfInfo.Ipv6PrefixRanges != nil { - b := make([]models.Ipv6PrefixRange, len(*nfprofile.BsfInfo.Ipv6PrefixRanges)) - for i := 0; i < len(*nfprofile.BsfInfo.Ipv6PrefixRanges); i++ { - b[i].Start = Ipv6ToInt(((*nfprofile.BsfInfo.Ipv6PrefixRanges)[i].Start)).String() - b[i].End = Ipv6ToInt(((*nfprofile.BsfInfo.Ipv6PrefixRanges)[i].End)).String() + Ipv6Range := make([]models.NrfNfManagementIpv6PrefixRange, len(nfprofile.BsfInfo.Ipv6PrefixRanges)) + for i := 0; i < len(nfprofile.BsfInfo.Ipv6PrefixRanges); i++ { + Ipv6Range[i].Start = Ipv6ToInt(nfprofile.BsfInfo.Ipv6PrefixRanges[i].Start).String() + Ipv6Range[i].End = Ipv6ToInt(nfprofile.BsfInfo.Ipv6PrefixRanges[i].End).String() } - a.Ipv6PrefixRanges = &b + bsfInfo.Ipv6PrefixRanges = Ipv6Range } - nf.BsfInfo = &a + nf.BsfInfo = &bsfInfo } // chfInfo if nfprofile.ChfInfo != nil { - var a models.ChfInfo + var chfInfo models.ChfInfo if nfprofile.ChfInfo.SupiRangeList != nil { - a.SupiRangeList = nfprofile.ChfInfo.SupiRangeList + chfInfo.SupiRangeList = nfprofile.ChfInfo.SupiRangeList } if nfprofile.ChfInfo.GpsiRangeList != nil { - a.GpsiRangeList = nfprofile.ChfInfo.GpsiRangeList + chfInfo.GpsiRangeList = nfprofile.ChfInfo.GpsiRangeList } if nfprofile.ChfInfo.PlmnRangeList != nil { - a.PlmnRangeList = nfprofile.ChfInfo.PlmnRangeList + chfInfo.PlmnRangeList = nfprofile.ChfInfo.PlmnRangeList } - nf.ChfInfo = &a + nf.ChfInfo = &chfInfo } // nrfInfo if nfprofile.NrfInfo != nil { @@ -383,9 +383,9 @@ func nnrfNFManagementOption(nf *models.NfProfile, nfprofile models.NfProfile) { // nfServices if nfprofile.NfServices != nil { - a := make([]models.NfService, len(*nfprofile.NfServices)) - copy(a, *nfprofile.NfServices) - nf.NfServices = &a + nfServices := make([]models.NrfNfManagementNfService, len(nfprofile.NfServices)) + copy(nfServices, nfprofile.NfServices) + nf.NfServices = nfServices } // CustomerInfo if nfprofile.CustomInfo != nil { @@ -400,7 +400,7 @@ func GetNfInstanceURI(nfInstID string) string { return factory.NrfConfig.GetSbiUri() + NRF_NFINST_RES_URI_PREFIX + nfInstID } -func SetLocationHeader(nfprofile models.NfProfile) string { +func SetLocationHeader(nfprofile *models.NrfNfManagementNfProfile) string { var modifyUL UriList var locationHeader []string @@ -455,7 +455,7 @@ func setUriListByFilter(filter bson.M, uriList *[]string) { logger.NfmLog.Errorf("setUriListByFilter err: %+v", err) } - var filterNfTypeResults []models.NrfSubscriptionData + var filterNfTypeResults []models.NrfNfManagementSubscriptionData if err = openapi.Convert(filterNfTypeResultsRaw, &filterNfTypeResults); err != nil { logger.NfmLog.Errorf("setUriListByFilter err: %+v", err) } @@ -467,11 +467,11 @@ func setUriListByFilter(filter bson.M, uriList *[]string) { func nnrfUriList(originalUL *UriList, ul *UriList, location []string) { var i int - var b *Links + var links *Links var flag bool - var c []Item + var item []Item flag = true - b = new(Links) + links = new(Links) size := len(location) + len(originalUL.Link.Item) // check duplicate @@ -482,25 +482,25 @@ func nnrfUriList(originalUL *UriList, ul *UriList, location []string) { } if flag { - c = make([]Item, size) + item = make([]Item, size) for i = 0; i < len(originalUL.Link.Item); i++ { - c[i].Href = originalUL.Link.Item[i].Href + item[i].Href = originalUL.Link.Item[i].Href } for i = len(originalUL.Link.Item); i < len(location)+len(originalUL.Link.Item); i++ { - c[i].Href = location[i-len(originalUL.Link.Item)] + item[i].Href = location[i-len(originalUL.Link.Item)] } } else { - c = make([]Item, size-1) + item = make([]Item, size-1) for i = 0; i < len(originalUL.Link.Item); i++ { - c[i].Href = originalUL.Link.Item[i].Href + item[i].Href = originalUL.Link.Item[i].Href } } - b.Item = c - ul.Link = *b + links.Item = item + ul.Link = *links } -func GetNofificationUri(nfProfile models.NfProfile) []string { +func GetNofificationUri(nfProfile *models.NrfNfManagementNfProfile) []string { var uriList []string // nfTypeCond @@ -523,7 +523,7 @@ func GetNofificationUri(nfProfile models.NfProfile) []string { if nfProfile.NfServices != nil { var ServiceNameCond bson.M var serviceNames bson.A - for _, nfService := range *nfProfile.NfServices { + for _, nfService := range nfProfile.NfServices { serviceNames = append(serviceNames, string(nfService.ServiceName)) } ServiceNameCond = bson.M{ @@ -550,7 +550,7 @@ func GetNofificationUri(nfProfile models.NfProfile) []string { var guamiListFilter bson.M if nfProfile.AmfInfo.GuamiList != nil { var guamiListBsonArray bson.A - for _, guami := range *nfProfile.AmfInfo.GuamiList { + for _, guami := range nfProfile.AmfInfo.GuamiList { tmp, err := json.Marshal(guami) if err != nil { logger.NfmLog.Error(err) @@ -574,7 +574,7 @@ func GetNofificationUri(nfProfile models.NfProfile) []string { if nfProfile.SNssais != nil { var networkSliceFilter bson.M var snssaisBsonArray bson.A - for _, snssai := range *nfProfile.SNssais { + for _, snssai := range nfProfile.SNssais { tmp, err := json.Marshal(snssai) if err != nil { logger.NfmLog.Error(err) @@ -659,12 +659,12 @@ func NnrfUriListLimit(originalUL *UriList, limit int) { if limit < len(originalUL.Link.Item) { var i int - var b *Links = new(Links) - var c []Item = make([]Item, limit) + var links *Links = new(Links) + var item []Item = make([]Item, limit) for i = 0; i < limit; i++ { - c[i].Href = originalUL.Link.Item[i].Href + item[i].Href = originalUL.Link.Item[i].Href } - b.Item = c - originalUL.Link = *b + links.Item = item + originalUL.Link = *links } } diff --git a/internal/context/search_nf_instance.go b/internal/context/search_nf_instance.go index 3921187..3dd76c3 100644 --- a/internal/context/search_nf_instance.go +++ b/internal/context/search_nf_instance.go @@ -5,40 +5,49 @@ import ( ) type SearchNFInstances struct { - TargetNFType models.NfType `form:"target-nf-type" binding:"required"` - RequesterNFType models.NfType `form:"requester-nf-type" binding:"required"` - ServiceNames []models.ServiceName `form:"service-names" ` - RequesterNfInstanceFqdn string `form:"requester-nf-instance-fqdn" ` - TargetPlmnList []models.PlmnId `form:"target-plmn-list" ` - RequesterPlmnList []models.PlmnId `form:"requester-plmn-list" ` - TargetNfInstanceID string `form:"target-nf-instance-id" ` - TargetNfFqdn string `form:"target-nf-type" ` - HnrfURI models.UriScheme `form:"hnrf-uri" ` - Snssais []models.Snssai `form:"snssais" ` - PlmnSpecificSnssaiList []models.PlmnSnssai `form:"plmn-specific-snssai-list"` - Dnn string `form:"dnn" ` - NsiList []string `form:"nsi-list" ` - SmfServingArea string `form:"smf-serving-area" ` - Tai models.Tai `form:"tai" ` - AmfRegionID string `form:"amf-region-id" ` - AmfSetID string `form:"amf-set-id" ` - Guami models.Guami `form:"guami" ` - Supi string `form:"supi" ` - UeIpv4Address string `form:"ue-ipv4-address" ` - IPDomain string `form:"ip-domain" ` - UeIpv6Prefix string `form:"ue-ipv6-prefix" ` - PgwInd bool `form:"pgw-ind" ` - Pgw string `form:"pgw" ` - Gpsi string `form:"gpsi" ` - ExternalGroupIdentity string `form:"external-group-identity" ` - DataSet models.DataSetId `form:"data-set" ` - RoutingIndicator string `form:"routing-indicator" ` - GroupIDList []string `form:"group-id-list" ` - DnaiList []string `form:"dnai-list" ` - SupportedFeatures []string `form:"supported-features" ` - UpfIwkEpsInd bool `form:"upf-iwk-eps-ind" ` - ChfSupportedPlmn models.PlmnId `form:"chf-supported-plmn" ` - PreferredLocality string `form:"preferred-locality" ` - AccessType models.AccessType `form:"access-type" ` + TargetNFType models.NrfNfManagementNfType `form:"target-nf-type" binding:"required"` + RequesterNFType models.NrfNfManagementNfType `form:"requester-nf-type" binding:"required"` + ServiceNames []models.ServiceName `form:"service-names" ` + RequesterNfInstanceFqdn string `form:"requester-nf-instance-fqdn" ` + TargetPlmnList []models.PlmnId `form:"target-plmn-list" ` + RequesterPlmnList []models.PlmnId `form:"requester-plmn-list" ` + TargetNfInstanceID string `form:"target-nf-instance-id" ` + TargetNfFqdn string `form:"target-nf-type" ` + HnrfURI models.UriScheme `form:"hnrf-uri" ` + Snssais []models.Snssai `form:"snssais" ` + PlmnSpecificSnssaiList []models.PlmnSnssai `form:"plmn-specific-snssai-list"` + Dnn string `form:"dnn" ` + Ipv4Index []string `form:"ipv4-index"` + Ipv6Index []string `form:"ipv6-index"` + NsiList []string `form:"nsi-list" ` + SmfServingArea string `form:"smf-serving-area" ` + MbSmfServingArea string `form:"mbsmf-serving-area" ` + Tai models.Tai `form:"tai" ` + AmfRegionID string `form:"amf-region-id" ` + AmfSetID string `form:"amf-set-id" ` + Guami models.Guami `form:"guami" ` + Supi string `form:"supi" ` + UeIpv4Address string `form:"ue-ipv4-address" ` + IPDomain string `form:"ip-domain" ` + UeIpv6Prefix string `form:"ue-ipv6-prefix" ` + PgwInd bool `form:"pgw-ind" ` + Pgw string `form:"pgw" ` + PgwIP string `form:"pgw-ip" ` + Gpsi string `form:"gpsi" ` + ExternalGroupIdentity string `form:"external-group-identity" ` + InternalGroupIdentity string `form:"internal-group-identity" ` + PfdData string `form:"pfd-data" ` + DataSet models.DataSetId `form:"data-set" ` + RoutingIndicator string `form:"routing-indicator" ` + GroupIDList []string `form:"group-id-list" ` + DnaiList []string `form:"dnai-list" ` + PduSessionType []models.PduSessionType `form:"pdu-session-typs" ` + EventIdList []string `form:"event-id-list" ` + NwdafEventList []models.NwdafEvent `form:"nwdaf-event-list" ` + SupportedFeatures []string `form:"supported-features" ` + UpfIwkEpsInd bool `form:"upf-iwk-eps-ind" ` + ChfSupportedPlmn models.PlmnId `form:"chf-supported-plmn" ` + PreferredLocality string `form:"preferred-locality" ` + AccessType models.AccessType `form:"access-type" ` // IfNoneMatch string `form:"target-nf-type" ` } diff --git a/internal/context/uri_list.go b/internal/context/uri_list.go index 2d080e6..1756380 100644 --- a/internal/context/uri_list.go +++ b/internal/context/uri_list.go @@ -9,6 +9,6 @@ import ( ) type UriList struct { - NfType models.NfType `json:"nfType,omitempty" bson:"nfType,omitempty"` - Link Links `json:"_link" bson:"_link" mapstructure:"_link"` + NfType models.NrfNfManagementNfType `json:"nfType,omitempty" bson:"nfType,omitempty"` + Link Links `json:"_link" bson:"_link" mapstructure:"_link"` } diff --git a/internal/sbi/api_accesstoken.go b/internal/sbi/api_accesstoken.go index 9ae61a9..91a77f5 100644 --- a/internal/sbi/api_accesstoken.go +++ b/internal/sbi/api_accesstoken.go @@ -55,7 +55,7 @@ func (s *Server) HTTPAccessTokenRequest(c *gin.Context) { return } - var accessTokenReq models.AccessTokenReq + var accessTokenReq models.NrfAccessTokenAccessTokenReq // Request parser err := c.Request.ParseForm() @@ -80,7 +80,8 @@ func (s *Server) HTTPAccessTokenRequest(c *gin.Context) { break } } - if vt.Name() == "string" || vt.Name() == "NfType" { + if vt == reflect.TypeOf("") || vt == reflect.TypeOf(models.NrfNfManagementNfType_NRF) { + // Type is string reflect.ValueOf(&accessTokenReq).Elem().FieldByName(name).SetString(value[0]) } else { plmnid := models.PlmnId{} diff --git a/internal/sbi/api_bootstrapping.go b/internal/sbi/api_bootstrapping.go new file mode 100644 index 0000000..5d780f2 --- /dev/null +++ b/internal/sbi/api_bootstrapping.go @@ -0,0 +1,30 @@ +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{}) +} diff --git a/internal/sbi/api_nfmanagement.go b/internal/sbi/api_nfmanagement.go index cd0889e..666ecce 100644 --- a/internal/sbi/api_nfmanagement.go +++ b/internal/sbi/api_nfmanagement.go @@ -18,15 +18,11 @@ import ( "github.com/gin-gonic/gin" "github.com/mitchellh/mapstructure" - "go.mongodb.org/mongo-driver/bson" - nrf_context "github.com/free5gc/nrf/internal/context" "github.com/free5gc/nrf/internal/logger" "github.com/free5gc/nrf/internal/util" "github.com/free5gc/openapi" "github.com/free5gc/openapi/models" - timedecode "github.com/free5gc/util/mapstruct" - "github.com/free5gc/util/mongoapi" ) func (s *Server) getNfRegisterRoute() []Route { @@ -136,7 +132,7 @@ func (s *Server) HTTPGetNFInstance(c *gin.Context) { // RegisterNFInstance - Register a new NF Instance func (s *Server) HTTPRegisterNFInstance(c *gin.Context) { // // step 1: retrieve http request body - var nfprofile models.NfProfile + var nfprofile models.NrfNfManagementNfProfile requestBody, err := c.GetRawData() if err != nil { @@ -165,7 +161,7 @@ func (s *Server) HTTPRegisterNFInstance(c *gin.Context) { return } - s.Processor().HandleNFRegisterRequest(c, nfprofile) + s.Processor().HandleNFRegisterRequest(c, &nfprofile) } // UpdateNFInstance - Update NF Instance profile @@ -280,7 +276,7 @@ func (s *Server) HTTPUpdateSubscription(c *gin.Context) { // CreateSubscription - Create a new subscription func (s *Server) HTTPCreateSubscription(c *gin.Context) { - var subscription models.NrfSubscriptionData + var subscription models.NrfNfManagementSubscriptionData // step 1: retrieve http request body requestBody, err := c.GetRawData() @@ -312,271 +308,9 @@ func (s *Server) HTTPCreateSubscription(c *gin.Context) { s.Processor().HandleCreateSubscriptionRequest(c, subscription) } -func (s *Server) GetNrfInfo() *models.NrfInfo { - // init - var nrfinfo models.NrfInfo - - nrfinfo.ServedUdrInfo = s.getUdrInfo() - nrfinfo.ServedUdmInfo = s.getUdmInfo() - nrfinfo.ServedAusfInfo = s.getAusfInfo() - nrfinfo.ServedAmfInfo = s.getAmfInfo() - nrfinfo.ServedSmfInfo = s.getSmfInfo() - nrfinfo.ServedUpfInfo = s.getUpfInfo() - nrfinfo.ServedPcfInfo = s.getPcfInfo() - nrfinfo.ServedBsfInfo = s.getBsfInfo() - nrfinfo.ServedChfInfo = s.getChfInfo() - - return &nrfinfo -} - -func (s *Server) getUdrInfo() map[string]models.UdrInfo { - servedUdrInfo := make(map[string]models.UdrInfo) - var UDRProfile models.NfProfile - - collName := nrf_context.NfProfileCollName - filter := bson.M{"nfType": "UDR"} - - UDR, err := mongoapi.RestfulAPIGetMany(collName, filter) - if err != nil { - logger.NfmLog.Errorf("getUdrInfo err: %+v", err) - } - - var UDRStruct []models.NfProfile - if err = timedecode.Decode(UDR, &UDRStruct); err != nil { - logger.NfmLog.Errorf("getUdrInfo err: %+v", err) - } - - for i := 0; i < len(UDRStruct); i++ { - err = mapstructure.Decode(UDRStruct[i], &UDRProfile) - if err != nil { - panic(err) - } - index := strconv.Itoa(i) - servedUdrInfo[index] = *UDRProfile.UdrInfo - } - return servedUdrInfo -} - -func (s *Server) getUdmInfo() map[string]models.UdmInfo { - servedUdmInfo := make(map[string]models.UdmInfo) - var UDMProfile models.NfProfile - - collName := nrf_context.NfProfileCollName - filter := bson.M{"nfType": "UDM"} - - UDM, err := mongoapi.RestfulAPIGetMany(collName, filter) - if err != nil { - logger.NfmLog.Errorf("getUdmInfo err: %+v", err) - } - - var UDMStruct []models.NfProfile - if err = timedecode.Decode(UDM, &UDMStruct); err != nil { - logger.NfmLog.Errorf("getUdmInfo err: %+v", err) - } - - for i := 0; i < len(UDMStruct); i++ { - err = mapstructure.Decode(UDMStruct[i], &UDMProfile) - if err != nil { - panic(err) - } - index := strconv.Itoa(i) - servedUdmInfo[index] = *UDMProfile.UdmInfo - } - return servedUdmInfo -} - -func (s *Server) getAusfInfo() map[string]models.AusfInfo { - servedAusfInfo := make(map[string]models.AusfInfo) - var AUSFProfile models.NfProfile - - collName := nrf_context.NfProfileCollName - filter := bson.M{"nfType": "AUSF"} - - AUSF, err := mongoapi.RestfulAPIGetMany(collName, filter) - if err != nil { - logger.NfmLog.Errorf("getAusfInfo err: %+v", err) - } - - var AUSFStruct []models.NfProfile - if err = timedecode.Decode(AUSF, &AUSFStruct); err != nil { - logger.NfmLog.Errorf("getAusfInfo err: %+v", err) - } - for i := 0; i < len(AUSFStruct); i++ { - err = mapstructure.Decode(AUSFStruct[i], &AUSFProfile) - if err != nil { - panic(err) - } - index := strconv.Itoa(i) - servedAusfInfo[index] = *AUSFProfile.AusfInfo - } - return servedAusfInfo -} - -func (s *Server) getAmfInfo() map[string]models.AmfInfo { - servedAmfinfo := make(map[string]models.AmfInfo) - var AMFProfile models.NfProfile - - collName := nrf_context.NfProfileCollName - filter := bson.M{"nfType": "AMF"} - - AMF, err := mongoapi.RestfulAPIGetMany(collName, filter) - if err != nil { - logger.NfmLog.Errorf("getAmfInfo err: %+v", err) - } - - var AMFStruct []models.NfProfile - if err = timedecode.Decode(AMF, &AMFStruct); err != nil { - logger.NfmLog.Errorf("getAmfInfo err: %+v", err) - } - for i := 0; i < len(AMFStruct); i++ { - err = mapstructure.Decode(AMFStruct[i], &AMFProfile) - if err != nil { - panic(err) - } - index := strconv.Itoa(i) - servedAmfinfo[index] = *AMFProfile.AmfInfo - } - return servedAmfinfo -} - -func (s *Server) getSmfInfo() map[string]models.SmfInfo { - servedSmfInfo := make(map[string]models.SmfInfo) - var SMFProfile models.NfProfile - - collName := nrf_context.NfProfileCollName - filter := bson.M{"nfType": "SMF"} - - SMF, err := mongoapi.RestfulAPIGetMany(collName, filter) - if err != nil { - logger.NfmLog.Errorf("getSmfInfo err: %+v", err) - } - - var SMFStruct []models.NfProfile - if err = timedecode.Decode(SMF, &SMFStruct); err != nil { - logger.NfmLog.Errorf("getSmfInfo err: %+v", err) - } - for i := 0; i < len(SMFStruct); i++ { - err = mapstructure.Decode(SMFStruct[i], &SMFProfile) - if err != nil { - panic(err) - } - index := strconv.Itoa(i) - servedSmfInfo[index] = *SMFProfile.SmfInfo - } - return servedSmfInfo -} - -func (s *Server) getUpfInfo() map[string]models.UpfInfo { - servedUpfInfo := make(map[string]models.UpfInfo) - var UPFProfile models.NfProfile - - collName := nrf_context.NfProfileCollName - filter := bson.M{"nfType": "UPF"} - - UPF, err := mongoapi.RestfulAPIGetMany(collName, filter) - if err != nil { - logger.NfmLog.Errorf("getUpfInfo err: %+v", err) - } - - var UPFStruct []models.NfProfile - if err = timedecode.Decode(UPF, &UPFStruct); err != nil { - logger.NfmLog.Errorf("getUpfInfo err: %+v", err) - } - for i := 0; i < len(UPFStruct); i++ { - err = mapstructure.Decode(UPFStruct[i], &UPFProfile) - if err != nil { - panic(err) - } - index := strconv.Itoa(i) - servedUpfInfo[index] = *UPFProfile.UpfInfo - } - return servedUpfInfo -} - -func (s *Server) getPcfInfo() map[string]models.PcfInfo { - servedPcfInfo := make(map[string]models.PcfInfo) - var PCFProfile models.NfProfile - - collName := nrf_context.NfProfileCollName - filter := bson.M{"nfType": "PCF"} - - PCF, err := mongoapi.RestfulAPIGetMany(collName, filter) - if err != nil { - logger.NfmLog.Errorf("getPcfInfo err: %+v", err) - } - - var PCFStruct []models.NfProfile - if err = timedecode.Decode(PCF, &PCFStruct); err != nil { - logger.NfmLog.Errorf("getPcfInfo err: %+v", err) - } - for i := 0; i < len(PCFStruct); i++ { - err = mapstructure.Decode(PCFStruct[i], &PCFProfile) - if err != nil { - panic(err) - } - index := strconv.Itoa(i) - servedPcfInfo[index] = *PCFProfile.PcfInfo - } - return servedPcfInfo -} - -func (s *Server) getBsfInfo() map[string]models.BsfInfo { - servedBsfInfo := make(map[string]models.BsfInfo) - var BSFProfile models.NfProfile - - collName := nrf_context.NfProfileCollName - filter := bson.M{"nfType": "BSF"} - - BSF, err := mongoapi.RestfulAPIGetMany(collName, filter) - if err != nil { - logger.NfmLog.Errorf("getBsfInfo err: %+v", err) - } - - var BSFStruct []models.NfProfile - if err = timedecode.Decode(BSF, &BSFStruct); err != nil { - logger.NfmLog.Errorf("getBsfInfo err: %+v", err) - } - for i := 0; i < len(BSFStruct); i++ { - err = mapstructure.Decode(BSFStruct[i], &BSFProfile) - if err != nil { - panic(err) - } - index := strconv.Itoa(i) - servedBsfInfo[index] = *BSFProfile.BsfInfo - } - return servedBsfInfo -} - -func (s *Server) getChfInfo() map[string]models.ChfInfo { - servedChfInfo := make(map[string]models.ChfInfo) - var CHFProfile models.NfProfile - - collName := nrf_context.NfProfileCollName - filter := bson.M{"nfType": "CHF"} - - CHF, err := mongoapi.RestfulAPIGetMany(collName, filter) - if err != nil { - logger.NfmLog.Errorf("getChfInfo err: %+v", err) - } - - var CHFStruct []models.NfProfile - if err = timedecode.Decode(CHF, &CHFStruct); err != nil { - logger.NfmLog.Errorf("getChfInfo err: %+v", err) - } - for i := 0; i < len(CHFStruct); i++ { - err = mapstructure.Decode(CHFStruct[i], &CHFProfile) - if err != nil { - panic(err) - } - index := strconv.Itoa(i) - servedChfInfo[index] = *CHFProfile.ChfInfo - } - return servedChfInfo -} - // DecodeNfProfile - Only support []map[string]interface to []models.NfProfile -func (s *Server) DecodeNfProfile(source interface{}, format string) (models.NfProfile, error) { - var target models.NfProfile +func (s *Server) DecodeNfProfile(source interface{}, format string) (models.NrfNfManagementNfProfile, error) { + var target models.NrfNfManagementNfProfile // config mapstruct stringToDateTimeHook := func( diff --git a/internal/sbi/consumer/consumer.go b/internal/sbi/consumer/consumer.go index b91287e..c843fb1 100644 --- a/internal/sbi/consumer/consumer.go +++ b/internal/sbi/consumer/consumer.go @@ -2,7 +2,7 @@ package consumer import ( "github.com/free5gc/nrf/pkg/app" - "github.com/free5gc/openapi/Nnrf_NFManagement" + "github.com/free5gc/openapi/nrf/NFManagement" ) type ConsumerNrf interface { @@ -22,7 +22,7 @@ func NewConsumer(nrf ConsumerNrf) (*Consumer, error) { c.nnrfService = &nnrfService{ consumer: c, - nfMngmntClients: make(map[string]*Nnrf_NFManagement.APIClient), + nfMngmntClients: make(map[string]*NFManagement.APIClient), } return c, nil } diff --git a/internal/sbi/consumer/nrf_service.go b/internal/sbi/consumer/nrf_service.go index b6194f4..6a445ff 100644 --- a/internal/sbi/consumer/nrf_service.go +++ b/internal/sbi/consumer/nrf_service.go @@ -7,8 +7,8 @@ import ( "sync" "github.com/free5gc/nrf/internal/logger" - "github.com/free5gc/openapi/Nnrf_NFManagement" "github.com/free5gc/openapi/models" + "github.com/free5gc/openapi/nrf/NFManagement" ) type nnrfService struct { @@ -16,10 +16,10 @@ type nnrfService struct { nfMngmntMu sync.RWMutex - nfMngmntClients map[string]*Nnrf_NFManagement.APIClient + nfMngmntClients map[string]*NFManagement.APIClient } -func (s *nnrfService) getNFManagementClient(uri string) *Nnrf_NFManagement.APIClient { +func (s *nnrfService) getNFManagementClient(uri string) *NFManagement.APIClient { if uri == "" { return nil } @@ -30,9 +30,9 @@ func (s *nnrfService) getNFManagementClient(uri string) *Nnrf_NFManagement.APICl return client } - configuration := Nnrf_NFManagement.NewConfiguration() + configuration := NFManagement.NewConfiguration() configuration.SetBasePath(uri) - client = Nnrf_NFManagement.NewAPIClient(configuration) + client = NFManagement.NewAPIClient(configuration) s.nfMngmntMu.RUnlock() s.nfMngmntMu.Lock() @@ -42,10 +42,11 @@ func (s *nnrfService) getNFManagementClient(uri string) *Nnrf_NFManagement.APICl } func (s *nnrfService) SendNFStatusNotify( + ctx context.Context, notification_event models.NotificationEventType, nfInstanceUri string, url string, - nfProfile *models.NfProfile, + nfProfile *models.NrfNfManagementNfProfile, ) *models.ProblemDetails { logger.ConsumerLog.Infoln("SendNFStatusNotify") @@ -60,15 +61,20 @@ func (s *nnrfService) SendNFStatusNotify( s.nfMngmntMu.RLock() defer s.nfMngmntMu.RUnlock() - notifcationData := models.NotificationData{ + notifcationData := models.NrfNfManagementNotificationData{ Event: notification_event, NfInstanceUri: nfInstanceUri, } if nfProfile != nil { - buildNotificationDataFromNfProfile(notifcationData.NfProfile, nfProfile) + notifcationData.NfProfile = nfProfile } - res, err := client.NotificationApi.NotificationPost(context.TODO(), notifcationData) + request := &NFManagement.CreateSubscriptionOnNFStatusEventPostRequest{ + NrfNfManagementNotificationData: ¬ifcationData, + } + + _, err := client.SubscriptionsCollectionApi.CreateSubscriptionOnNFStatusEventPost( + ctx, nfInstanceUri, request) if err != nil { logger.NfmLog.Infof("Notify fail: %v", err) problemDetails := &models.ProblemDetails{ @@ -78,60 +84,6 @@ func (s *nnrfService) SendNFStatusNotify( } return problemDetails } - if res != nil { - defer func() { - if resCloseErr := res.Body.Close(); resCloseErr != nil { - logger.NfmLog.Errorf("NotificationApi response body cannot close: %+v", resCloseErr) - } - }() - if status := res.StatusCode; status != http.StatusNoContent { - logger.NfmLog.Warnln("Error status in NotificationPost: ", status) - problemDetails := &models.ProblemDetails{ - Status: int32(status), - Cause: "NOTIFICATION_ERROR", - } - return problemDetails - } - } - return nil -} -func buildNotificationDataFromNfProfile(notifProfile *models.NfProfileNotificationData, nfProfile *models.NfProfile) { - notifProfile.NfInstanceId = nfProfile.NfInstanceId - notifProfile.NfType = nfProfile.NfType - notifProfile.NfStatus = nfProfile.NfStatus - notifProfile.HeartBeatTimer = nfProfile.HeartBeatTimer - notifProfile.PlmnList = *nfProfile.PlmnList - notifProfile.SNssais = *nfProfile.SNssais - notifProfile.PerPlmnSnssaiList = nfProfile.PerPlmnSnssaiList - notifProfile.NsiList = nfProfile.NsiList - notifProfile.Fqdn = nfProfile.Fqdn - notifProfile.InterPlmnFqdn = nfProfile.InterPlmnFqdn - notifProfile.Ipv4Addresses = nfProfile.Ipv4Addresses - notifProfile.Ipv6Addresses = nfProfile.Ipv6Addresses - notifProfile.AllowedPlmns = *nfProfile.AllowedPlmns - notifProfile.AllowedNfTypes = nfProfile.AllowedNfTypes - notifProfile.AllowedNfDomains = nfProfile.AllowedNfDomains - notifProfile.AllowedNssais = *nfProfile.AllowedNssais - notifProfile.Priority = nfProfile.Priority - notifProfile.Capacity = nfProfile.Capacity - notifProfile.Load = nfProfile.Load - notifProfile.Locality = nfProfile.Locality - notifProfile.UdrInfo = nfProfile.UdrInfo - notifProfile.UdmInfo = nfProfile.UdmInfo - notifProfile.AusfInfo = nfProfile.AusfInfo - notifProfile.AmfInfo = nfProfile.AmfInfo - notifProfile.SmfInfo = nfProfile.SmfInfo - notifProfile.UpfInfo = nfProfile.UpfInfo - notifProfile.PcfInfo = nfProfile.PcfInfo - notifProfile.BsfInfo = nfProfile.BsfInfo - notifProfile.ChfInfo = nfProfile.ChfInfo - notifProfile.NrfInfo = nfProfile.NrfInfo - notifProfile.CustomInfo = nfProfile.CustomInfo - notifProfile.RecoveryTime = nfProfile.RecoveryTime - notifProfile.NfServicePersistence = nfProfile.NfServicePersistence - notifProfile.NfServices = *nfProfile.NfServices - notifProfile.NfProfileChangesSupportInd = nfProfile.NfProfileChangesSupportInd - notifProfile.NfProfileChangesInd = nfProfile.NfProfileChangesInd - notifProfile.DefaultNotificationSubscriptions = nfProfile.DefaultNotificationSubscriptions + return nil } diff --git a/internal/sbi/processor/access_token.go b/internal/sbi/processor/access_token.go index 2a9969f..7e18370 100644 --- a/internal/sbi/processor/access_token.go +++ b/internal/sbi/processor/access_token.go @@ -20,7 +20,7 @@ import ( "github.com/free5gc/util/mongoapi" ) -func (p *Processor) HandleAccessTokenRequest(c *gin.Context, accessTokenReq models.AccessTokenReq) { +func (p *Processor) HandleAccessTokenRequest(c *gin.Context, accessTokenReq models.NrfAccessTokenAccessTokenReq) { // Param of AccessTokenRsp logger.AccTokenLog.Debugln("Handle AccessTokenRequest") @@ -42,8 +42,8 @@ func (p *Processor) HandleAccessTokenRequest(c *gin.Context, accessTokenReq mode util.GinProblemJson(c, problemDetails) } -func (p *Processor) AccessTokenProcedure(request models.AccessTokenReq) ( - *models.AccessTokenRsp, *models.AccessTokenErr, +func (p *Processor) AccessTokenProcedure(request models.NrfAccessTokenAccessTokenReq) ( + *models.NrfAccessTokenAccessTokenRsp, *models.AccessTokenErr, ) { logger.AccTokenLog.Debugln("In AccessTokenProcedure") @@ -83,7 +83,7 @@ func (p *Processor) AccessTokenProcedure(request models.AccessTokenReq) ( } } - response := &models.AccessTokenRsp{ + response := &models.NrfAccessTokenAccessTokenRsp{ AccessToken: accessToken, TokenType: tokenType, ExpiresIn: expiration, @@ -92,7 +92,7 @@ func (p *Processor) AccessTokenProcedure(request models.AccessTokenReq) ( return response, nil } -func (p *Processor) AccessTokenScopeCheck(req models.AccessTokenReq) *models.AccessTokenErr { +func (p *Processor) AccessTokenScopeCheck(req models.NrfAccessTokenAccessTokenReq) *models.AccessTokenErr { // Check with nf profile collName := nrf_context.NfProfileCollName reqGrantType := req.GrantType @@ -122,7 +122,7 @@ func (p *Processor) AccessTokenScopeCheck(req models.AccessTokenReq) *models.Acc } } - nfProfile := models.NfProfile{} + nfProfile := models.NrfNfManagementNfProfile{} err = mapstruct.Decode(consumerNfInfo, &nfProfile) if err != nil { @@ -200,7 +200,7 @@ func (p *Processor) AccessTokenScopeCheck(req models.AccessTokenReq) *models.Acc } } - nfProfile = models.NfProfile{} + nfProfile = models.NrfNfManagementNfProfile{} err = mapstruct.Decode(producerNfInfo, &nfProfile) if err != nil { logger.AccTokenLog.Errorln("Certificate verify error: " + err.Error()) @@ -208,7 +208,7 @@ func (p *Processor) AccessTokenScopeCheck(req models.AccessTokenReq) *models.Acc Error: "invalid_client", } } - nfServices := *nfProfile.NfServices + nfServices := nfProfile.NfServices scopes := strings.Split(req.Scope, " ") diff --git a/internal/sbi/processor/nf_discovery.go b/internal/sbi/processor/nf_discovery.go index 2524077..0acc9d4 100644 --- a/internal/sbi/processor/nf_discovery.go +++ b/internal/sbi/processor/nf_discovery.go @@ -2,6 +2,7 @@ package processor import ( "encoding/json" + "log" "math/big" "net/http" "net/url" @@ -11,7 +12,6 @@ import ( "github.com/gin-gonic/gin" "go.mongodb.org/mongo-driver/bson" - "github.com/free5gc/nrf/internal/context" nrf_context "github.com/free5gc/nrf/internal/context" "github.com/free5gc/nrf/internal/logger" "github.com/free5gc/nrf/internal/util" @@ -93,7 +93,7 @@ func (p *Processor) NFDiscoveryProcedure(c *gin.Context, queryParameters url.Val logger.DiscLog.Warnln("UnMasrhal complexQuery Error: ", err) } // Check either CNF or DNF - if complexQueryStruct.CNf != nil && complexQueryStruct.DNf != nil { + if complexQueryStruct.CnfUnits != nil && complexQueryStruct.DnfUnits != nil { problemDetails := &models.ProblemDetails{ Title: "Invalid Parameter", Status: http.StatusBadRequest, @@ -128,7 +128,7 @@ func (p *Processor) NFDiscoveryProcedure(c *gin.Context, queryParameters url.Val } // nfProfile data for response - var nfProfilesStruct []models.NfProfile + var nfProfilesStruct []models.NrfNfDiscoveryNfProfile if err = timedecode.Decode(nfProfilesRaw, &nfProfilesStruct); err != nil { logger.DiscLog.Errorf("NF Profile Raw decode error: %+v", err) problemDetails := &models.ProblemDetails{ @@ -143,36 +143,37 @@ func (p *Processor) NFDiscoveryProcedure(c *gin.Context, queryParameters url.Val // handle ipv4 & ipv6 if queryParameters["target-nf-type"][0] == "BSF" { - for i, nfProfile := range nfProfilesStruct { + for i := range nfProfilesStruct { + nfProfile := &nfProfilesStruct[i] if nfProfile.BsfInfo != nil && nfProfile.BsfInfo.Ipv4AddressRanges != nil { - for j := range *nfProfile.BsfInfo.Ipv4AddressRanges { - ipv4IntStart, errAtoi := strconv.Atoi((((*nfProfilesStruct[i].BsfInfo.Ipv4AddressRanges)[j]).Start)) + for addressRange := range nfProfile.BsfInfo.Ipv4AddressRanges { + ipv4IntStart, errAtoi := strconv.Atoi(nfProfile.BsfInfo.Ipv4AddressRanges[addressRange].Start) if errAtoi != nil { logger.DiscLog.Warnln("ipv4IntStart Atoi Error: ", errAtoi) } - ((*nfProfilesStruct[i].BsfInfo.Ipv4AddressRanges)[j]).Start = context.Ipv4IntToIpv4String(int64(ipv4IntStart)) - ipv4IntEnd, errAtoi := strconv.Atoi((((*nfProfilesStruct[i].BsfInfo.Ipv4AddressRanges)[j]).End)) + (nfProfile.BsfInfo.Ipv4AddressRanges)[addressRange].Start = nrf_context.Ipv4IntToIpv4String(int64(ipv4IntStart)) + ipv4IntEnd, errAtoi := strconv.Atoi(nfProfile.BsfInfo.Ipv4AddressRanges[addressRange].End) if errAtoi != nil { logger.DiscLog.Warnln("ipv4IntEnd Atoi Error: ", errAtoi) } - ((*nfProfilesStruct[i].BsfInfo.Ipv4AddressRanges)[j]).End = context.Ipv4IntToIpv4String(int64(ipv4IntEnd)) + nfProfile.BsfInfo.Ipv4AddressRanges[addressRange].End = nrf_context.Ipv4IntToIpv4String(int64(ipv4IntEnd)) } } + if nfProfile.BsfInfo != nil && nfProfile.BsfInfo.Ipv6PrefixRanges != nil { - for j := range *nfProfile.BsfInfo.Ipv6PrefixRanges { + for prefixRange := range nfProfile.BsfInfo.Ipv6PrefixRanges { ipv6IntStart := new(big.Int) - ipv6IntStart.SetString(((*nfProfilesStruct[i].BsfInfo.Ipv6PrefixRanges)[j]).Start, 10) - ((*nfProfilesStruct[i].BsfInfo.Ipv6PrefixRanges)[j]).Start = context.Ipv6IntToIpv6String(ipv6IntStart) + ipv6IntStart.SetString(nfProfile.BsfInfo.Ipv6PrefixRanges[prefixRange].Start, 10) + nfProfile.BsfInfo.Ipv6PrefixRanges[prefixRange].Start = nrf_context.Ipv6IntToIpv6String(ipv6IntStart) ipv6IntEnd := new(big.Int) - ipv6IntEnd.SetString(((*nfProfilesStruct[i].BsfInfo.Ipv6PrefixRanges)[j]).End, 10) - ((*nfProfilesStruct[i].BsfInfo.Ipv6PrefixRanges)[j]).End = context.Ipv6IntToIpv6String(ipv6IntEnd) + ipv6IntEnd.SetString(nfProfile.BsfInfo.Ipv6PrefixRanges[prefixRange].End, 10) + nfProfile.BsfInfo.Ipv6PrefixRanges[prefixRange].End = nrf_context.Ipv6IntToIpv6String(ipv6IntEnd) } } } } validityPeriod := 100 - // Build SearchResult model searchResult := &models.SearchResult{ ValidityPeriod: int32(validityPeriod), @@ -339,9 +340,10 @@ func buildFilter(queryParameters url.Values) bson.M { // Pattern: '^[A-Fa-f0-9]{6}$' if queryParameters["snssais"] != nil { snssais := queryParameters["snssais"][0] + // snssais = [{"sst":1,"sd":"fedcba"}] var snssaisBsonArray bson.A - slices := util.SnssaisToBsonM(snssais) + slices := util.SnssaisToBsonM(snssais[1 : len(snssais)-1]) for _, slice := range slices { snssaisBsonArray = append(snssaisBsonArray, bson.M{"sNssais": bson.M{"$elemMatch": slice}}) } @@ -685,7 +687,7 @@ func buildFilter(queryParameters url.Values) bson.M { var ueIpv4AddressFilter bson.M if targetNfType == "BSF" { ueIpv4Address := queryParameters["ue-ipv4-address"][0] - ueIpv4AddressNumber := context.Ipv4ToInt(ueIpv4Address) + ueIpv4AddressNumber := nrf_context.Ipv4ToInt(ueIpv4Address) ueIpv4AddressFilter = bson.M{ "$or": []bson.M{ { @@ -737,7 +739,7 @@ func buildFilter(queryParameters url.Values) bson.M { var ueIpv6PrefixFilter bson.M if targetNfType == "BSF" { ueIpv6Prefix := queryParameters["ue-ipv6-prefix"][0] - ueIpv6PrefixNumber := context.Ipv6ToInt(ueIpv6Prefix) + ueIpv6PrefixNumber := nrf_context.Ipv6ToInt(ueIpv6Prefix) ueIpv6PrefixFilter = bson.M{ "$or": []bson.M{ { @@ -881,7 +883,7 @@ func buildFilter(queryParameters url.Values) bson.M { var externalGroupIdentityFilter bson.M externalGroupIdentity := queryParameters["external-group-identity"][0] - encodedGroupId := context.EncodeGroupId(externalGroupIdentity) + encodedGroupId := nrf_context.EncodeGroupId(externalGroupIdentity) if targetNfType == "UDM" { externalGroupIdentityFilter = bson.M{ @@ -1182,7 +1184,7 @@ type AtomElem struct { func complexQueryFilter(complexQueryParameter *models.ComplexQuery) bson.M { complexQueryType := "" - if complexQueryParameter.CNf != nil { + if complexQueryParameter.CnfUnits != nil { complexQueryType = COMPLEX_QUERY_TYPE_CNF } else { complexQueryType = COMPLEX_QUERY_TYPE_DNF @@ -1195,11 +1197,16 @@ func complexQueryFilter(complexQueryParameter *models.ComplexQuery) bson.M { filter = bson.M{ "$and": []bson.M{}, } - for _, cnfUnit := range complexQueryParameter.CNf.CnfUnits { + for _, cnfUnit := range complexQueryParameter.CnfUnits { var queryParameters map[string]*AtomElem = make(map[string]*AtomElem) var cnfUnitFilter bson.M for _, atom := range cnfUnit.CnfUnit { - queryParameters[atom.Attr] = &AtomElem{value: atom.Value, negative: atom.Negative} + valueJson, err := json.Marshal(atom.Value) + if err != nil { + log.Fatalf("Failed: %v", err) + } + value := string(valueJson) + queryParameters[atom.Attr] = &AtomElem{value: value, negative: atom.Negative} } cnfUnitFilter = complexQueryFilterSubprocess(queryParameters, complexQueryType) @@ -1780,7 +1787,7 @@ func complexQueryFilterSubprocess(queryParameters map[string]*AtomElem, complexQ var ueIpv4AddressFilter bson.M if targetNfType == "BSF" { ueIpv4Address := queryParameters["ue-ipv4-address"].value - ueIpv4AddressNumber := context.Ipv4ToInt(ueIpv4Address) + ueIpv4AddressNumber := nrf_context.Ipv4ToInt(ueIpv4Address) ueIpv4AddressFilter = bson.M{ "bsfInfo": bson.M{ "$elemMatch": bson.M{ @@ -1832,7 +1839,7 @@ func complexQueryFilterSubprocess(queryParameters map[string]*AtomElem, complexQ var ueIpv6PrefixFilter bson.M if targetNfType == "BSF" { ueIpv6Prefix := queryParameters["ue-ipv6-prefix"].value - ueIpv6PrefixNumber := context.Ipv6ToInt(ueIpv6Prefix) + ueIpv6PrefixNumber := nrf_context.Ipv6ToInt(ueIpv6Prefix) ueIpv6PrefixFilter = bson.M{ "bsfInfo": bson.M{ "$elemMatch": bson.M{ diff --git a/internal/sbi/processor/nf_management.go b/internal/sbi/processor/nf_management.go index 29692b8..4c37c6c 100644 --- a/internal/sbi/processor/nf_management.go +++ b/internal/sbi/processor/nf_management.go @@ -1,6 +1,7 @@ package processor import ( + "context" "encoding/json" "fmt" "net/http" @@ -39,7 +40,7 @@ func (p *Processor) HandleGetNFInstanceRequest(c *gin.Context, nfInstanceId stri p.GetNFInstanceProcedure(c, nfInstanceId) } -func (p *Processor) HandleNFRegisterRequest(c *gin.Context, nfProfile models.NfProfile) { +func (p *Processor) HandleNFRegisterRequest(c *gin.Context, nfProfile *models.NrfNfManagementNfProfile) { logger.NfmLog.Infoln("Handle NFRegisterRequest") p.NFRegisterProcedure(c, nfProfile) @@ -102,7 +103,7 @@ func (p *Processor) HandleUpdateSubscriptionRequest( func (p *Processor) HandleCreateSubscriptionRequest( c *gin.Context, - subscription models.NrfSubscriptionData, + subscription models.NrfNfManagementSubscriptionData, ) { logger.NfmLog.Infoln("Handle CreateSubscriptionRequest") @@ -125,7 +126,7 @@ func (p *Processor) HandleCreateSubscriptionRequest( } func (p *Processor) CreateSubscriptionProcedure( - subscription models.NrfSubscriptionData, + subscription models.NrfNfManagementSubscriptionData, ) (bson.M, *models.ProblemDetails) { subscriptionID, err := nrf_context.SetsubscriptionId() if err != nil { @@ -267,7 +268,7 @@ func (p *Processor) NFDeregisterProcedure(nfInstanceID string) *models.ProblemDe } // nfProfile data for response - var nfProfiles []models.NfProfile + var nfProfiles []models.NrfNfManagementNfProfile if err = timedecode.Decode(nfProfilesRaw, &nfProfiles); err != nil { logger.NfmLog.Warnln("Time decode error: ", err) problemDetails := &models.ProblemDetails{ @@ -288,14 +289,14 @@ func (p *Processor) NFDeregisterProcedure(nfInstanceID string) *models.ProblemDe return problemDetails } - uriList := nrf_context.GetNofificationUri(nfProfiles[0]) + uriList := nrf_context.GetNofificationUri(&nfProfiles[0]) nfInstanceType := nfProfiles[0].NfType nfInstanceUri := nrf_context.GetNfInstanceURI(nfInstanceID) // set info for NotificationData Notification_event := models.NotificationEventType_DEREGISTERED for _, uri := range uriList { - problemDetails := p.Consumer().SendNFStatusNotify(Notification_event, nfInstanceUri, uri, nil) + problemDetails := p.Consumer().SendNFStatusNotify(context.Background(), Notification_event, nfInstanceUri, uri, nil) if problemDetails != nil { return problemDetails } @@ -345,7 +346,7 @@ func (p *Processor) UpdateNFInstanceProcedure(nfInstanceID string, patchJSON []b nf, } - var nfProfiles []models.NfProfile + var nfProfiles []models.NrfNfManagementNfProfile if err = timedecode.Decode(nfProfilesRaw, &nfProfiles); err != nil { logger.NfmLog.Errorf("UpdateNFInstanceProcedure err: %+v", err) } @@ -355,14 +356,14 @@ func (p *Processor) UpdateNFInstanceProcedure(nfInstanceID string, patchJSON []b return nil } - uriList := nrf_context.GetNofificationUri(nfProfiles[0]) + uriList := nrf_context.GetNofificationUri(&nfProfiles[0]) // set info for NotificationData Notification_event := models.NotificationEventType_PROFILE_CHANGED nfInstanceUri := nrf_context.GetNfInstanceURI(nfInstanceID) for _, uri := range uriList { - p.Consumer().SendNFStatusNotify(Notification_event, nfInstanceUri, uri, &nfProfiles[0]) + p.Consumer().SendNFStatusNotify(context.Background(), Notification_event, nfInstanceUri, uri, &nfProfiles[0]) } return nf } @@ -389,10 +390,10 @@ func (p *Processor) GetNFInstanceProcedure(c *gin.Context, nfInstanceID string) func (p *Processor) NFRegisterProcedure( c *gin.Context, - nfProfile models.NfProfile, + nfProfile *models.NrfNfManagementNfProfile, ) { logger.NfmLog.Traceln("[NRF] In NFRegisterProcedure") - var nf models.NfProfile + var nf models.NrfNfManagementNfProfile err := nrf_context.NnrfNFManagementDataModel(&nf, nfProfile) if err != nil { @@ -454,7 +455,7 @@ func (p *Processor) NFRegisterProcedure( if existed { logger.NfmLog.Infoln("NFRegister NfProfile Update:", nfInstanceId) - uriList := nrf_context.GetNofificationUri(nf) + uriList := nrf_context.GetNofificationUri(&nf) // set info for NotificationData Notification_event := models.NotificationEventType_PROFILE_CHANGED @@ -462,7 +463,8 @@ func (p *Processor) NFRegisterProcedure( // receive the rsp from handler for _, uri := range uriList { - problemDetails := p.Consumer().SendNFStatusNotify(Notification_event, nfInstanceUri, uri, &nfProfile) + problemDetails := p.Consumer().SendNFStatusNotify(context.Background(), + Notification_event, nfInstanceUri, uri, nfProfile) if problemDetails != nil { util.GinProblemJson(c, problemDetails) return @@ -474,7 +476,7 @@ func (p *Processor) NFRegisterProcedure( return } else { // Create NF Profile case logger.NfmLog.Infoln("Create NF Profile:", nfInstanceId) - uriList := nrf_context.GetNofificationUri(nf) + uriList := nrf_context.GetNofificationUri(&nf) // set info for NotificationData Notification_event := models.NotificationEventType_REGISTERED nfInstanceUri := locationHeaderValue @@ -483,7 +485,8 @@ func (p *Processor) NFRegisterProcedure( p.Context().AddNfRegister() for _, uri := range uriList { - problemDetails := p.Consumer().SendNFStatusNotify(Notification_event, nfInstanceUri, uri, &nfProfile) + problemDetails := p.Consumer().SendNFStatusNotify(context.Background(), + Notification_event, nfInstanceUri, uri, nfProfile) if problemDetails != nil { util.GinProblemJson(c, problemDetails) return diff --git a/internal/sbi/server.go b/internal/sbi/server.go index 1a3f43e..f4c1436 100644 --- a/internal/sbi/server.go +++ b/internal/sbi/server.go @@ -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) diff --git a/pkg/factory/config.go b/pkg/factory/config.go index d6a41bc..ed5c8f8 100644 --- a/pkg/factory/config.go +++ b/pkg/factory/config.go @@ -30,6 +30,7 @@ const ( NrfSbiDefaultScheme = "https" NrfNfmResUriPrefix = "/nnrf-nfm/v1" NrfDiscResUriPrefix = "/nnrf-disc/v1" + NrfBootstrappingPrefix = "/bootstrapping" ) type Config struct {