diff --git a/Makefile b/Makefile index 8b7569837704aa866a6d80de66d4d629e510e6ee..13e08b2ca54a66cdece8b91d0951134db0dee44b 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ ci-install-tools: go install gotest.tools/gotestsum@v1.7.0 ci-lint: ci-install-tools - golangci-lint run --config .golangci.yml --out-format code-climate | jq -r '.[] | "\(.location.path):\(.location.lines.begin) \(.description)"' + golangci-lint run --config .golangci.yml --out-format code-climate lint: install-tools ./$(TOOLS_DIR)/golangci-lint run --config .golangci.yml | jq diff --git a/controller/api/grpc.go b/controller/api/grpc.go index 0ec442391a2e3876c3c16d6c802e87f412811ca4..71f08e6de0c6cf25d7ef1744bb02622ce9e26af9 100644 --- a/controller/api/grpc.go +++ b/controller/api/grpc.go @@ -404,6 +404,7 @@ func SendChangeRequest(addr, pid string, req *ppb.ChangeRequest) (*ppb.SetPathLi return pndClient.SetPathList(ctx, r) } +// Login logs a user in func Login(addr, username, pwd string) (*apb.LoginResponse, error) { authClient, err := nbi.AuthClient(addr, dialOptions...) if err != nil { @@ -418,6 +419,7 @@ func Login(addr, username, pwd string) (*apb.LoginResponse, error) { return authClient.Login(ctx, r) } +// Logout logs a user out func Logout(addr, username string) (*apb.LogoutResponse, error) { authClient, err := nbi.AuthClient(addr, dialOptions...) if err != nil { diff --git a/controller/config/config.go b/controller/config/config.go index dab434d61578d4d207fa9ebebde2c0ecbb1392a5..294ff53b5cf527853ba2c80910afe3a065a9bc80 100644 --- a/controller/config/config.go +++ b/controller/config/config.go @@ -39,7 +39,6 @@ func Init() { if err != nil { log.Error("failed initialization of module import", err) } - } // InitializeConfig loads the configuration diff --git a/controller/northbound/server/auth_interceptor.go b/controller/northbound/server/auth_interceptor.go index c6567278562ed6a5719dae38de797e6485a17fff..83ede44f5d0b9835c8fabe9c4eda19f4e0f895d5 100644 --- a/controller/northbound/server/auth_interceptor.go +++ b/controller/northbound/server/auth_interceptor.go @@ -7,9 +7,11 @@ import ( "google.golang.org/grpc" ) +// AuthInterceptor provides an AuthInterceptor type AuthInterceptor struct { } +// Unary provides middleware functionality func (auth AuthInterceptor) Unary() grpc.UnaryServerInterceptor { return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { log.Info("Interceptor called")