-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValidateUri configured in CosmosProperties #23641
Conversation
@@ -137,4 +144,10 @@ public ConnectionMode getConnectionMode() { | |||
public void setConnectionMode(ConnectionMode connectionMode) { | |||
this.connectionMode = connectionMode; | |||
} | |||
|
|||
private void validateUri() { | |||
if (StringUtils.startsWithIgnoreCase(uri, "mongodb://")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using allow list
instead of blocking list
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which blocking list? I don't understand you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your current implementation is blocking mongodb://
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you give me an example?😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static final List<String> SUPPORTED_URI_PREFIX = Arrays.asList("foo", "bar", ...);
Hi @chenrujun, please help review this PR, I will handle the pipeline error.😀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except the variable name.
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(CosmosProperties.class); | ||
|
||
public static final String URIPATTERN = "http[s]{0,1}://.*.documents.azure.com.*"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit : URIPATTERN
-> URI_REGEX
Hi @kushagraThapar,could you please help reivew this PR, help check the uri pattern for cosmosdb? did I miss something? |
azure-spring-data-cosmos does not support mongdb, if
azure.cosmos.uri
configured with mongdb, thrown an exception.Reference
github repo: azure-spring-data-cosmos
Azure Cosmos DB Resource URI Syntax for REST