Commit d387f897 authored by Sanad Liaquat's avatar Sanad Liaquat

Use AuthLogger for logging ip address of

ip restricted group
parent 40d7fc1c
......@@ -7,6 +7,10 @@ module Gitlab
@group = group
end
def logger
@logger ||= Gitlab::AuthLogger.build
end
def allows_current_ip?
return true unless group&.feature_available?(:group_ip_restriction)
......@@ -26,7 +30,11 @@ module Gitlab
return true unless root_ancestor_ip_restrictions.present?
root_ancestor_ip_restrictions.any? { |ip_restriction| ip_restriction.allows_address?(address) }
allowed = root_ancestor_ip_restrictions.any? { |ip_restriction| ip_restriction.allows_address?(address) }
logger.info(message: 'Attempting to access IP restricted group', group_full_path: group.full_path, ip_address: address, allowed: allowed)
allowed
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment