Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/backend/handlers/gitlab_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ func validateGitLabInput(instanceURL, token string) error {
}

// Validate token contains only valid characters (alphanumeric and some special chars)
// GitLab tokens use: a-z, A-Z, 0-9, -, _
// GitLab tokens use: a-z, A-Z, 0-9, -, _, .
for _, char := range token {
if (char < 'a' || char > 'z') &&
(char < 'A' || char > 'Z') &&
(char < '0' || char > '9') &&
char != '-' && char != '_' {
char != '-' && char != '_' && char != '.' {
return fmt.Errorf("token contains invalid characters")
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/backend/handlers/gitlab_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ var _ = Describe("GitLab Auth Handler", Label(test_constants.LabelUnit, test_con
"token-with-dashes-456", // with dashes
"UPPERCASE_TOKEN_789012", // uppercase, 20 chars
"MixedCase-Token_1234567", // mixed case, 20 chars
"glpat-abc123xyz.01.def456ghi", // with periods (GitLab token format)
}

for _, token := range validTokens {
Expand Down Expand Up @@ -195,7 +196,6 @@ var _ = Describe("GitLab Auth Handler", Label(test_constants.LabelUnit, test_con
"token;with;semicolons",
"token:with:colons",
"token,with,commas",
"token.with.dots",
"token?with?questions",
"token!with!exclamations",
}
Expand Down
Loading