From a6cd38bc65c493de81b9b8b9056a23edf0ad27d7 Mon Sep 17 00:00:00 2001
From: Fabian Seidl <fabian.seidl@h-da.de>
Date: Fri, 26 Jul 2024 11:43:41 +0000
Subject: [PATCH] Apply 5 suggestion(s) to 3 file(s)

Co-authored-by: Fabian Seidl <fabian.seidl@h-da.de>
---
 controller/config/config.go          | 2 +-
 controller/controller.go             | 6 +++---
 controller/northbound/server/auth.go | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/controller/config/config.go b/controller/config/config.go
index eace63145..c1e87c46a 100644
--- a/controller/config/config.go
+++ b/controller/config/config.go
@@ -83,7 +83,7 @@ var CertFilePath string
 // KeyFilePath si the path to the private key that the controller should use for TLS connections.
 var KeyFilePath string
 
-// MaxTokensPerUser is the maximum number of tokens a user can have. This determiens the maximum of concurrent logged in sessions per user.
+// MaxTokensPerUser is the maximum number of tokens a user can have. This determines the maximum of concurrent logged in sessions per user.
 var MaxTokensPerUser int
 
 // Init gets called on module import.
diff --git a/controller/controller.go b/controller/controller.go
index c88134520..65d692517 100644
--- a/controller/controller.go
+++ b/controller/controller.go
@@ -173,7 +173,7 @@ func initialize() error {
 		return err
 	}
 
-	if err := deletAllExpiredUserTokens(); err != nil {
+	if err := deleteAllExpiredUserTokens(); err != nil {
 		return err
 	}
 
@@ -446,14 +446,14 @@ func ensureDefaultUserExists() error {
 	return nil
 }
 
-func deletAllExpiredUserTokens() error {
+func deleteAllExpiredUserTokens() error {
 	var usersToUpdate []rbac.User
 	// Temporary create JWT manager just to evaluate tokens here
 	jwtManager := rbacImpl.NewJWTManager(config.JWTSecret, config.JWTDuration)
 
 	users, err := c.userService.GetAll()
 	if err != nil {
-		return fmt.Errorf("error getting all users while deleting expires user tokens: %w", err)
+		return fmt.Errorf("error getting all users while deleting expired user tokens: %w", err)
 	}
 
 	for _, user := range users {
diff --git a/controller/northbound/server/auth.go b/controller/northbound/server/auth.go
index 0fd198a1a..5ef414023 100644
--- a/controller/northbound/server/auth.go
+++ b/controller/northbound/server/auth.go
@@ -159,7 +159,7 @@ func (s AuthServer) isCorrectPassword(storedPassword, salt, loginPassword string
 }
 
 // handleLogout checks if the provided user name matches with the one associated with token and
-// removed the token from all tokens of the user.
+// removes the token from all tokens of the user.
 func (s AuthServer) handleLogout(ctx context.Context, userName string) error {
 	md, ok := metadata.FromIncomingContext(ctx)
 	if !ok {
-- 
GitLab