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

Option for default event in DefaultAuthenticationEventPublisher #7937

Closed
wants to merge 1 commit into from

Conversation

zeeshanadnan
Copy link
Contributor

…Publisher

Fixes gh-7825

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 5, 2020
@jzheaux jzheaux self-assigned this Feb 5, 2020
@jzheaux jzheaux added in: core An issue in spring-security-core type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 5, 2020
@jzheaux jzheaux added this to the 5.3.0 milestone Feb 5, 2020
Copy link
Contributor

@jzheaux jzheaux left a comment

Choose a reason for hiding this comment

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

Awesome, @zeeshanadnan! I've left some feedback inline.

@Test
public void defaultAuthenticationFailureEventIsPublished() {
publisher = new DefaultAuthenticationEventPublisher();
Properties p = new Properties();
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these lines necessary that set up the additional exception mappings? I'm thinking that lines 149 thru 152 can be removed.

}, mock(Authentication.class));
verify(appPublisher).publishEvent(isA(AuthenticationFailureBadCredentialsEvent.class));
}

private static final class MockAuthenticationException extends
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you please add a test for a class that is missing the appropriate constructor? That will make sure to test that the exception is thrown appropriately.

@zeeshanadnan
Copy link
Contributor Author

Hi @jzheaux added your change requests into a new commit.

@jzheaux
Copy link
Contributor

jzheaux commented Feb 6, 2020

Thanks @zeeshanadnan for the changes. In preparation for merging, will you please squash your commits and change the commit message to match the contribution guidelines?

@zeeshanadnan zeeshanadnan changed the title Add option to configure a default event in DefaultAuthenticationEvent… Option for default event in DefaultAuthenticationEventPublisher Feb 6, 2020
@zeeshanadnan
Copy link
Contributor Author

Thanks @zeeshanadnan for the changes. In preparation for merging, will you please squash your commits and change the commit message to match the contribution guidelines?

@jzheaux Done

@jzheaux
Copy link
Contributor

jzheaux commented Feb 6, 2020

Thanks, @zeeshanadnan, for the PR! This is now merged into master via 51b9b2f.

Note that I polished the commit message just a bit, though it will still show you as the contributor. I added a small polish via 653400e.

@jzheaux jzheaux closed this Feb 6, 2020
@jzheaux jzheaux added the status: duplicate A duplicate of another issue label Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core An issue in spring-security-core status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DefaultAuthenticationEventPublisher should allow configuring a default event
3 participants