Skip to content

Connect authentication service to notification service #8

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

Merged
merged 15 commits into from
Jul 30, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jul 20, 2018

No description provided.

@ghost ghost self-requested a review July 20, 2018 15:31
build.gradle Outdated
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.boot:spring-boot-starter-amqp')

Choose a reason for hiding this comment

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

The whitespacing is off

environment:
- RABBIT_HOST=rabbitmq


Choose a reason for hiding this comment

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

there is an extra blank line here

if (evt.getSource() instanceof UsernamePasswordAuthenticationToken) {
User user = (User) evt.getAuthentication().getPrincipal();
log.info(String.format("User %s logged in", user.getUsername()));
producer.send(String.format("{\"userId\":\"%s\"}", user.getUsername()));

Choose a reason for hiding this comment

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

You should be using the current user id, not the user name.


public void send(String message) {
log.info(String.format("Sending message %s to %s", message, topicExchange.getName()));
this.rabbitTemplate.convertAndSend(topicExchange.getName(), "notification.user.authentication", message);

Choose a reason for hiding this comment

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

Routing key should be like this: {bounded-context}.{aggregate-name}.{what-happened-in-past-tense}
So like notification.user.userauthenticated or something maybe

jusoto and others added 6 commits July 25, 2018 12:25
…Listener to avoid confusion between model.User and uderdetails.User.

Updated test to use SpringRunner.class, defined random port and single declaration of hostUrl.
In WebSecurityConfigurer disabled http.headers to solve issue with front-end
… front-end due to edge-service is also adding these headers.

Added a try catch for exceptions when sending the message to notification service
@ghost ghost dismissed jacobkissel’s stale review July 30, 2018 17:35

I fixed what he requested, but he is not available to change his response himself.

@jschwait jschwait merged commit 0bb05d0 into master Jul 30, 2018
@ghost ghost deleted the send-rabbitmq-message branch July 30, 2018 18:04
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.

4 participants