Skip to content
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

Issue 2620 #2641

Open
wants to merge 7,123 commits into
base: master
Choose a base branch
from
Open

Issue 2620 #2641

wants to merge 7,123 commits into from

Conversation

ddhuy
Copy link

@ddhuy ddhuy commented Nov 18, 2017

Now we can be able to change the email address of an account.

@deruelle
Copy link
Member

@gsaslis can you please help review this one ?

@deruelle
Copy link
Member

@ddhuy can you please sign the Contributor License Agreement at https://telestax.com/open-source/#Contribute so we can accept the contribution ?

@ddhuy
Copy link
Author

ddhuy commented Nov 23, 2017

@deruelle , I have just signed the CLA.

Copy link
Contributor

@gsaslis gsaslis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start @ddhuy !

Please look into the changes requested and let us know.

* @param email: the email address need to be verified
* @return true if email format is valid, false if email format is invalid
*/
public static boolean isValidEmailFormat ( String email ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would favour use of an external library that already handles email validations, rather than including our own regex here. Take a look at the JavaMail or the Apache Commons Validator for some ideas.

Copy link
Author

@ddhuy ddhuy Nov 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsaslis I have just incorporated your comment using JavaMail API. I agree with you that using external library is better than regex.
And I found in class EmailMessageEndpoint we are using the regex for validating email format, so should we change with our new method or keep it as it is?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ddhuy yes, i would suggest we include that change as well in this PR.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsaslis , I changed to JavaMail as mentioned in class EmailMessageEndpoint as well. Please have a review and share with me your feedback.

Copy link
Contributor

@gsaslis gsaslis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the inline comments, could you please also explain your changes with commit b001a77 ?

It seems the InvalidEmailException we used to have has both been made public but also had its type changed? Would you elaborate on why this was needed please?

isValid = true;
} catch (AddressException ex) {
isValid = false;
logger.error("Email " + email + " is invalid");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would change the log level here to warn (if not info).

(error is usually reserved for severe issues that affect the application health. on the other hand, this is very much a normal operation of handling invalid user input - info sounds like a better fit imho)

Copy link
Author

@ddhuy ddhuy Dec 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsaslis Agree with you about the log level. I am prefer changing it to warn. Thanks for your suggestion.
About the b001a77, I see that we had two different classes with exactly same purpose. So I think it should be better if we only have one interface to raise invalid email exception. Later on it will be more easier for maintenance and it is likely to have no duplicate in our code, IMO.

@ddhuy ddhuy force-pushed the issue_2620 branch 3 times, most recently from b639e23 to 74e55d9 Compare December 8, 2017 18:18
@gsaslis
Copy link
Contributor

gsaslis commented Dec 11, 2017

@ddhuy the problem with commit b001a77 is that you've changed the type of the InvalidEmailException: used to be Exception, now it's RuntimeException.

This means that its usages (e.g.

) after your change now only catch a RuntimeException, instead of the more general Exception.

I am not sure this is a valid / intended change... ?

@ddhuy
Copy link
Author

ddhuy commented Dec 15, 2017

@gsaslis , Thanks for your reviewing time and comments. I think make the InvalidEmailException sub-class from RuntimeException is more cleaner and easier for usage. But since sub-class from Exception or RuntimeException has not much different, so I will revert it back to keep minimum effect of the change.

abdulazizali77 and others added 24 commits February 28, 2018 14:16
fixes restcomm1786, unlink only removes given link
fixes restcomm1786 added extension mocks and int test cases
Restcomm1831 adjusted pre/post execpoint consistency
* SDR service event stream implementation

* sms implementation

* Revert "sms implementation"

This reverts commit 0d3a4bd

* SDR service sms messages implementation

* Revert "SDR service sms messages implementation"

This reverts commit 1b464b3

* SDR service sms messages implementation

* SDR service sms messages implementation
comment not applicable removed
fixes restcomm1851, constraint about status check
@ddhuy
Copy link
Author

ddhuy commented Mar 8, 2018

Hi all, I have tried to resolve the merging conflict. Please help cross check them again

@gsaslis
Copy link
Contributor

gsaslis commented Mar 9, 2018

Thanks @ddhuy !

@jaimecasero / @RestComm/vvs-squad does this look good to merge?

@jaimecasero
Copy link
Contributor

i was thinking email is sometimes used as account key, so im not sure making email address modifiable could have some impact. Let me think about it...

Copy link

@maria-farooq maria-farooq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsaslis @ddhuy it seems like PR is missing integartion test when email update operation via http request. please check existing tests for accounts endpoint here https://github.com/RestComm/Restcomm-Connect/blob/master/restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/http/AccountsEndpointTest.java

@gvagenas gvagenas force-pushed the master branch 2 times, most recently from 9469191 to c67f142 Compare January 13, 2022 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.