Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
318c645f
Commit
318c645f
authored
5 years ago
by
Ashutosh Mestry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3735: CustomAttribute length validation bypass for keys with special prefix.
parent
e6de42b7
master
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
AtlasConfiguration.java
intg/src/main/java/org/apache/atlas/AtlasConfiguration.java
+2
-0
EntityGraphMapper.java
...he/atlas/repository/store/graph/v2/EntityGraphMapper.java
+6
-0
No files found.
intg/src/main/java/org/apache/atlas/AtlasConfiguration.java
View file @
318c645f
...
@@ -64,6 +64,8 @@ public enum AtlasConfiguration {
...
@@ -64,6 +64,8 @@ public enum AtlasConfiguration {
CUSTOM_ATTRIBUTE_KEY_MAX_LENGTH
(
"atlas.custom.attribute.key.max.length"
,
50
),
CUSTOM_ATTRIBUTE_KEY_MAX_LENGTH
(
"atlas.custom.attribute.key.max.length"
,
50
),
CUSTOM_ATTRIBUTE_VALUE_MAX_LENGTH
(
"atlas.custom.attribute.value.max.length"
,
500
),
CUSTOM_ATTRIBUTE_VALUE_MAX_LENGTH
(
"atlas.custom.attribute.value.max.length"
,
500
),
CUSTOM_ATTRIBUTE_KEY_SPECIAL_PREFIX
(
"atlas.custom.attribute.special.prefix"
,
""
),
LABEL_MAX_LENGTH
(
"atlas.entity.label.max.length"
,
50
),
LABEL_MAX_LENGTH
(
"atlas.entity.label.max.length"
,
50
),
IMPORT_TEMP_DIRECTORY
(
"atlas.import.temp.directory"
,
""
),
IMPORT_TEMP_DIRECTORY
(
"atlas.import.temp.directory"
,
""
),
MIGRATION_IMPORT_START_POSITION
(
"atlas.migration.import.start.position"
,
0
),
MIGRATION_IMPORT_START_POSITION
(
"atlas.migration.import.start.position"
,
0
),
...
...
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
View file @
318c645f
...
@@ -119,6 +119,8 @@ public class EntityGraphMapper {
...
@@ -119,6 +119,8 @@ public class EntityGraphMapper {
private
static
final
String
SOFT_REF_FORMAT
=
"%s:%s"
;
private
static
final
String
SOFT_REF_FORMAT
=
"%s:%s"
;
private
static
final
int
INDEXED_STR_SAFE_LEN
=
AtlasConfiguration
.
GRAPHSTORE_INDEXED_STRING_SAFE_LENGTH
.
getInt
();
private
static
final
int
INDEXED_STR_SAFE_LEN
=
AtlasConfiguration
.
GRAPHSTORE_INDEXED_STRING_SAFE_LENGTH
.
getInt
();
private
static
final
boolean
WARN_ON_NO_RELATIONSHIP
=
AtlasConfiguration
.
RELATIONSHIP_WARN_NO_RELATIONSHIPS
.
getBoolean
();
private
static
final
boolean
WARN_ON_NO_RELATIONSHIP
=
AtlasConfiguration
.
RELATIONSHIP_WARN_NO_RELATIONSHIPS
.
getBoolean
();
private
static
final
String
CUSTOM_ATTRIBUTE_KEY_SPECIAL_PREFIX
=
AtlasConfiguration
.
CUSTOM_ATTRIBUTE_KEY_SPECIAL_PREFIX
.
getString
();
private
static
final
String
CLASSIFICATION_NAME_DELIMITER
=
"|"
;
private
static
final
String
CLASSIFICATION_NAME_DELIMITER
=
"|"
;
private
static
final
Pattern
CUSTOM_ATTRIBUTE_KEY_REGEX
=
Pattern
.
compile
(
"^[a-zA-Z0-9_-]*$"
);
private
static
final
Pattern
CUSTOM_ATTRIBUTE_KEY_REGEX
=
Pattern
.
compile
(
"^[a-zA-Z0-9_-]*$"
);
private
static
final
Pattern
LABEL_REGEX
=
Pattern
.
compile
(
"^[a-zA-Z0-9_-]*$"
);
private
static
final
Pattern
LABEL_REGEX
=
Pattern
.
compile
(
"^[a-zA-Z0-9_-]*$"
);
...
@@ -2529,6 +2531,10 @@ public class EntityGraphMapper {
...
@@ -2529,6 +2531,10 @@ public class EntityGraphMapper {
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INVALID_CUSTOM_ATTRIBUTE_KEY_CHARACTERS
,
key
);
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INVALID_CUSTOM_ATTRIBUTE_KEY_CHARACTERS
,
key
);
}
}
if
(
StringUtils
.
isNotEmpty
(
CUSTOM_ATTRIBUTE_KEY_SPECIAL_PREFIX
)
&&
key
.
startsWith
(
CUSTOM_ATTRIBUTE_KEY_SPECIAL_PREFIX
))
{
continue
;
}
if
(
value
.
length
()
>
CUSTOM_ATTRIBUTE_VALUE_MAX_LENGTH
)
{
if
(
value
.
length
()
>
CUSTOM_ATTRIBUTE_VALUE_MAX_LENGTH
)
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INVALID_CUSTOM_ATTRIBUTE_VALUE
,
value
,
String
.
valueOf
(
CUSTOM_ATTRIBUTE_VALUE_MAX_LENGTH
));
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INVALID_CUSTOM_ATTRIBUTE_VALUE
,
value
,
String
.
valueOf
(
CUSTOM_ATTRIBUTE_VALUE_MAX_LENGTH
));
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment