SIS Import validates email address

refs CNVS-22801

Test plan:
* Create a csv file with the following contents

user_id,login_id,first_name,last_name,email,status
user_1,user1,User,Uno,BAD_EMAIL_ADDRESS,active

* Try to import this csv file
* Ensure that the import succeeds (i.e. the user is created)
* Ensure there is an import warning due to "BAD_EMAIL_ADDRESS"
  not being a valid email address

Change-Id: Iac85a894bbbbdd69cd4f88f6f893975f6c6436c5
Reviewed-on: https://gerrit.instructure.com/63990
Reviewed-by: Mark Severson <markse@instructure.com>
Tested-by: Jenkins
QA-Review: Adrian Russell <arussell@instructure.com>
Product-Review: Linda Feng <lfeng@instructure.com>
This commit is contained in:
Andrew Butterfield 2015-09-24 16:57:50 -06:00
parent d3ba427472
commit 008c9fd2be
5 changed files with 25 additions and 13 deletions

View File

@ -3,7 +3,8 @@ require 'mail'
class EmailAddressValidator
def self.valid?(value)
addr = Mail::Address.new(value)
addr.domain && addr.address == value
return false unless addr.domain
addr.address == value
rescue Mail::Field::ParseError
false
end

View File

@ -212,7 +212,7 @@ module SIS
@users_to_add_account_associations << user.id if should_add_account_associations
@users_to_update_account_associations << user.id if should_update_account_associations
if email.present?
if email.present? && EmailAddressValidator.valid?(email)
# find all CCs for this user, and active conflicting CCs for all users
# unless we're deleting this user, then only find CCs for this user
if status_is_active
@ -263,6 +263,8 @@ module SIS
cc.send_merge_notification!
end
end
elsif email.present? && EmailAddressValidator.valid?(email) == false
@messages << "The email address associated with user '#{user_id}' is invalid (email: '#{email}')"
end
if pseudo.changed?

View File

@ -1,10 +1,10 @@
user_id,login_id,first_name,last_name,email,status
fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller1,fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller1,fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii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iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller7,active
fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller8,fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller8,fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller8,fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller8,fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller8,active
welliguessitsnowtimeforuft8becausewereached4096bytesÅØÅØÅØÅØÅØ,broken,broken,broken,broken,active
fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller1,fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller1,fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller1,fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller1,email1@example.com,active
fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii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iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller7,fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller7,email7@example.com,active
fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller8,fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller8,fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller8,fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller8,email8@example.com,active
welliguessitsnowtimeforuft8becausewereached4096bytesÅØÅØÅØÅØÅØ,broken,broken,broken,broken@example.com,active

1 user_id login_id first_name last_name email status
2 fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller1 fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller1 fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller1 fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller1 fiiiiiiiiiiiiiiiiiiiiiiiiiiiii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iiiiiiiiiiiiiiiiiiiiiiiller8 fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller8 fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller8 fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller8 fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiller8 email8@example.com active
10 welliguessitsnowtimeforuft8becausewereached4096bytesÅØÅØÅØÅØÅØ broken broken broken broken broken@example.com active

View File

@ -4,13 +4,13 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
describe "EmailAddressValidator" do
it "accepts good addresses with domains" do
['user@example.com', '"non\@triv"/ial@example.com'].each do |addr|
expect(EmailAddressValidator.valid?(addr)).to be_truthy
expect(EmailAddressValidator.valid?(addr)).to eq true
end
end
it "rejects bad, local, or multiple addresses" do
['None', '@example.com', 'user@', 'user1@example.com, user2@example.com'].each do |addr|
expect(EmailAddressValidator.valid?(addr)).to be_falsey
expect(EmailAddressValidator.valid?(addr)).to eq false
end
end
end

View File

@ -757,6 +757,15 @@ describe SIS::CSV::UserImporter do
expect(Pseudonym.by_unique_id('user2').first).to be_nil
end
it "should not confirm an email communication channel that has an invalid email" do
importer = process_csv_data(
"user_id,login_id,first_name,last_name,email,status",
"user_1,user1,User,Uno,None,active"
)
expect(importer.warnings.length).to eq 1
expect(importer.warnings[0][1]).to eq "The email address associated with user 'user_1' is invalid (email: 'None')"
end
it "should not present an error for the same login_id with different case for same user" do
process_csv_data_cleanly(
"user_id,login_id,first_name,last_name,email,status",