You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@dlab.apache.org by GitBox <gi...@apache.org> on 2020/02/06 14:53:14 UTC

[GitHub] [incubator-dlab] ppapou opened a new pull request #588: [Dlab-1422] The endpoint URL verification

ppapou opened a new pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r379076166
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,27 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.URL;
+import javax.validation.constraints.Pattern;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	  the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+    /*
+      the NAME_REGEXP_VALIDATION - regexp accepts the latin literals and arabic numbers, plus @._ symbols,
+      i.e the loc!a1 field name will be ignored
+    */
+    private static final String NAME_REGEXP_VALIDATION = "[a-zA-Z0-9@_.]+";
+	private static final String IMPROPER_FIELD_MESSAGE = "endpoint field is in improper format!";
+	@Pattern(regexp = NAME_REGEXP_VALIDATION, message = IMPROPER_FIELD_MESSAGE)
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r379075812
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,27 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.URL;
+import javax.validation.constraints.Pattern;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	  the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+    /*
+      the NAME_REGEXP_VALIDATION - regexp accepts the latin literals and arabic numbers, plus @._ symbols,
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r378996587
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,27 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.URL;
+import javax.validation.constraints.Pattern;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	  the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
 
 Review comment:
   I think we should not give examples of invalid URLs. So that we will rid of the comment because of the name of the field(**URL_REGEXP_VALIDATION**) give us information about regexp.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r378992028
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,27 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.URL;
+import javax.validation.constraints.Pattern;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	  the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+    /*
+      the NAME_REGEXP_VALIDATION - regexp accepts the latin literals and arabic numbers, plus @._ symbols,
+      i.e the loc!a1 field name will be ignored
+    */
+    private static final String NAME_REGEXP_VALIDATION = "[a-zA-Z0-9@_.]+";
+	private static final String IMPROPER_FIELD_MESSAGE = "endpoint field is in improper format!";
+	@Pattern(regexp = NAME_REGEXP_VALIDATION, message = IMPROPER_FIELD_MESSAGE)
 
 Review comment:
   Please do not extract the message to the **IMPROPER_FIELD_MESSAGE** variable. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r379170366
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,27 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.URL;
+import javax.validation.constraints.Pattern;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	  the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+    /*
+      the NAME_REGEXP_VALIDATION - regexp accepts the latin literals and arabic numbers, plus @._ symbols,
+      i.e the loc!a1 field name will be ignored
+    */
+    private static final String NAME_REGEXP_VALIDATION = "[a-zA-Z0-9@_.]+";
+	private static final String IMPROPER_FIELD_MESSAGE = "endpoint field is in improper format!";
+	@Pattern(regexp = NAME_REGEXP_VALIDATION, message = IMPROPER_FIELD_MESSAGE)
 	private final String name;
-
+	@URL(regexp = URL_REGEXP_VALIDATION, message = IMPROPER_FIELD_MESSAGE)
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r378992612
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,27 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.URL;
+import javax.validation.constraints.Pattern;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	  the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+    /*
+      the NAME_REGEXP_VALIDATION - regexp accepts the latin literals and arabic numbers, plus @._ symbols,
+      i.e the loc!a1 field name will be ignored
+    */
+    private static final String NAME_REGEXP_VALIDATION = "[a-zA-Z0-9@_.]+";
+	private static final String IMPROPER_FIELD_MESSAGE = "endpoint field is in improper format!";
+	@Pattern(regexp = NAME_REGEXP_VALIDATION, message = IMPROPER_FIELD_MESSAGE)
 	private final String name;
-
+	@URL(regexp = URL_REGEXP_VALIDATION, message = IMPROPER_FIELD_MESSAGE)
 
 Review comment:
   I wonder ** IMPROPER_FIELD_MESSAGE** goes here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r378994687
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,27 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.URL;
+import javax.validation.constraints.Pattern;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	  the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+    /*
+      the NAME_REGEXP_VALIDATION - regexp accepts the latin literals and arabic numbers, plus @._ symbols,
+      i.e the loc!a1 field name will be ignored
+    */
+    private static final String NAME_REGEXP_VALIDATION = "[a-zA-Z0-9@_.]+";
+	private static final String IMPROPER_FIELD_MESSAGE = "endpoint field is in improper format!";
+	@Pattern(regexp = NAME_REGEXP_VALIDATION, message = IMPROPER_FIELD_MESSAGE)
 
 Review comment:
   I think we should only check for the non-empty case. So that we will use **@NotEmpty** annotation.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r379071992
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,22 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.NotEmpty;
+import org.hibernate.validator.constraints.URL;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	 the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+	private static final String URL_RESPONSE_MESSAGE = "is empty or contains improper format, symbols ";
+	@NotEmpty(message = "endpoint field cannot be empty")
 	private final String name;
-
+	@URL(regexp = URL_REGEXP_VALIDATION, message = URL_RESPONSE_MESSAGE)
 
 Review comment:
   Yes, it works for empty and blank values

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r379170154
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,27 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.URL;
+import javax.validation.constraints.Pattern;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	  the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+    /*
+      the NAME_REGEXP_VALIDATION - regexp accepts the latin literals and arabic numbers, plus @._ symbols,
+      i.e the loc!a1 field name will be ignored
+    */
+    private static final String NAME_REGEXP_VALIDATION = "[a-zA-Z0-9@_.]+";
+	private static final String IMPROPER_FIELD_MESSAGE = "endpoint field is in improper format!";
+	@Pattern(regexp = NAME_REGEXP_VALIDATION, message = IMPROPER_FIELD_MESSAGE)
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r378888645
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,22 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.NotEmpty;
+import org.hibernate.validator.constraints.URL;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	 the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+	private static final String URL_RESPONSE_MESSAGE = "is empty or contains improper format, symbols ";
+	@NotEmpty(message = "endpoint field cannot be empty")
 	private final String name;
-
+	@URL(regexp = URL_REGEXP_VALIDATION, message = URL_RESPONSE_MESSAGE)
 
 Review comment:
   Yes, the template should handle the non-empty case?
   Regexp has been teste with empty, blank values.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r379075937
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,27 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.URL;
+import javax.validation.constraints.Pattern;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	  the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r378989371
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,22 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.NotEmpty;
+import org.hibernate.validator.constraints.URL;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	 the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+	private static final String URL_RESPONSE_MESSAGE = "is empty or contains improper format, symbols ";
+	@NotEmpty(message = "endpoint field cannot be empty")
 	private final String name;
-
+	@URL(regexp = URL_REGEXP_VALIDATION, message = URL_RESPONSE_MESSAGE)
 
 Review comment:
   Yes, it should.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks merged pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ofuks merged pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r378750671
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,22 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.NotEmpty;
+import org.hibernate.validator.constraints.URL;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	 the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+	private static final String URL_RESPONSE_MESSAGE = "is empty or contains improper format, symbols ";
 
 Review comment:
   I wonder we can change the message to "is in the improper format". Because **is empty** is a particular case of **improper format**. How do you think?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r379170491
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,27 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.URL;
+import javax.validation.constraints.Pattern;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	  the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+    /*
+      the NAME_REGEXP_VALIDATION - regexp accepts the latin literals and arabic numbers, plus @._ symbols,
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r378992289
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,27 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.URL;
+import javax.validation.constraints.Pattern;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	  the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+    /*
+      the NAME_REGEXP_VALIDATION - regexp accepts the latin literals and arabic numbers, plus @._ symbols,
+      i.e the loc!a1 field name will be ignored
+    */
+    private static final String NAME_REGEXP_VALIDATION = "[a-zA-Z0-9@_.]+";
+	private static final String IMPROPER_FIELD_MESSAGE = "endpoint field is in improper format!";
+	@Pattern(regexp = NAME_REGEXP_VALIDATION, message = IMPROPER_FIELD_MESSAGE)
 	private final String name;
-
+	@URL(regexp = URL_REGEXP_VALIDATION, message = IMPROPER_FIELD_MESSAGE)
 
 Review comment:
   The same here

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r378748302
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,22 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.NotEmpty;
+import org.hibernate.validator.constraints.URL;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	 the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+	private static final String URL_RESPONSE_MESSAGE = "is empty or contains improper format, symbols ";
+	@NotEmpty(message = "endpoint field cannot be empty")
 	private final String name;
-
+	@URL(regexp = URL_REGEXP_VALIDATION, message = URL_RESPONSE_MESSAGE)
 
 Review comment:
   Does regexp handle the non-empty case?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on issue #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ppapou commented on issue #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#issuecomment-584463754
 
 
   > 
   > 
   > Did you try to use a URL validator on the resource layer?
   
   Actually no:) 
   Do you mean  put the validator object as an argument of the ApiResponse annotation in the EndpointResource class?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r379076054
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,27 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.URL;
+import javax.validation.constraints.Pattern;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	  the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+    /*
+      the NAME_REGEXP_VALIDATION - regexp accepts the latin literals and arabic numbers, plus @._ symbols,
+      i.e the loc!a1 field name will be ignored
+    */
+    private static final String NAME_REGEXP_VALIDATION = "[a-zA-Z0-9@_.]+";
+	private static final String IMPROPER_FIELD_MESSAGE = "endpoint field is in improper format!";
+	@Pattern(regexp = NAME_REGEXP_VALIDATION, message = IMPROPER_FIELD_MESSAGE)
 	private final String name;
-
+	@URL(regexp = URL_REGEXP_VALIDATION, message = IMPROPER_FIELD_MESSAGE)
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r378894620
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,22 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.NotEmpty;
+import org.hibernate.validator.constraints.URL;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	 the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+	private static final String URL_RESPONSE_MESSAGE = "is empty or contains improper format, symbols ";
 
 Review comment:
   Yeap, a common message looks better.
   What do you think, if we apply the javax Pattern annotation to validate the Name field? 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r378888645
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,22 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.NotEmpty;
+import org.hibernate.validator.constraints.URL;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	 the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+	private static final String URL_RESPONSE_MESSAGE = "is empty or contains improper format, symbols ";
+	@NotEmpty(message = "endpoint field cannot be empty")
 	private final String name;
-
+	@URL(regexp = URL_REGEXP_VALIDATION, message = URL_RESPONSE_MESSAGE)
 
 Review comment:
   Yes, the template should handle the non-empty case?
   Regexp has been tested with empty, blank values.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r379170458
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,27 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.URL;
+import javax.validation.constraints.Pattern;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	  the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou edited a comment on issue #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ppapou edited a comment on issue #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#issuecomment-584463754
 
 
   > 
   > 
   > Did you try to use a URL validator on the resource layer?
   
   Actually no:) 
   Do you mean  put the condition into the createEndpoint of the EndpointResource class?
   Or try to add the validator object into the Response ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification

Posted by GitBox <gi...@apache.org>.
ofuks commented on a change in pull request #588: [Dlab-1422] The endpoint URL verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r378996807
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,27 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.URL;
+import javax.validation.constraints.Pattern;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+	/*
+	  the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+	  i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/"
+	 */
+	private static final String URL_REGEXP_VALIDATION = "^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+    /*
+      the NAME_REGEXP_VALIDATION - regexp accepts the latin literals and arabic numbers, plus @._ symbols,
 
 Review comment:
   The same here

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org