-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
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') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whitespacing is off
docker-compose.yml
Outdated
environment: | ||
- RABBIT_HOST=rabbitmq | ||
|
||
|
There was a problem hiding this comment.
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())); |
There was a problem hiding this comment.
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.
…docker-compose-local.yml
|
||
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); |
There was a problem hiding this comment.
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
…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
I fixed what he requested, but he is not available to change his response himself.
No description provided.