From 114bd26e2b919805afead6d2c06848020f658ef3 Mon Sep 17 00:00:00 2001 From: free5gc-org Date: Tue, 9 Nov 2021 11:48:40 +0000 Subject: [PATCH] refactor packages, update go.mod, and add config validator --- .gitignore | 18 +- .golangci.yml | 17 +- CHANGELOG.md | 9 - LICENSE.txt => LICENSE | 0 ausf.go | 53 ---- cmd/main.go | 93 ++++++ factory/config.go | 59 ---- go.mod | 22 +- go.sum | 181 +++++++----- .../context}/ausf_context_init.go | 9 +- {context => internal/context}/context.go | 2 +- {logger => internal/logger}/logger.go | 43 ++- .../sbi/consumer}/nf_discovery.go | 2 +- .../sbi/consumer}/nf_management.go | 4 +- .../sbi/producer}/eapAkaPrimeKeyGen_test.go | 9 +- .../sbi/producer}/functions.go | 6 +- .../sbi/producer}/ue_authentication.go | 59 ++-- .../sbi/sorprotection}/api_default.go | 0 .../sbi/sorprotection}/routers.go | 4 +- .../sbi/ueauthentication}/api_default.go | 12 +- .../sbi/ueauthentication}/routers.go | 4 +- .../sbi/upuprotection}/api_default.go | 0 .../sbi/upuprotection}/routers.go | 4 +- internal/util/path.go | 8 + pkg/factory/config.go | 161 +++++++++++ {factory => pkg/factory}/factory.go | 2 +- pkg/service/init.go | 267 ++++++++++++++++++ service/init.go | 264 ----------------- util/path.go | 14 - util/path_debug.go | 14 - 30 files changed, 762 insertions(+), 578 deletions(-) delete mode 100644 CHANGELOG.md rename LICENSE.txt => LICENSE (100%) delete mode 100644 ausf.go create mode 100644 cmd/main.go delete mode 100644 factory/config.go rename {context => internal/context}/ausf_context_init.go (92%) rename {context => internal/context}/context.go (98%) rename {logger => internal/logger}/logger.go (70%) rename {consumer => internal/sbi/consumer}/nf_discovery.go (95%) rename {consumer => internal/sbi/consumer}/nf_management.go (97%) rename {producer => internal/sbi/producer}/eapAkaPrimeKeyGen_test.go (96%) rename {producer => internal/sbi/producer}/functions.go (98%) rename {producer => internal/sbi/producer}/ue_authentication.go (90%) rename {sorprotection => internal/sbi/sorprotection}/api_default.go (100%) rename {sorprotection => internal/sbi/sorprotection}/routers.go (94%) rename {ueauthentication => internal/sbi/ueauthentication}/api_default.go (93%) rename {ueauthentication => internal/sbi/ueauthentication}/routers.go (95%) rename {upuprotection => internal/sbi/upuprotection}/api_default.go (100%) rename {upuprotection => internal/sbi/upuprotection}/routers.go (94%) create mode 100644 internal/util/path.go create mode 100644 pkg/factory/config.go rename {factory => pkg/factory}/factory.go (94%) create mode 100644 pkg/service/init.go delete mode 100644 service/init.go delete mode 100644 util/path.go delete mode 100644 util/path_debug.go diff --git a/.gitignore b/.gitignore index 6729600..c294e4d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,18 @@ +# Swap files +*.swp + # Toolchain -# Goland project folder +# Golang project folder .idea/ + # Visual Studio Code .vscode/ + +# Build +build/ +log/ +vendor/ + # emacs/vim GPATH GRTAGS @@ -10,10 +20,10 @@ GTAGS TAGS tags cscope.* -# mac + +# macOS .DS_Store -# debug +# Debug *.log *.pcap - diff --git a/.golangci.yml b/.golangci.yml index fbb3db5..3ae4931 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -29,12 +29,6 @@ run: # "/" will be replaced by current OS file path separator to properly work # on Windows. skip-files: - - "api_.*\\.go$" - - "model_.*\\.go$" - - "routers.go" - - "client.go" - - "configuration.go" - - "nas.go" # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": # If invoked with -mod=readonly, the go command is disallowed from the implicit # automatic updating of go.mod described above. Instead, it fails when any changes @@ -249,13 +243,14 @@ linters: # Additional - lll - godox - #- gomnd - #- goconst + # - gomnd + # - goconst # - gocognit # - maligned # - nestif # - gomodguard - nakedret + # - golint - gci - misspell - gofumpt @@ -266,9 +261,9 @@ linters: - dogsled - bodyclose - asciicheck - #- stylecheck - # - unparam - # - wsl + # - stylecheck + # - unparam + # - wsl #disable-all: false fast: true diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index f465a20..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ -# Change Log ---- -2020-03-xx-xx ---- -- Implemented enchacements: - -- Fixed bugs: - -- Closed issues: diff --git a/LICENSE.txt b/LICENSE similarity index 100% rename from LICENSE.txt rename to LICENSE diff --git a/ausf.go b/ausf.go deleted file mode 100644 index eb89dcc..0000000 --- a/ausf.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * AUSF Service - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package main - -import ( - "fmt" - "os" - - "github.com/sirupsen/logrus" - "github.com/urfave/cli" - - "github.com/free5gc/ausf/logger" - "github.com/free5gc/ausf/service" - "github.com/free5gc/version" -) - -var AUSF = &service.AUSF{} - -var appLog *logrus.Entry - -func init() { - appLog = logger.AppLog -} - -func main() { - app := cli.NewApp() - app.Name = "ausf" - fmt.Print(app.Name, "\n") - appLog.Infoln("AUSF version: ", version.GetVersion()) - app.Usage = "-free5gccfg common configuration file -ausfcfg ausf configuration file" - app.Action = action - app.Flags = AUSF.GetCliCmd() - if err := app.Run(os.Args); err != nil { - appLog.Errorf("AUSF Run error: %v", err) - } -} - -func action(c *cli.Context) error { - if err := AUSF.Initialize(c); err != nil { - logger.CfgLog.Errorf("%+v", err) - return fmt.Errorf("Failed to initialize !!") - } - - AUSF.Start() - - return nil -} diff --git a/cmd/main.go b/cmd/main.go new file mode 100644 index 0000000..74020c4 --- /dev/null +++ b/cmd/main.go @@ -0,0 +1,93 @@ +/* + * + * AUSF Service + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package main + +import ( + "fmt" + "os" + "path/filepath" + "runtime/debug" + + "github.com/asaskevich/govalidator" + "github.com/urfave/cli" + + "github.com/free5gc/ausf/internal/logger" + "github.com/free5gc/ausf/internal/util" + "github.com/free5gc/ausf/pkg/service" + "github.com/free5gc/util/version" +) + +var AUSF = &service.AUSF{} + +func main() { + defer func() { + if p := recover(); p != nil { + // Print stack for panic to log. Fatalf() will let program exit. + logger.AppLog.Fatalf("panic: %v\n%s", p, string(debug.Stack())) + } + }() + + app := cli.NewApp() + app.Name = "ausf" + app.Usage = "5G Authentication Server Function (AUSF)" + app.Action = action + app.Flags = AUSF.GetCliCmd() + if err := app.Run(os.Args); err != nil { + logger.AppLog.Errorf("AUSF Run error: %v\n", err) + } +} + +func action(c *cli.Context) error { + if err := initLogFile(c.String("log"), c.String("log5gc")); err != nil { + logger.AppLog.Errorf("%+v", err) + return err + } + + if err := AUSF.Initialize(c); err != nil { + switch errType := err.(type) { + case govalidator.Errors: + validErrs := err.(govalidator.Errors).Errors() + for _, validErr := range validErrs { + logger.CfgLog.Errorf("%+v", validErr) + } + default: + logger.CfgLog.Errorf("%+v", errType) + } + logger.CfgLog.Errorf("[-- PLEASE REFER TO SAMPLE CONFIG FILE COMMENTS --]") + return fmt.Errorf("Failed to initialize !!") + } + + logger.AppLog.Infoln(c.App.Name) + logger.AppLog.Infoln("AUSF version: ", version.GetVersion()) + + AUSF.Start() + + return nil +} + +func initLogFile(logNfPath, log5gcPath string) error { + AUSF.KeyLogPath = util.AusfDefaultKeyLogPath + + if err := logger.LogFileHook(logNfPath, log5gcPath); err != nil { + return err + } + + if logNfPath != "" { + nfDir, _ := filepath.Split(logNfPath) + tmpDir := filepath.Join(nfDir, "key") + if err := os.MkdirAll(tmpDir, 0775); err != nil { + logger.InitLog.Errorf("Make directory %s failed: %+v", tmpDir, err) + return err + } + _, name := filepath.Split(util.AusfDefaultKeyLogPath) + AUSF.KeyLogPath = filepath.Join(tmpDir, name) + } + + return nil +} diff --git a/factory/config.go b/factory/config.go deleted file mode 100644 index 1a121ca..0000000 --- a/factory/config.go +++ /dev/null @@ -1,59 +0,0 @@ -/* - * AUSF Configuration Factory - */ - -package factory - -import ( - "github.com/free5gc/logger_util" - "github.com/free5gc/openapi/models" -) - -const ( - AUSF_EXPECTED_CONFIG_VERSION = "1.0.0" -) - -type Config struct { - Info *Info `yaml:"info"` - Configuration *Configuration `yaml:"configuration"` - Logger *logger_util.Logger `yaml:"logger"` -} - -type Info struct { - Version string `yaml:"version,omitempty"` - Description string `yaml:"description,omitempty"` -} - -const ( - AUSF_DEFAULT_IPV4 = "127.0.0.9" - AUSF_DEFAULT_PORT = "8000" - AUSF_DEFAULT_PORT_INT = 8000 -) - -type Configuration struct { - Sbi *Sbi `yaml:"sbi,omitempty"` - ServiceNameList []string `yaml:"serviceNameList,omitempty"` - NrfUri string `yaml:"nrfUri,omitempty"` - PlmnSupportList []models.PlmnId `yaml:"plmnSupportList,omitempty"` - GroupId string `yaml:"groupId,omitempty"` - EapAkaSupiImsiPrefix bool `yaml:"eapAkaSupiImsiPrefix,omitempty"` -} - -type Sbi struct { - Scheme string `yaml:"scheme"` - RegisterIPv4 string `yaml:"registerIPv4,omitempty"` // IP that is registered at NRF. - BindingIPv4 string `yaml:"bindingIPv4,omitempty"` // IP used to run the server in the node. - Port int `yaml:"port,omitempty"` -} - -type Security struct { - IntegrityOrder []string `yaml:"integrityOrder,omitempty"` - CipheringOrder []string `yaml:"cipheringOrder,omitempty"` -} - -func (c *Config) GetVersion() string { - if c.Info != nil && c.Info.Version != "" { - return c.Info.Version - } - return "" -} diff --git a/go.mod b/go.mod index 823fd92..1a91a9b 100644 --- a/go.mod +++ b/go.mod @@ -4,22 +4,16 @@ go 1.14 require ( github.com/antihax/optional v1.0.0 - github.com/antonfisher/nested-logrus-formatter v1.3.0 + github.com/antonfisher/nested-logrus-formatter v1.3.1 + github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d github.com/bronze1man/radius v0.0.0-20190516032554-afd8baec892d - github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect - github.com/free5gc/UeauCommon v1.0.0 - github.com/free5gc/http2_util v1.0.0 - github.com/free5gc/http_wrapper v1.0.0 - github.com/free5gc/logger_conf v1.0.0 - github.com/free5gc/logger_util v1.0.0 - github.com/free5gc/openapi v1.0.0 - github.com/free5gc/path_util v1.0.0 - github.com/free5gc/version v1.0.0 - github.com/gin-gonic/gin v1.6.3 + github.com/free5gc/openapi v1.0.4 + github.com/free5gc/util v1.0.1 + github.com/gin-gonic/gin v1.7.3 github.com/google/gopacket v1.1.19 - github.com/google/uuid v1.1.2 - github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/sirupsen/logrus v1.7.0 + github.com/google/uuid v1.3.0 + github.com/sirupsen/logrus v1.8.1 + github.com/stretchr/testify v1.7.0 github.com/urfave/cli v1.22.5 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index ab997b2..e4ebd2c 100644 --- a/go.sum +++ b/go.sum @@ -35,8 +35,10 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 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/antonfisher/nested-logrus-formatter v1.3.0 h1:8zixYquU1Odk+vzAaAQPAdRh1ZjmUXNQ1T+dUBvlhVo= -github.com/antonfisher/nested-logrus-formatter v1.3.0/go.mod h1:6WTfyWFkBc9+zyBaKIqRrg/KwMqBbodBjgbHjDz7zjA= +github.com/antonfisher/nested-logrus-formatter v1.3.1 h1:NFJIr+pzwv5QLHTPyKz9UMEoHck02Q9L0FP13b/xSbQ= +github.com/antonfisher/nested-logrus-formatter v1.3.1/go.mod h1:6WTfyWFkBc9+zyBaKIqRrg/KwMqBbodBjgbHjDz7zjA= +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/bronze1man/radius v0.0.0-20190516032554-afd8baec892d h1:3Yh8YMWPvo93EMc2Buc+1rHw+G0m+b1cOMg8TypHth8= github.com/bronze1man/radius v0.0.0-20190516032554-afd8baec892d/go.mod h1:iZQ+zY4h2qv73M/PDpuqo6//w8M1n+uKS/nlMpRoS2o= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -45,38 +47,24 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/free5gc/UeauCommon v1.0.0 h1:ykhHNOcGpk6hLpVrGcMuKBbc+PgSmrwxCELnyFH9xKs= -github.com/free5gc/UeauCommon v1.0.0/go.mod h1:Ly9JlJN4c1uCALizCmEha1Nu78ibQjbpQvSrt04nGfw= -github.com/free5gc/http2_util v1.0.0 h1:0laMypHUNizAE5zsLoeJQq0R4XrfbvsLCW4NHCPpc44= -github.com/free5gc/http2_util v1.0.0/go.mod h1:GN2BCD8IINjtnAKYGwe+dEeTBRFEv4lQnZblFIIhbdE= -github.com/free5gc/http_wrapper v1.0.0 h1:NdnDHkItXxUzoxggiQsnR9SObBdi6KmwcN+QUJs4CoQ= -github.com/free5gc/http_wrapper v1.0.0/go.mod h1:vVArDqfCo7fvmYGi9WRPj4yurSu86GxRh3iQ70aq+OE= -github.com/free5gc/logger_conf v1.0.0 h1:cMqqB8L4HjE57tP36mBmiVUPIcHv8Ayr12jKfeiwqZU= -github.com/free5gc/logger_conf v1.0.0/go.mod h1:DHecLXVV1qA5Z+lSoUvZdZ6tCtZidTNmtx99jsCfgLE= -github.com/free5gc/logger_util v1.0.0 h1:hLTCTnKlEqJURrBwooNFQLavWPdJzS0o9KGIYUNKdJI= -github.com/free5gc/logger_util v1.0.0/go.mod h1:TK/bAJbm/l2TMNmbsKn83+xUmDNqts69IEir/nCa8w0= -github.com/free5gc/openapi v1.0.0 h1:DaGVt05b1pSDBOailKAlLj6hAk6vunN0Nhzvl/xcWCY= -github.com/free5gc/openapi v1.0.0/go.mod h1:7OzxoWBj6KQgznMW2ZiUtZdCGY+t89v4wtgKLhluKgU= -github.com/free5gc/path_util v1.0.0 h1:vJPGTymaWtavz6fJ/7k6WKEYv5BQLAq/O04RP54sab0= -github.com/free5gc/path_util v1.0.0/go.mod h1:OpmcebEKrMPnH7Jg5lZ8y9ZWJNAjQ4l9FGWXUv58Mo0= -github.com/free5gc/version v1.0.0 h1:Kn4uOhyHT1IAgerBgWRHag4xLMDXrRsqubLeMv5Nb/w= -github.com/free5gc/version v1.0.0/go.mod h1:wOTwzjk7sqeysX1b/Z4x+pWBHFuZOPtQj3h+IJXSpmQ= +github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= +github.com/free5gc/openapi v1.0.4 h1:bC6oqXy8Z+3e532xLMFmrTHvdyv4sNGDPezQSslw5gQ= +github.com/free5gc/openapi v1.0.4/go.mod h1:KRCnnp0GeK0Bl4gnrX79cQAidKXNENf8VRdG0y9R0Fc= +github.com/free5gc/util v1.0.1 h1:A8bynjzZXkYMLOq9FN5J4Yg5mdjXhYoXc/FFFwSLPss= +github.com/free5gc/util v1.0.1/go.mod h1:VsA8FaZAxZW6eKzF/VXN2kuctl19Tj+NYH7ZxkZ+YCA= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= -github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.7.3 h1:aMBzLJ/GMEYmv1UWs2FFTcPISLrQH2mRgL9Glz8xows= +github.com/gin-gonic/gin v1.7.3/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= 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= @@ -86,10 +74,35 @@ github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8c github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -104,7 +117,6 @@ github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= @@ -114,9 +126,9 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -125,8 +137,9 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= @@ -140,22 +153,30 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= 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= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -163,64 +184,80 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mitchellh/mapstructure v1.4.0 h1:7ks8ZkOP5/ujthUsT07rNv+nkLXCQWKNHuwzOAesEks= -github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= -github.com/russross/blackfriday/v2 v2.1.0/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.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 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 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go v1.2.1 h1:dz+JxTe7GZQdErTo7SREc1jQj/hFP1k7jyIAwODoW+k= -github.com/ugorji/go v1.2.1/go.mod h1:cSVypSfTLm2o9fKxXvQgn3rMmkPXovcWor6Qn5tbFmI= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.1 h1:/TRfW3XKkvWvmAYyCUaQlhoCDGjcvNR8xVVA/l5p/jQ= -github.com/ugorji/go/codec v1.2.1/go.mod h1:s/WxCRi46t8rA+fowL40EnmD7ec0XhR7ZypxeBNdzsM= github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.mongodb.org/mongo-driver v1.7.1/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= 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= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 h1:sYNJzB4J8toYPQTM6pAkcmBRgw9SnQKP9oXCHfgy604= -golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -263,7 +300,6 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191021144547-ec77196f6094/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -278,29 +314,35 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11 h1:lwlPPsmjDKK0J6eG6xDWd5XPehI0R024zxjDnw3esPA= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 h1:Lm4OryKCca1vehdsWogr9N4t7NfZxLbJoc/H0w4K4S4= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5 h1:Ati8dO7+U7mxpkPSxBZQEvzHVUYB/MqCklCN8ig5w/o= +golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -309,7 +351,6 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -324,17 +365,17 @@ 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-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f h1:QdHQnPce6K4XQewki9WNbG5KOROuDzqO3NaYjI1cXJ0= -golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -344,9 +385,14 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -404,9 +450,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -459,14 +504,12 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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/gentleman.v1 v1.0.4/go.mod h1:JYuHVdFzS4MKOXe0o+chKJ4hCe6tqKKw9XH9YP6WFrg= -gopkg.in/h2non/gock.v1 v1.0.16 h1:F11k+OafeuFENsjei5t2vMTSTs9L62AdyTe4E1cgdG8= -gopkg.in/h2non/gock.v1 v1.0.16/go.mod h1:XVuDAssexPLwgxCLMvDTWNU5eqklsydR6I5phZ9oPB8= +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.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= diff --git a/context/ausf_context_init.go b/internal/context/ausf_context_init.go similarity index 92% rename from context/ausf_context_init.go rename to internal/context/ausf_context_init.go index 0239fb0..b4fc791 100644 --- a/context/ausf_context_init.go +++ b/internal/context/ausf_context_init.go @@ -7,16 +7,15 @@ import ( "github.com/google/uuid" - "github.com/free5gc/ausf/factory" - "github.com/free5gc/ausf/logger" + "github.com/free5gc/ausf/internal/logger" + "github.com/free5gc/ausf/internal/util" + "github.com/free5gc/ausf/pkg/factory" "github.com/free5gc/openapi/models" - "github.com/free5gc/path_util" ) func TestInit() { // load config - DefaultAusfConfigPath := path_util.Free5gcPath("free5gc/config/ausfcfg.yaml") - if err := factory.InitConfigFactory(DefaultAusfConfigPath); err != nil { + if err := factory.InitConfigFactory(util.AusfDefaultConfigPath); err != nil { panic(err) } Init() diff --git a/context/context.go b/internal/context/context.go similarity index 98% rename from context/context.go rename to internal/context/context.go index 2cc6897..dc90642 100644 --- a/context/context.go +++ b/internal/context/context.go @@ -4,7 +4,7 @@ import ( "regexp" "sync" - "github.com/free5gc/ausf/logger" + "github.com/free5gc/ausf/internal/logger" "github.com/free5gc/openapi/models" ) diff --git a/logger/logger.go b/internal/logger/logger.go similarity index 70% rename from logger/logger.go rename to internal/logger/logger.go index 4eff145..a0a6b44 100644 --- a/logger/logger.go +++ b/internal/logger/logger.go @@ -7,8 +7,7 @@ import ( formatter "github.com/antonfisher/nested-logrus-formatter" "github.com/sirupsen/logrus" - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" + logger_util "github.com/free5gc/util/logger" ) var ( @@ -37,16 +36,6 @@ func init() { FieldsOrder: []string{"component", "category"}, } - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0o666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.NfLogDir+"ausf.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0o666) - if err == nil { - log.Hooks.Add(selfLogHook) - } - AppLog = log.WithFields(logrus.Fields{"component": "AUSF", "category": "App"}) InitLog = log.WithFields(logrus.Fields{"component": "AUSF", "category": "Init"}) CfgLog = log.WithFields(logrus.Fields{"component": "AUSF", "category": "CFG"}) @@ -59,10 +48,36 @@ func init() { GinLog = log.WithFields(logrus.Fields{"component": "AUSF", "category": "GIN"}) } +func LogFileHook(logNfPath string, log5gcPath string) error { + if fullPath, err := logger_util.CreateFree5gcLogFile(log5gcPath); err == nil { + if fullPath != "" { + free5gcLogHook, hookErr := logger_util.NewFileHook(fullPath, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0o666) + if hookErr != nil { + return hookErr + } + log.Hooks.Add(free5gcLogHook) + } + } else { + return err + } + + if fullPath, err := logger_util.CreateNfLogFile(logNfPath, "ausf.log"); err == nil { + selfLogHook, hookErr := logger_util.NewFileHook(fullPath, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0o666) + if hookErr != nil { + return hookErr + } + log.Hooks.Add(selfLogHook) + } else { + return err + } + + return nil +} + func SetLogLevel(level logrus.Level) { log.SetLevel(level) } -func SetReportCaller(set bool) { - log.SetReportCaller(set) +func SetReportCaller(enable bool) { + log.SetReportCaller(enable) } diff --git a/consumer/nf_discovery.go b/internal/sbi/consumer/nf_discovery.go similarity index 95% rename from consumer/nf_discovery.go rename to internal/sbi/consumer/nf_discovery.go index 6178cc4..50691f7 100644 --- a/consumer/nf_discovery.go +++ b/internal/sbi/consumer/nf_discovery.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "github.com/free5gc/ausf/logger" + "github.com/free5gc/ausf/internal/logger" "github.com/free5gc/openapi/Nnrf_NFDiscovery" "github.com/free5gc/openapi/models" ) diff --git a/consumer/nf_management.go b/internal/sbi/consumer/nf_management.go similarity index 97% rename from consumer/nf_management.go rename to internal/sbi/consumer/nf_management.go index c71355f..d401499 100644 --- a/consumer/nf_management.go +++ b/internal/sbi/consumer/nf_management.go @@ -7,8 +7,8 @@ import ( "strings" "time" - ausf_context "github.com/free5gc/ausf/context" - "github.com/free5gc/ausf/logger" + ausf_context "github.com/free5gc/ausf/internal/context" + "github.com/free5gc/ausf/internal/logger" "github.com/free5gc/openapi" "github.com/free5gc/openapi/Nnrf_NFManagement" "github.com/free5gc/openapi/models" diff --git a/producer/eapAkaPrimeKeyGen_test.go b/internal/sbi/producer/eapAkaPrimeKeyGen_test.go similarity index 96% rename from producer/eapAkaPrimeKeyGen_test.go rename to internal/sbi/producer/eapAkaPrimeKeyGen_test.go index cdc2cb9..7434308 100644 --- a/producer/eapAkaPrimeKeyGen_test.go +++ b/internal/sbi/producer/eapAkaPrimeKeyGen_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/free5gc/UeauCommon" + "github.com/free5gc/util/ueauth" ) type testEapAkaPrimeCase struct { @@ -46,12 +46,15 @@ func EapAkaPrimeKeyGenAll(data testEapAkaPrimeCase) ([]byte, []byte, []byte, []b } SQNxorAK := AUTN[:6] key := append(CK, IK...) - FC := UeauCommon.FC_FOR_CK_PRIME_IK_PRIME_DERIVATION + FC := ueauth.FC_FOR_CK_PRIME_IK_PRIME_DERIVATION P0 := []byte(data.NetworkName) P1 := SQNxorAK // Generate CK' IK' - kdfVal := UeauCommon.GetKDFValue(key, FC, P0, UeauCommon.KDFLen(P0), P1, UeauCommon.KDFLen(P1)) + kdfVal, err := ueauth.GetKDFValue(key, FC, P0, ueauth.KDFLen(P0), P1, ueauth.KDFLen(P1)) + if err != nil { + fmt.Println(err) + } CKPrime := kdfVal[:len(kdfVal)/2] IKPrime := kdfVal[len(kdfVal)/2:] CKPrimeHex := hex.EncodeToString(CKPrime) diff --git a/producer/functions.go b/internal/sbi/producer/functions.go similarity index 98% rename from producer/functions.go rename to internal/sbi/producer/functions.go index ceee5cf..edd27c9 100644 --- a/producer/functions.go +++ b/internal/sbi/producer/functions.go @@ -15,9 +15,9 @@ import ( "github.com/antihax/optional" "github.com/bronze1man/radius" - "github.com/free5gc/ausf/consumer" - ausf_context "github.com/free5gc/ausf/context" - "github.com/free5gc/ausf/logger" + ausf_context "github.com/free5gc/ausf/internal/context" + "github.com/free5gc/ausf/internal/logger" + "github.com/free5gc/ausf/internal/sbi/consumer" "github.com/free5gc/openapi/Nnrf_NFDiscovery" Nudm_UEAU "github.com/free5gc/openapi/Nudm_UEAuthentication" "github.com/free5gc/openapi/models" diff --git a/producer/ue_authentication.go b/internal/sbi/producer/ue_authentication.go similarity index 90% rename from producer/ue_authentication.go rename to internal/sbi/producer/ue_authentication.go index 673f852..34c35e8 100644 --- a/producer/ue_authentication.go +++ b/internal/sbi/producer/ue_authentication.go @@ -15,14 +15,14 @@ import ( "github.com/google/gopacket" "github.com/google/gopacket/layers" - "github.com/free5gc/UeauCommon" - ausf_context "github.com/free5gc/ausf/context" - "github.com/free5gc/ausf/logger" - "github.com/free5gc/http_wrapper" + ausf_context "github.com/free5gc/ausf/internal/context" + "github.com/free5gc/ausf/internal/logger" "github.com/free5gc/openapi/models" + "github.com/free5gc/util/httpwrapper" + "github.com/free5gc/util/ueauth" ) -func HandleEapAuthComfirmRequest(request *http_wrapper.Request) *http_wrapper.Response { +func HandleEapAuthComfirmRequest(request *httpwrapper.Request) *httpwrapper.Response { logger.Auth5gAkaComfirmLog.Infof("EapAuthComfirmRequest") updateEapSession := request.Body.(models.EapSession) @@ -31,36 +31,36 @@ func HandleEapAuthComfirmRequest(request *http_wrapper.Request) *http_wrapper.Re response, problemDetails := EapAuthComfirmRequestProcedure(updateEapSession, eapSessionID) if response != nil { - return http_wrapper.NewResponse(http.StatusOK, nil, response) + return httpwrapper.NewResponse(http.StatusOK, nil, response) } else if problemDetails != nil { - return http_wrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) + return httpwrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) } problemDetails = &models.ProblemDetails{ Status: http.StatusForbidden, Cause: "UNSPECIFIED", } - return http_wrapper.NewResponse(http.StatusForbidden, nil, problemDetails) + return httpwrapper.NewResponse(http.StatusForbidden, nil, problemDetails) } -func HandleAuth5gAkaComfirmRequest(request *http_wrapper.Request) *http_wrapper.Response { +func HandleAuth5gAkaComfirmRequest(request *httpwrapper.Request) *httpwrapper.Response { logger.Auth5gAkaComfirmLog.Infof("Auth5gAkaComfirmRequest") updateConfirmationData := request.Body.(models.ConfirmationData) ConfirmationDataResponseID := request.Params["authCtxId"] response, problemDetails := Auth5gAkaComfirmRequestProcedure(updateConfirmationData, ConfirmationDataResponseID) if response != nil { - return http_wrapper.NewResponse(http.StatusOK, nil, response) + return httpwrapper.NewResponse(http.StatusOK, nil, response) } else if problemDetails != nil { - return http_wrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) + return httpwrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) } problemDetails = &models.ProblemDetails{ Status: http.StatusForbidden, Cause: "UNSPECIFIED", } - return http_wrapper.NewResponse(http.StatusForbidden, nil, problemDetails) + return httpwrapper.NewResponse(http.StatusForbidden, nil, problemDetails) } -func HandleUeAuthPostRequest(request *http_wrapper.Request) *http_wrapper.Response { +func HandleUeAuthPostRequest(request *httpwrapper.Request) *httpwrapper.Response { logger.UeAuthPostLog.Infof("HandleUeAuthPostRequest") updateAuthenticationInfo := request.Body.(models.AuthenticationInfo) @@ -69,15 +69,15 @@ func HandleUeAuthPostRequest(request *http_wrapper.Request) *http_wrapper.Respon respHeader.Set("Location", locationURI) if response != nil { - return http_wrapper.NewResponse(http.StatusCreated, respHeader, response) + return httpwrapper.NewResponse(http.StatusCreated, respHeader, response) } else if problemDetails != nil { - return http_wrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) + return httpwrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) } problemDetails = &models.ProblemDetails{ Status: http.StatusForbidden, Cause: "UNSPECIFIED", } - return http_wrapper.NewResponse(http.StatusForbidden, nil, problemDetails) + return httpwrapper.NewResponse(http.StatusForbidden, nil, problemDetails) } // func UeAuthPostRequestProcedure(updateAuthenticationInfo models.AuthenticationInfo) ( @@ -160,7 +160,8 @@ func UeAuthPostRequestProcedure(updateAuthenticationInfo models.AuthenticationIn concat := authInfoResult.AuthenticationVector.Rand + authInfoResult.AuthenticationVector.XresStar var hxresStarBytes []byte if bytes, err := hex.DecodeString(concat); err != nil { - logger.Auth5gAkaComfirmLog.Warnf("decode error: %+v", err) + logger.Auth5gAkaComfirmLog.Errorf("decode concat error: %+v", err) + // TODO: return ProblemDetails } else { hxresStarBytes = bytes } @@ -172,12 +173,17 @@ func UeAuthPostRequestProcedure(updateAuthenticationInfo models.AuthenticationIn Kausf := authInfoResult.AuthenticationVector.Kausf var KausfDecode []byte if ausfDecode, err := hex.DecodeString(Kausf); err != nil { - logger.Auth5gAkaComfirmLog.Warnf("AUSF decode failed: %+v", err) + logger.Auth5gAkaComfirmLog.Errorf("decode Kausf failed: %+v", err) + // TODO: return ProblemDetails } else { KausfDecode = ausfDecode } P0 := []byte(snName) - Kseaf := UeauCommon.GetKDFValue(KausfDecode, UeauCommon.FC_FOR_KSEAF_DERIVATION, P0, UeauCommon.KDFLen(P0)) + Kseaf, err := ueauth.GetKDFValue(KausfDecode, ueauth.FC_FOR_KSEAF_DERIVATION, P0, ueauth.KDFLen(P0)) + if err != nil { + logger.Auth5gAkaComfirmLog.Errorf("GetKDFValue failed: %+v", err) + // TODO: return ProblemDetails + } ausfUeContext.XresStar = authInfoResult.AuthenticationVector.XresStar ausfUeContext.Kausf = Kausf ausfUeContext.Kseaf = hex.EncodeToString(Kseaf) @@ -222,7 +228,10 @@ func UeAuthPostRequestProcedure(updateAuthenticationInfo models.AuthenticationIn Kausf := EMSK[0:32] ausfUeContext.Kausf = hex.EncodeToString(Kausf) P0 := []byte(snName) - Kseaf := UeauCommon.GetKDFValue(Kausf, UeauCommon.FC_FOR_KSEAF_DERIVATION, P0, UeauCommon.KDFLen(P0)) + Kseaf, err := ueauth.GetKDFValue(Kausf, ueauth.FC_FOR_KSEAF_DERIVATION, P0, ueauth.KDFLen(P0)) + if err != nil { + logger.EapAuthComfirmLog.Errorf("GetKDFValue failed: %+v", err) + } ausfUeContext.Kseaf = hex.EncodeToString(Kseaf) var eapPkt radius.EapPacket @@ -242,27 +251,27 @@ func UeAuthPostRequestProcedure(updateAuthenticationInfo models.AuthenticationIn eapAKAHdrBytes[0] = ausf_context.AKA_CHALLENGE_SUBTYPE eapAKAHdr = string(eapAKAHdrBytes) if atRandTmp, err := EapEncodeAttribute("AT_RAND", RAND); err != nil { - logger.EapAuthComfirmLog.Warnf("EAP encode RAND failed: %+v", err) + logger.EapAuthComfirmLog.Errorf("EAP encode RAND failed: %+v", err) } else { atRand = atRandTmp } if atAutnTmp, err := EapEncodeAttribute("AT_AUTN", AUTN); err != nil { - logger.EapAuthComfirmLog.Warnf("EAP encode AUTN failed: %+v", err) + logger.EapAuthComfirmLog.Errorf("EAP encode AUTN failed: %+v", err) } else { atAutn = atAutnTmp } if atKdfTmp, err := EapEncodeAttribute("AT_KDF", snName); err != nil { - logger.EapAuthComfirmLog.Warnf("EAP encode KDF failed: %+v", err) + logger.EapAuthComfirmLog.Errorf("EAP encode KDF failed: %+v", err) } else { atKdf = atKdfTmp } if atKdfInputTmp, err := EapEncodeAttribute("AT_KDF_INPUT", snName); err != nil { - logger.EapAuthComfirmLog.Warnf("EAP encode KDF failed: %+v", err) + logger.EapAuthComfirmLog.Errorf("EAP encode KDF failed: %+v", err) } else { atKdfInput = atKdfInputTmp } if atMACTmp, err := EapEncodeAttribute("AT_MAC", ""); err != nil { - logger.EapAuthComfirmLog.Warnf("EAP encode MAC failed: %+v", err) + logger.EapAuthComfirmLog.Errorf("EAP encode MAC failed: %+v", err) } else { atMAC = atMACTmp } diff --git a/sorprotection/api_default.go b/internal/sbi/sorprotection/api_default.go similarity index 100% rename from sorprotection/api_default.go rename to internal/sbi/sorprotection/api_default.go diff --git a/sorprotection/routers.go b/internal/sbi/sorprotection/routers.go similarity index 94% rename from sorprotection/routers.go rename to internal/sbi/sorprotection/routers.go index 9fec180..b655f6e 100644 --- a/sorprotection/routers.go +++ b/internal/sbi/sorprotection/routers.go @@ -15,8 +15,8 @@ import ( "github.com/gin-gonic/gin" - "github.com/free5gc/ausf/logger" - "github.com/free5gc/logger_util" + "github.com/free5gc/ausf/internal/logger" + logger_util "github.com/free5gc/util/logger" ) // Route is the information for every URI. diff --git a/ueauthentication/api_default.go b/internal/sbi/ueauthentication/api_default.go similarity index 93% rename from ueauthentication/api_default.go rename to internal/sbi/ueauthentication/api_default.go index 3630a42..81fe7da 100644 --- a/ueauthentication/api_default.go +++ b/internal/sbi/ueauthentication/api_default.go @@ -14,11 +14,11 @@ import ( "github.com/gin-gonic/gin" - "github.com/free5gc/ausf/logger" - "github.com/free5gc/ausf/producer" - "github.com/free5gc/http_wrapper" + "github.com/free5gc/ausf/internal/logger" + "github.com/free5gc/ausf/internal/sbi/producer" "github.com/free5gc/openapi" "github.com/free5gc/openapi/models" + "github.com/free5gc/util/httpwrapper" ) // HTTPEapAuthMethod - @@ -51,7 +51,7 @@ func HTTPEapAuthMethod(ctx *gin.Context) { return } - req := http_wrapper.NewRequest(ctx.Request, eapSessionReq) + req := httpwrapper.NewRequest(ctx.Request, eapSessionReq) req.Params["authCtxId"] = ctx.Param("authCtxId") rsp := producer.HandleEapAuthComfirmRequest(req) @@ -100,7 +100,7 @@ func HTTPUeAuthenticationsAuthCtxID5gAkaConfirmationPut(ctx *gin.Context) { return } - req := http_wrapper.NewRequest(ctx.Request, confirmationData) + req := httpwrapper.NewRequest(ctx.Request, confirmationData) req.Params["authCtxId"] = ctx.Param("authCtxId") rsp := producer.HandleAuth5gAkaComfirmRequest(req) @@ -149,7 +149,7 @@ func HTTPUeAuthenticationsPost(ctx *gin.Context) { return } - req := http_wrapper.NewRequest(ctx.Request, authInfo) + req := httpwrapper.NewRequest(ctx.Request, authInfo) rsp := producer.HandleUeAuthPostRequest(req) diff --git a/ueauthentication/routers.go b/internal/sbi/ueauthentication/routers.go similarity index 95% rename from ueauthentication/routers.go rename to internal/sbi/ueauthentication/routers.go index e2fd3d1..366bbb0 100644 --- a/ueauthentication/routers.go +++ b/internal/sbi/ueauthentication/routers.go @@ -15,8 +15,8 @@ import ( "github.com/gin-gonic/gin" - "github.com/free5gc/ausf/logger" - "github.com/free5gc/logger_util" + "github.com/free5gc/ausf/internal/logger" + logger_util "github.com/free5gc/util/logger" ) // Route is the information for every URI. diff --git a/upuprotection/api_default.go b/internal/sbi/upuprotection/api_default.go similarity index 100% rename from upuprotection/api_default.go rename to internal/sbi/upuprotection/api_default.go diff --git a/upuprotection/routers.go b/internal/sbi/upuprotection/routers.go similarity index 94% rename from upuprotection/routers.go rename to internal/sbi/upuprotection/routers.go index cf95181..c79b2d6 100644 --- a/upuprotection/routers.go +++ b/internal/sbi/upuprotection/routers.go @@ -15,8 +15,8 @@ import ( "github.com/gin-gonic/gin" - "github.com/free5gc/ausf/logger" - "github.com/free5gc/logger_util" + "github.com/free5gc/ausf/internal/logger" + logger_util "github.com/free5gc/util/logger" ) // Route is the information for every URI. diff --git a/internal/util/path.go b/internal/util/path.go new file mode 100644 index 0000000..dab7d2d --- /dev/null +++ b/internal/util/path.go @@ -0,0 +1,8 @@ +package util + +const ( + AusfDefaultKeyLogPath = "./log/ausfsslkey.log" + AusfDefaultPemPath = "./config/TLS/ausf.pem" + AusfDefaultKeyPath = "./config/TLS/ausf.key" + AusfDefaultConfigPath = "./config/ausfcfg.yaml" +) diff --git a/pkg/factory/config.go b/pkg/factory/config.go new file mode 100644 index 0000000..01800df --- /dev/null +++ b/pkg/factory/config.go @@ -0,0 +1,161 @@ +/* + * AUSF Configuration Factory + */ + +package factory + +import ( + "errors" + "fmt" + "strconv" + + "github.com/asaskevich/govalidator" + + "github.com/free5gc/openapi/models" + logger_util "github.com/free5gc/util/logger" +) + +const ( + AUSF_EXPECTED_CONFIG_VERSION = "1.0.2" + AUSF_DEFAULT_IPV4 = "127.0.0.9" + AUSF_DEFAULT_PORT = "8000" + AUSF_DEFAULT_PORT_INT = 8000 +) + +type Config struct { + Info *Info `yaml:"info" valid:"required"` + Configuration *Configuration `yaml:"configuration" valid:"required"` + Logger *logger_util.Logger `yaml:"logger" valid:"optional"` +} + +func (c *Config) Validate() (bool, error) { + if info := c.Info; info != nil { + if result, err := info.validate(); err != nil { + return result, err + } + } + + if configuration := c.Configuration; configuration != nil { + if result, err := configuration.validate(); err != nil { + return result, err + } + } + + if logger := c.Logger; logger != nil { + if result, err := logger.Validate(); err != nil { + return result, err + } + } + + result, err := govalidator.ValidateStruct(c) + return result, appendInvalid(err) +} + +type Info struct { + Version string `yaml:"version,omitempty" valid:"type(string)"` + Description string `yaml:"description,omitempty" valid:"type(string)"` +} + +func (i *Info) validate() (bool, error) { + result, err := govalidator.ValidateStruct(i) + return result, appendInvalid(err) +} + +type Configuration struct { + Sbi *Sbi `yaml:"sbi,omitempty" valid:"required"` + ServiceNameList []string `yaml:"serviceNameList,omitempty" valid:"required"` + NrfUri string `yaml:"nrfUri,omitempty" valid:"url,required"` + PlmnSupportList []models.PlmnId `yaml:"plmnSupportList,omitempty" valid:"required"` + GroupId string `yaml:"groupId,omitempty" valid:"type(string),minstringlength(1)"` + EapAkaSupiImsiPrefix bool `yaml:"eapAkaSupiImsiPrefix,omitempty" valid:"type(bool),optional"` +} + +func (c *Configuration) validate() (bool, error) { + if sbi := c.Sbi; sbi != nil { + if result, err := sbi.validate(); err != nil { + return result, err + } + } + + for index, serviceName := range c.ServiceNameList { + switch { + case serviceName == "nausf-auth": + default: + err := errors.New("Invalid serviceNameList[" + strconv.Itoa(index) + "]: " + + serviceName + ", should be nausf-auth.") + return false, err + } + } + + for index, plmnId := range c.PlmnSupportList { + if result := govalidator.StringMatches(plmnId.Mcc, "^[0-9]{3}$"); !result { + err := errors.New("Invalid plmnSupportList[" + strconv.Itoa(index) + "].Mcc: " + + plmnId.Mcc + ", should be 3 digits interger.") + return false, err + } + + if result := govalidator.StringMatches(plmnId.Mnc, "^[0-9]{2,3}$"); !result { + err := errors.New("Invalid plmnSupportList[" + strconv.Itoa(index) + "].Mnc: " + + plmnId.Mnc + ", should be 2 or 3 digits interger.") + return false, err + } + } + + result, err := govalidator.ValidateStruct(c) + return result, appendInvalid(err) +} + +type Sbi struct { + Scheme string `yaml:"scheme" valid:"scheme"` + RegisterIPv4 string `yaml:"registerIPv4,omitempty" valid:"host,required"` // IP that is registered at NRF. + BindingIPv4 string `yaml:"bindingIPv4,omitempty" valid:"host,required"` // IP used to run the server in the node. + Port int `yaml:"port,omitempty" valid:"port,required"` + Tls *Tls `yaml:"tls,omitempty" valid:"optional"` +} + +func (s *Sbi) validate() (bool, error) { + govalidator.TagMap["scheme"] = govalidator.Validator(func(str string) bool { + return str == "https" || str == "http" + }) + + if tls := s.Tls; tls != nil { + if result, err := tls.validate(); err != nil { + return result, err + } + } + + result, err := govalidator.ValidateStruct(s) + return result, appendInvalid(err) +} + +type Tls struct { + Pem string `yaml:"pem,omitempty" valid:"type(string),minstringlength(1),required"` + Key string `yaml:"key,omitempty" valid:"type(string),minstringlength(1),required"` +} + +func (t *Tls) validate() (bool, error) { + result, err := govalidator.ValidateStruct(t) + return result, err +} + +func appendInvalid(err error) error { + var errs govalidator.Errors + + if err == nil { + return nil + } + + es := err.(govalidator.Errors).Errors() + for _, e := range es { + errs = append(errs, fmt.Errorf("Invalid %w", e)) + } + + return error(errs) +} + +func (c *Config) GetVersion() string { + if c.Info != nil && c.Info.Version != "" { + return c.Info.Version + } + return "" +} diff --git a/factory/factory.go b/pkg/factory/factory.go similarity index 94% rename from factory/factory.go rename to pkg/factory/factory.go index 94bac38..346009e 100644 --- a/factory/factory.go +++ b/pkg/factory/factory.go @@ -10,7 +10,7 @@ import ( "gopkg.in/yaml.v2" - "github.com/free5gc/ausf/logger" + "github.com/free5gc/ausf/internal/logger" ) var AusfConfig Config diff --git a/pkg/service/init.go b/pkg/service/init.go new file mode 100644 index 0000000..59bd174 --- /dev/null +++ b/pkg/service/init.go @@ -0,0 +1,267 @@ +package service + +import ( + "bufio" + "fmt" + "os" + "os/exec" + "os/signal" + "runtime/debug" + "sync" + "syscall" + + "github.com/sirupsen/logrus" + "github.com/urfave/cli" + + ausf_context "github.com/free5gc/ausf/internal/context" + "github.com/free5gc/ausf/internal/logger" + "github.com/free5gc/ausf/internal/sbi/consumer" + "github.com/free5gc/ausf/internal/sbi/ueauthentication" + "github.com/free5gc/ausf/internal/util" + "github.com/free5gc/ausf/pkg/factory" + "github.com/free5gc/util/httpwrapper" + logger_util "github.com/free5gc/util/logger" +) + +type AUSF struct { + KeyLogPath string +} + +type ( + // Commands information. + Commands struct { + config string + } +) + +var commands Commands + +var cliCmd = []cli.Flag{ + cli.StringFlag{ + Name: "config, c", + Usage: "Load configuration from `FILE`", + }, + cli.StringFlag{ + Name: "log, l", + Usage: "Output NF log to `FILE`", + }, + cli.StringFlag{ + Name: "log5gc, lc", + Usage: "Output free5gc log to `FILE`", + }, +} + +func (*AUSF) GetCliCmd() (flags []cli.Flag) { + return cliCmd +} + +func (ausf *AUSF) Initialize(c *cli.Context) error { + commands = Commands{ + config: c.String("config"), + } + + if commands.config != "" { + if err := factory.InitConfigFactory(commands.config); err != nil { + return err + } + } else { + if err := factory.InitConfigFactory(util.AusfDefaultConfigPath); err != nil { + return err + } + } + + if err := factory.CheckConfigVersion(); err != nil { + return err + } + + if _, err := factory.AusfConfig.Validate(); err != nil { + return err + } + + ausf.setLogLevel() + + return nil +} + +func (ausf *AUSF) setLogLevel() { + if factory.AusfConfig.Logger == nil { + logger.InitLog.Warnln("AUSF config without log level setting!!!") + return + } + + if factory.AusfConfig.Logger.AUSF != nil { + if factory.AusfConfig.Logger.AUSF.DebugLevel != "" { + if level, err := logrus.ParseLevel(factory.AusfConfig.Logger.AUSF.DebugLevel); err != nil { + logger.InitLog.Warnf("AUSF Log level [%s] is invalid, set to [info] level", + factory.AusfConfig.Logger.AUSF.DebugLevel) + logger.SetLogLevel(logrus.InfoLevel) + } else { + logger.InitLog.Infof("AUSF Log level is set to [%s] level", level) + logger.SetLogLevel(level) + } + } else { + logger.InitLog.Warnln("AUSF Log level not set. Default set to [info] level") + logger.SetLogLevel(logrus.InfoLevel) + } + logger.SetReportCaller(factory.AusfConfig.Logger.AUSF.ReportCaller) + } +} + +func (ausf *AUSF) FilterCli(c *cli.Context) (args []string) { + for _, flag := range ausf.GetCliCmd() { + name := flag.GetName() + value := fmt.Sprint(c.Generic(name)) + if value == "" { + continue + } + + args = append(args, "--"+name, value) + } + return args +} + +func (ausf *AUSF) Start() { + logger.InitLog.Infoln("Server started") + + router := logger_util.NewGinWithLogrus(logger.GinLog) + ueauthentication.AddService(router) + + pemPath := util.AusfDefaultPemPath + keyPath := util.AusfDefaultKeyPath + sbi := factory.AusfConfig.Configuration.Sbi + if sbi.Tls != nil { + pemPath = sbi.Tls.Pem + keyPath = sbi.Tls.Key + } + + ausf_context.Init() + self := ausf_context.GetSelf() + // Register to NRF + profile, err := consumer.BuildNFInstance(self) + if err != nil { + logger.InitLog.Error("Build AUSF Profile Error") + } + _, self.NfId, err = consumer.SendRegisterNFInstance(self.NrfUri, self.NfId, profile) + if err != nil { + logger.InitLog.Errorf("AUSF register to NRF Error[%s]", err.Error()) + } + + addr := fmt.Sprintf("%s:%d", self.BindingIPv4, self.SBIPort) + + signalChannel := make(chan os.Signal, 1) + signal.Notify(signalChannel, os.Interrupt, syscall.SIGTERM) + go func() { + defer func() { + if p := recover(); p != nil { + // Print stack for panic to log. Fatalf() will let program exit. + logger.InitLog.Fatalf("panic: %v\n%s", p, string(debug.Stack())) + } + }() + + <-signalChannel + ausf.Terminate() + os.Exit(0) + }() + + server, err := httpwrapper.NewHttp2Server(addr, ausf.KeyLogPath, router) + if server == nil { + logger.InitLog.Errorf("Initialize HTTP server failed: %+v", err) + return + } + + if err != nil { + logger.InitLog.Warnf("Initialize HTTP server: +%v", err) + } + + serverScheme := factory.AusfConfig.Configuration.Sbi.Scheme + if serverScheme == "http" { + err = server.ListenAndServe() + } else if serverScheme == "https" { + err = server.ListenAndServeTLS(pemPath, keyPath) + } + + if err != nil { + logger.InitLog.Fatalf("HTTP server setup failed: %+v", err) + } +} + +func (ausf *AUSF) Exec(c *cli.Context) error { + logger.InitLog.Traceln("args:", c.String("ausfcfg")) + args := ausf.FilterCli(c) + logger.InitLog.Traceln("filter: ", args) + command := exec.Command("./ausf", args...) + + stdout, err := command.StdoutPipe() + if err != nil { + logger.InitLog.Fatalln(err) + } + wg := sync.WaitGroup{} + wg.Add(3) + go func() { + defer func() { + if p := recover(); p != nil { + // Print stack for panic to log. Fatalf() will let program exit. + logger.InitLog.Fatalf("panic: %v\n%s", p, string(debug.Stack())) + } + }() + + in := bufio.NewScanner(stdout) + for in.Scan() { + fmt.Println(in.Text()) + } + wg.Done() + }() + + stderr, err := command.StderrPipe() + if err != nil { + logger.InitLog.Fatalln(err) + } + go func() { + defer func() { + if p := recover(); p != nil { + // Print stack for panic to log. Fatalf() will let program exit. + logger.InitLog.Fatalf("panic: %v\n%s", p, string(debug.Stack())) + } + }() + + in := bufio.NewScanner(stderr) + for in.Scan() { + fmt.Println(in.Text()) + } + wg.Done() + }() + + go func() { + defer func() { + if p := recover(); p != nil { + // Print stack for panic to log. Fatalf() will let program exit. + logger.InitLog.Fatalf("panic: %v\n%s", p, string(debug.Stack())) + } + }() + + startErr := command.Start() + if startErr != nil { + logger.InitLog.Fatalln(startErr) + } + wg.Done() + }() + + wg.Wait() + + return err +} + +func (ausf *AUSF) Terminate() { + logger.InitLog.Infof("Terminating AUSF...") + // deregister with NRF + problemDetails, err := consumer.SendDeregisterNFInstance() + if problemDetails != nil { + logger.InitLog.Errorf("Deregister NF instance Failed Problem[%+v]", problemDetails) + } else if err != nil { + logger.InitLog.Errorf("Deregister NF instance Error[%+v]", err) + } else { + logger.InitLog.Infof("Deregister from NRF successfully") + } + + logger.InitLog.Infof("AUSF terminated") +} diff --git a/service/init.go b/service/init.go deleted file mode 100644 index 709343e..0000000 --- a/service/init.go +++ /dev/null @@ -1,264 +0,0 @@ -package service - -import ( - "bufio" - "fmt" - "os" - "os/exec" - "os/signal" - "sync" - "syscall" - - "github.com/sirupsen/logrus" - "github.com/urfave/cli" - - "github.com/free5gc/ausf/consumer" - ausf_context "github.com/free5gc/ausf/context" - "github.com/free5gc/ausf/factory" - "github.com/free5gc/ausf/logger" - "github.com/free5gc/ausf/ueauthentication" - "github.com/free5gc/ausf/util" - "github.com/free5gc/http2_util" - "github.com/free5gc/logger_util" - openApiLogger "github.com/free5gc/openapi/logger" - "github.com/free5gc/path_util" - pathUtilLogger "github.com/free5gc/path_util/logger" -) - -type AUSF struct{} - -type ( - // Config information. - Config struct { - ausfcfg string - } -) - -var config Config - -var ausfCLi = []cli.Flag{ - cli.StringFlag{ - Name: "free5gccfg", - Usage: "common config file", - }, - cli.StringFlag{ - Name: "ausfcfg", - Usage: "config file", - }, -} - -var initLog *logrus.Entry - -func init() { - initLog = logger.InitLog -} - -func (*AUSF) GetCliCmd() (flags []cli.Flag) { - return ausfCLi -} - -func (ausf *AUSF) Initialize(c *cli.Context) error { - config = Config{ - ausfcfg: c.String("ausfcfg"), - } - - if config.ausfcfg != "" { - if err := factory.InitConfigFactory(config.ausfcfg); err != nil { - return err - } - } else { - DefaultAusfConfigPath := path_util.Free5gcPath("free5gc/config/ausfcfg.yaml") - if err := factory.InitConfigFactory(DefaultAusfConfigPath); err != nil { - return err - } - } - - ausf.setLogLevel() - - if err := factory.CheckConfigVersion(); err != nil { - return err - } - - return nil -} - -func (ausf *AUSF) setLogLevel() { - if factory.AusfConfig.Logger == nil { - initLog.Warnln("AUSF config without log level setting!!!") - return - } - - if factory.AusfConfig.Logger.AUSF != nil { - if factory.AusfConfig.Logger.AUSF.DebugLevel != "" { - if level, err := logrus.ParseLevel(factory.AusfConfig.Logger.AUSF.DebugLevel); err != nil { - initLog.Warnf("AUSF Log level [%s] is invalid, set to [info] level", - factory.AusfConfig.Logger.AUSF.DebugLevel) - logger.SetLogLevel(logrus.InfoLevel) - } else { - initLog.Infof("AUSF Log level is set to [%s] level", level) - logger.SetLogLevel(level) - } - } else { - initLog.Warnln("AUSF Log level not set. Default set to [info] level") - logger.SetLogLevel(logrus.InfoLevel) - } - logger.SetReportCaller(factory.AusfConfig.Logger.AUSF.ReportCaller) - } - - if factory.AusfConfig.Logger.PathUtil != nil { - if factory.AusfConfig.Logger.PathUtil.DebugLevel != "" { - if level, err := logrus.ParseLevel(factory.AusfConfig.Logger.PathUtil.DebugLevel); err != nil { - pathUtilLogger.PathLog.Warnf("PathUtil Log level [%s] is invalid, set to [info] level", - factory.AusfConfig.Logger.PathUtil.DebugLevel) - pathUtilLogger.SetLogLevel(logrus.InfoLevel) - } else { - pathUtilLogger.SetLogLevel(level) - } - } else { - pathUtilLogger.PathLog.Warnln("PathUtil Log level not set. Default set to [info] level") - pathUtilLogger.SetLogLevel(logrus.InfoLevel) - } - pathUtilLogger.SetReportCaller(factory.AusfConfig.Logger.PathUtil.ReportCaller) - } - - if factory.AusfConfig.Logger.OpenApi != nil { - if factory.AusfConfig.Logger.OpenApi.DebugLevel != "" { - if level, err := logrus.ParseLevel(factory.AusfConfig.Logger.OpenApi.DebugLevel); err != nil { - openApiLogger.OpenApiLog.Warnf("OpenAPI Log level [%s] is invalid, set to [info] level", - factory.AusfConfig.Logger.OpenApi.DebugLevel) - openApiLogger.SetLogLevel(logrus.InfoLevel) - } else { - openApiLogger.SetLogLevel(level) - } - } else { - openApiLogger.OpenApiLog.Warnln("OpenAPI Log level not set. Default set to [info] level") - openApiLogger.SetLogLevel(logrus.InfoLevel) - } - openApiLogger.SetReportCaller(factory.AusfConfig.Logger.OpenApi.ReportCaller) - } -} - -func (ausf *AUSF) FilterCli(c *cli.Context) (args []string) { - for _, flag := range ausf.GetCliCmd() { - name := flag.GetName() - value := fmt.Sprint(c.Generic(name)) - if value == "" { - continue - } - - args = append(args, "--"+name, value) - } - return args -} - -func (ausf *AUSF) Start() { - initLog.Infoln("Server started") - - router := logger_util.NewGinWithLogrus(logger.GinLog) - ueauthentication.AddService(router) - - ausf_context.Init() - self := ausf_context.GetSelf() - // Register to NRF - profile, err := consumer.BuildNFInstance(self) - if err != nil { - initLog.Error("Build AUSF Profile Error") - } - _, self.NfId, err = consumer.SendRegisterNFInstance(self.NrfUri, self.NfId, profile) - if err != nil { - initLog.Errorf("AUSF register to NRF Error[%s]", err.Error()) - } - - ausfLogPath := util.AusfLogPath - - addr := fmt.Sprintf("%s:%d", self.BindingIPv4, self.SBIPort) - - signalChannel := make(chan os.Signal, 1) - signal.Notify(signalChannel, os.Interrupt, syscall.SIGTERM) - go func() { - <-signalChannel - ausf.Terminate() - os.Exit(0) - }() - - server, err := http2_util.NewServer(addr, ausfLogPath, router) - if server == nil { - initLog.Errorf("Initialize HTTP server failed: %+v", err) - return - } - - if err != nil { - initLog.Warnf("Initialize HTTP server: +%v", err) - } - - serverScheme := factory.AusfConfig.Configuration.Sbi.Scheme - if serverScheme == "http" { - err = server.ListenAndServe() - } else if serverScheme == "https" { - err = server.ListenAndServeTLS(util.AusfPemPath, util.AusfKeyPath) - } - - if err != nil { - initLog.Fatalf("HTTP server setup failed: %+v", err) - } -} - -func (ausf *AUSF) Exec(c *cli.Context) error { - initLog.Traceln("args:", c.String("ausfcfg")) - args := ausf.FilterCli(c) - initLog.Traceln("filter: ", args) - command := exec.Command("./ausf", args...) - - stdout, err := command.StdoutPipe() - if err != nil { - initLog.Fatalln(err) - } - wg := sync.WaitGroup{} - wg.Add(3) - go func() { - in := bufio.NewScanner(stdout) - for in.Scan() { - fmt.Println(in.Text()) - } - wg.Done() - }() - - stderr, err := command.StderrPipe() - if err != nil { - initLog.Fatalln(err) - } - go func() { - in := bufio.NewScanner(stderr) - for in.Scan() { - fmt.Println(in.Text()) - } - wg.Done() - }() - - go func() { - startErr := command.Start() - if startErr != nil { - initLog.Fatalln(startErr) - } - wg.Done() - }() - - wg.Wait() - - return err -} - -func (ausf *AUSF) Terminate() { - logger.InitLog.Infof("Terminating AUSF...") - // deregister with NRF - problemDetails, err := consumer.SendDeregisterNFInstance() - if problemDetails != nil { - logger.InitLog.Errorf("Deregister NF instance Failed Problem[%+v]", problemDetails) - } else if err != nil { - logger.InitLog.Errorf("Deregister NF instance Error[%+v]", err) - } else { - logger.InitLog.Infof("Deregister from NRF successfully") - } - - logger.InitLog.Infof("AUSF terminated") -} diff --git a/util/path.go b/util/path.go deleted file mode 100644 index 3bbee0f..0000000 --- a/util/path.go +++ /dev/null @@ -1,14 +0,0 @@ -//+build !debug - -package util - -import ( - "github.com/free5gc/path_util" -) - -var ( - AusfLogPath = path_util.Free5gcPath("free5gc/ausfsslkey.log") - AusfPemPath = path_util.Free5gcPath("free5gc/support/TLS/ausf.pem") - AusfKeyPath = path_util.Free5gcPath("free5gc/support/TLS/ausf.key") - DefaultAusfConfigPath = path_util.Free5gcPath("free5gc/config/ausfcfg.yaml") -) diff --git a/util/path_debug.go b/util/path_debug.go deleted file mode 100644 index fad1389..0000000 --- a/util/path_debug.go +++ /dev/null @@ -1,14 +0,0 @@ -//+build debug - -package util - -import ( - "github.com/free5gc/path_util" -) - -var ( - AusfLogPath = path_util.Free5gcPath("free5gc/ausfsslkey.log") - AusfPemPath = path_util.Free5gcPath("free5gc/support/TLS/ausf.pem") - AusfKeyPath = path_util.Free5gcPath("free5gc/support/TLS/ausf.key") - DefaultAusfConfigPath = path_util.Free5gcPath("free5gc/config/ausfcfg.yaml") -)