Skip to content

Commit 1fa38ef

Browse files
committed
fix(validation): also block control characters in entity name pattern
Updated pattern to use \x00-\x1f range to block all control characters including \r, \n, \t, \0 in addition to reserved FQN characters. This also restores the \r restriction that was present in the original dot metacharacter but lost in the character class rewrite.
1 parent a12718c commit 1fa38ef

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

openmetadata-spec/src/main/resources/json/schema/entity/data/table.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
"description": "Local name (not fully qualified name) of the column. ColumnName is `-` when the column is not named in struct dataType. For example, BigQuery supports struct with unnamed fields.",
236236
"type": "string",
237237
"minLength": 1,
238-
"pattern": "^((?!::)[^>\"\n])*$"
238+
"pattern": "^((?!::)[^>\"\\x00-\\x1f])*$"
239239
},
240240
"partitionIntervalTypes": {
241241
"javaType": "org.openmetadata.schema.type.PartitionIntervalTypes",

openmetadata-spec/src/main/resources/json/schema/type/basic.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@
124124
"type": "string",
125125
"minLength": 1,
126126
"maxLength": 256,
127-
"pattern": "^((?!::)[^>\"\n])*$"
127+
"pattern": "^((?!::)[^>\"\\x00-\\x1f])*$"
128128
},
129129
"testCaseEntityName": {
130130
"description": "Name that identifies a test definition and test case.",
131131
"type": "string",
132132
"minLength": 1,
133-
"pattern": "^((?!::)[^>\"\n])*$"
133+
"pattern": "^((?!::)[^>\"\\x00-\\x1f])*$"
134134
},
135135
"fullyQualifiedEntityName": {
136136
"description": "A unique name that identifies an entity. Example for table 'DatabaseService.Database.Schema.Table'.",

0 commit comments

Comments
 (0)