Class: LogStruct::Log::Security::CSRFViolation

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Includes:
Interfaces::AdditionalDataField, Interfaces::CommonFields, Interfaces::RequestFields, LogStruct::Log::Shared::AddRequestFields, LogStruct::Log::Shared::MergeAdditionalDataFields, LogStruct::Log::Shared::SerializeCommon
Defined in:
lib/log_struct/log/security/csrf_violation.rb

Constant Summary

Constants included from LogStruct::Log::Shared::MergeAdditionalDataFields

LogStruct::Log::Shared::MergeAdditionalDataFields::RESERVED_KEYS

Instance Method Summary collapse

Methods included from LogStruct::Log::Shared::AddRequestFields

#add_request_fields

Methods included from LogStruct::Log::Shared::SerializeCommon

#as_json, #serialize, #serialize_common

Methods included from Interfaces::CommonFields

#event, #source

Methods included from Interfaces::CommonFieldBase

#level, #serialize, #timestamp

Methods included from Interfaces::RequestFields

#http_method, #path, #referer, #source_ip, #user_agent

Methods included from LogStruct::Log::Shared::MergeAdditionalDataFields

#merge_additional_data_fields

Methods included from Interfaces::AdditionalDataField

#additional_data

Instance Method Details

#to_hObject



55
56
57
58
59
60
61
62
63
64
# File 'lib/log_struct/log/security/csrf_violation.rb', line 55

def to_h
  h = T.let({}, T::Hash[LogStruct::LogField, T.untyped])
  h[LogField::Path] = path unless path.nil?
  h[LogField::HttpMethod] = http_method unless http_method.nil?
  h[LogField::SourceIp] = source_ip unless source_ip.nil?
  h[LogField::UserAgent] = user_agent unless user_agent.nil?
  h[LogField::Referer] = referer unless referer.nil?
  h[LogField::Message] = message unless message.nil?
  h
end