module SamlCamel::Logging
handles logging throughout SP
Constants
- LOGGER
- PRIMARY_ID
- SHOULD_LOG
Public Class Methods
auth_failure(error_context)
click to toggle source
# File lib/saml_camel.rb, line 74 def self.auth_failure(error_context) LOGGER.error("An error occured during authentication. #{error_context}") if SHOULD_LOG LOGGER.error("Backtrace: \n\t\t#{error_context.backtrace.join("\n\t\t")}") if SHOULD_LOG rescue StandardError LOGGER.debug('Unknown Error During auth_failure logging.') if SHOULD_LOG end
bad_ip(saml_attrs, request_ip, current_ip)
click to toggle source
# File lib/saml_camel.rb, line 81 def self.bad_ip(saml_attrs, request_ip, current_ip) if SHOULD_LOG LOGGER.info("Bad IP address for #{saml_attrs[PRIMARY_ID]}. IP at SAML request #{request_ip} | IP presented #{current_ip}") end rescue StandardError LOGGER.debug('Unknown Error During relay state logging. IP check') if SHOULD_LOG end
clock_drift(clock_drift)
click to toggle source
# File lib/saml_camel.rb, line 90 def self.clock_drift(clock_drift) LOGGER.debug("Clock drift has not been configured. Must either be false, or an integer. Currently configured as #{clock_drift}(#{clock_drift.class})") if SHOULD_LOG rescue StandardError LOGGER.debug('Unknown Error During Debug') if SHOULD_LOG end
debug(message)
click to toggle source
# File lib/saml_camel.rb, line 96 def self.debug(message) LOGGER.debug(message) if SHOULD_LOG rescue StandardError LOGGER.debug('Unknown Error During Debug') if SHOULD_LOG end
expired_session(saml_attrs)
click to toggle source
# File lib/saml_camel.rb, line 102 def self.expired_session(saml_attrs) LOGGER.info("Session Expired for #{saml_attrs[PRIMARY_ID]}") if SHOULD_LOG rescue StandardError LOGGER.debug('Unknown Error During relay state logging. Expired session check') if SHOULD_LOG end
logout(saml_attrs)
click to toggle source
# File lib/saml_camel.rb, line 108 def self.logout(saml_attrs) LOGGER.info("#{saml_attrs[PRIMARY_ID]} has succesfully logged out.") if SHOULD_LOG rescue StandardError if SHOULD_LOG LOGGER.debug('Unknown error logging user logout. Most likely anonymous user clicked a logout button.') end end
saml_state(data)
click to toggle source
no occurances of this being used, may be able to remove? 10/17/2018
# File lib/saml_camel.rb, line 118 def self.saml_state(data) if SHOULD_LOG LOGGER.info("Stored Relay: #{data[:stored_relay]} | RequestRelay: #{data[:request_relay]} | Stored IP: #{data[:stored_ip]} RemoteIP: #{data[:remote_ip]}") end rescue StandardError LOGGER.debug('Unknown Error During relay state logging. Saml state check') if SHOULD_LOG end
successful_auth(saml_attrs)
click to toggle source
# File lib/saml_camel.rb, line 128 def self.successful_auth(saml_attrs) LOGGER.info("#{saml_attrs[PRIMARY_ID]} has succesfully authenticated.") if SHOULD_LOG rescue StandardError if SHOULD_LOG LOGGER.debug('Unknown Error During successful_auth logging. Check PRIMARY_ID configured in settings.json and that user has attribute.') end end