From c5ce0babb75b6fa338dd21bc62793ae692e7a464 Mon Sep 17 00:00:00 2001 From: Julian Cheal Date: Mon, 27 Aug 2018 19:29:46 +0100 Subject: [PATCH] Add in missing user creation audit event. Recieved from this PR https://github.com/ManageIQ/manageiq/pull/17852 --- spec/models/authenticator/amazon_spec.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/spec/models/authenticator/amazon_spec.rb b/spec/models/authenticator/amazon_spec.rb index 39a635aa2..4f0abefab 100644 --- a/spec/models/authenticator/amazon_spec.rb +++ b/spec/models/authenticator/amazon_spec.rb @@ -375,12 +375,17 @@ def authenticate expect(authenticate).to eq(123) end - it "records two successful audit entries" do + it "records three successful audit entries" do expect(AuditEvent).to receive(:success).with( :event => 'authenticate_amazon', :userid => username, :message => "User #{username} successfully validated by Amazon IAM", ) + expect(AuditEvent).to receive(:success).with( + :event => 'authorize', + :userid => username, + :message => "User creation successful for User: userNameType with ID: #{username}", + ) expect(AuditEvent).to receive(:success).with( :event => 'authenticate_amazon', :userid => username, @@ -410,7 +415,7 @@ def authenticate expect(authenticate).to eq(123) end - it "records two successful audit entries plus one failure" do + it "records three successful audit entries plus one failure" do expect(AuditEvent).to receive(:success).with( :event => 'authenticate_amazon', :userid => username, @@ -421,6 +426,11 @@ def authenticate :userid => username, :message => "Authentication successful for user #{username}", ) + expect(AuditEvent).to receive(:success).with( + :event => 'authorize', + :userid => username, + :message => "User creation successful for User: userNameType with ID: #{username}", + ) expect(AuditEvent).to receive(:failure).with( :event => 'authorize', :userid => username,