diff --git a/cli/cmd/userGet.go b/cli/cmd/userGet.go index 9aaba3dd77d4fc371cab705857466c5c26d70c70..807988b87211de1a4428c7fbaf799a0b202331f1 100644 --- a/cli/cmd/userGet.go +++ b/cli/cmd/userGet.go @@ -72,5 +72,4 @@ func init() { // is called directly, e.g.: // loginCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") userGetCmd.Flags().StringVar(&nbUserName, "u", "", "username to find") - } diff --git a/cli/cmd/userGetAll.go b/cli/cmd/userGetAll.go index e2568ddfdca972588067320bf29836b2aa08ae76..21c3867eec5ae43d9c5f1a1331ec79b001118bc3 100644 --- a/cli/cmd/userGetAll.go +++ b/cli/cmd/userGetAll.go @@ -73,5 +73,4 @@ func init() { // Cobra supports local flags which will only run when this command // is called directly, e.g.: // loginCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") - } diff --git a/controller/northbound/server/auth.go b/controller/northbound/server/auth.go index e9284484b0f27488b168422abb1fd16d34742c51..6d4610aaca98668b2e8653702ef9e22e4199c1ac 100644 --- a/controller/northbound/server/auth.go +++ b/controller/northbound/server/auth.go @@ -200,7 +200,6 @@ func (s Auth) DeleteUsers(ctx context.Context, request *apb.DeleteUsersRequest) defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) for _, u := range request.Username { - userToDelete, err := userc.Get(store.Query{Name: u}) if err != nil { return nil, status.Errorf(codes.Canceled, "user not found %v", err) @@ -229,7 +228,6 @@ func (s Auth) isValidUser(user rbac.User) (bool, error) { return true, nil } } - } return false, status.Errorf(codes.Unauthenticated, "incorrect user name or password") diff --git a/controller/northbound/server/auth_interceptor.go b/controller/northbound/server/auth_interceptor.go index eb8dc450877e8030670de614ecf08748e019bfc7..cc127da9bbf47e3e7670ab25948331b642a8d7ca 100644 --- a/controller/northbound/server/auth_interceptor.go +++ b/controller/northbound/server/auth_interceptor.go @@ -55,7 +55,6 @@ func (auth AuthInterceptor) Stream() grpc.StreamServerInterceptor { info *grpc.StreamServerInfo, handler grpc.StreamHandler, ) error { - err := auth.authorize(stream.Context(), info.FullMethod) if err != nil { return err @@ -85,7 +84,6 @@ func (auth AuthInterceptor) authorize(ctx context.Context, method string) error if err != nil { return err } - } else { return status.Errorf(codes.PermissionDenied, "no auth token provided") } @@ -94,7 +92,6 @@ func (auth AuthInterceptor) authorize(ctx context.Context, method string) error } func verifyPermisisonForRequestedCall(claims *rbac.UserClaims, requestedMethod string) error { - user, err := userc.Get(store.Query{Name: claims.Username}) if err != nil { return err @@ -119,7 +116,6 @@ func verifyPermisisonForRequestedCall(claims *rbac.UserClaims, requestedMethod s } } } - } return status.Errorf(codes.PermissionDenied, "user not authorized for this call")