A platform for community discussion. Free, open, simple.
DEV: Do not log API key scope and/or source-ip mismatches (#15423)
David Taylor4f06c24a576e
diff --git a/lib/auth/default_current_user_provider.rb b/lib/auth/default_current_user_provider.rbindex 4f369d92409..519caeae939 100644--- a/lib/auth/default_current_user_provider.rb+++ b/lib/auth/default_current_user_provider.rb@@ -369,8 +369,7 @@ class Auth::DefaultCurrentUserProviderif api_key = ApiKey.active.with_key(api_key_value).includes(:user).firstapi_username = header_api_key? ? @env[HEADER_API_USERNAME] : request[API_USERNAME]- unless api_key.request_allowed?(@env)- Rails.logger.warn("[Unauthorized API Access] username: #{api_username}, IP address: #{request.ip}")+ if !api_key.request_allowed?(@env)return nilend