Skip to content
Snippets Groups Projects
Commit 7e7e7ee3 authored by Fabian Seidl's avatar Fabian Seidl
Browse files

linter pleasing

parent 65dc09c4
No related branches found
No related tags found
1 merge request!287Implement data persisting for user management
...@@ -72,5 +72,4 @@ func init() { ...@@ -72,5 +72,4 @@ func init() {
// is called directly, e.g.: // is called directly, e.g.:
// loginCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") // loginCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
userGetCmd.Flags().StringVar(&nbUserName, "u", "", "username to find") userGetCmd.Flags().StringVar(&nbUserName, "u", "", "username to find")
} }
...@@ -73,5 +73,4 @@ func init() { ...@@ -73,5 +73,4 @@ func init() {
// Cobra supports local flags which will only run when this command // Cobra supports local flags which will only run when this command
// is called directly, e.g.: // is called directly, e.g.:
// loginCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") // loginCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
} }
...@@ -200,7 +200,6 @@ func (s Auth) DeleteUsers(ctx context.Context, request *apb.DeleteUsersRequest) ...@@ -200,7 +200,6 @@ func (s Auth) DeleteUsers(ctx context.Context, request *apb.DeleteUsersRequest)
defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds)
for _, u := range request.Username { for _, u := range request.Username {
userToDelete, err := userc.Get(store.Query{Name: u}) userToDelete, err := userc.Get(store.Query{Name: u})
if err != nil { if err != nil {
return nil, status.Errorf(codes.Canceled, "user not found %v", err) return nil, status.Errorf(codes.Canceled, "user not found %v", err)
...@@ -229,7 +228,6 @@ func (s Auth) isValidUser(user rbac.User) (bool, error) { ...@@ -229,7 +228,6 @@ func (s Auth) isValidUser(user rbac.User) (bool, error) {
return true, nil return true, nil
} }
} }
} }
return false, status.Errorf(codes.Unauthenticated, "incorrect user name or password") return false, status.Errorf(codes.Unauthenticated, "incorrect user name or password")
......
...@@ -55,7 +55,6 @@ func (auth AuthInterceptor) Stream() grpc.StreamServerInterceptor { ...@@ -55,7 +55,6 @@ func (auth AuthInterceptor) Stream() grpc.StreamServerInterceptor {
info *grpc.StreamServerInfo, info *grpc.StreamServerInfo,
handler grpc.StreamHandler, handler grpc.StreamHandler,
) error { ) error {
err := auth.authorize(stream.Context(), info.FullMethod) err := auth.authorize(stream.Context(), info.FullMethod)
if err != nil { if err != nil {
return err return err
...@@ -85,7 +84,6 @@ func (auth AuthInterceptor) authorize(ctx context.Context, method string) error ...@@ -85,7 +84,6 @@ func (auth AuthInterceptor) authorize(ctx context.Context, method string) error
if err != nil { if err != nil {
return err return err
} }
} else { } else {
return status.Errorf(codes.PermissionDenied, "no auth token provided") return status.Errorf(codes.PermissionDenied, "no auth token provided")
} }
...@@ -94,7 +92,6 @@ func (auth AuthInterceptor) authorize(ctx context.Context, method string) error ...@@ -94,7 +92,6 @@ func (auth AuthInterceptor) authorize(ctx context.Context, method string) error
} }
func verifyPermisisonForRequestedCall(claims *rbac.UserClaims, requestedMethod string) error { func verifyPermisisonForRequestedCall(claims *rbac.UserClaims, requestedMethod string) error {
user, err := userc.Get(store.Query{Name: claims.Username}) user, err := userc.Get(store.Query{Name: claims.Username})
if err != nil { if err != nil {
return err return err
...@@ -119,7 +116,6 @@ func verifyPermisisonForRequestedCall(claims *rbac.UserClaims, requestedMethod s ...@@ -119,7 +116,6 @@ func verifyPermisisonForRequestedCall(claims *rbac.UserClaims, requestedMethod s
} }
} }
} }
} }
return status.Errorf(codes.PermissionDenied, "user not authorized for this call") return status.Errorf(codes.PermissionDenied, "user not authorized for this call")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment