Skip to content

Commit

Permalink
fixes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
kickster97 committed Feb 6, 2025
1 parent 8a5d369 commit c275998
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/lavinmq/amqp/connection_factory.cr
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module LavinMQ
logger = Logger.new(Log, metadata)
if confirm_header(socket, logger)
if start_ok = start(socket, logger)
if user = authenticate(socket, remote_address, start_ok, logger, @auth_chain)
if user = authenticate(socket, remote_address, start_ok, logger)
if tune_ok = tune(socket, logger)
if vhost = open(socket, user, logger)
socket.read_timeout = heartbeat_timeout(tune_ok)
Expand Down Expand Up @@ -105,10 +105,10 @@ module LavinMQ
end
end

def authenticate(socket, remote_address, start_ok, log, auth_chain)
def authenticate(socket, remote_address, start_ok, log)
username, password = credentials(start_ok)
user = @users[username]?
return user if user && auth_chain.authenticate(username, password) &&
return user if user && @auth_chain.authenticate(username, password) &&
guest_only_loopback?(remote_address, user)

if user.nil?
Expand Down
1 change: 0 additions & 1 deletion src/lavinmq/auth/authenticators/basic.cr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module LavinMQ
begin
user = @users[username]
return user if user && user.password && user.password.not_nil!.verify(password)
Log.info { "Basic authentication failed" }
rescue ex : Exception
Log.error { "Basic authentication failed: #{ex.message}" }
end
Expand Down

0 comments on commit c275998

Please sign in to comment.