Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class BasicPostgresSecurityValidator implements PostgresSecurityValidator
* Documentation</a>
*/
private static final String DEFAULT_IDENTIFIER_PATTERN =
"^[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)*$";
"^[a-zA-Z_][a-zA-Z0-9_-]*(\\.[a-zA-Z_][a-zA-Z0-9_-]*)*$";

/**
* Default pattern for JSON field names within JSONB columns.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ void testValidIdentifierWithNumbers() {
assertDoesNotThrow(() -> validator.validateIdentifier("col_1"));
}

@Test
void testValidIdentifierWithHyphens() {
assertDoesNotThrow(() -> validator.validateIdentifier("API.repo-url"));
}

@Test
void testInvalidIdentifierNull() {
SecurityException ex =
Expand Down
Loading