Class: MtaSts::Report
- Inherits:
-
Object
- Object
- MtaSts::Report
- Defined in:
- lib/mta_sts/report.rb,
lib/mta_sts/report/result.rb
Defined Under Namespace
Constant Summary collapse
- REPORT_VERSION =
"TLSRPTv1"- REPORT_RECORD =
RFC 8460 §3: tlsrpt-version = %s"v=TLSRPTv1", then 1*(field-delim tlsrpt-field)
/\Av=#{REPORT_VERSION};/- FIELD_DELIM =
";"- RUA_FIELD =
RFC 8460 §3
"rua="- URI_DELIM =
","- MAILTO =
RFC 3986 §3.1 — scheme is case-insensitive
/\Amailto:/i- HTTPS =
/\Ahttps:/i- SCHEMES =
[ MAILTO, HTTPS ].freeze
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#ignored ⇒ Object
readonly
Returns the value of attribute ignored.
-
#rua ⇒ Object
readonly
Returns the value of attribute rua.
Class Method Summary collapse
Instance Method Summary collapse
- #https ⇒ Object
-
#initialize(rua:, domain: nil) ⇒ Report
constructor
A new instance of Report.
- #inspect ⇒ Object
- #mailto ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
66 67 68 |
# File 'lib/mta_sts/report.rb', line 66 def domain @domain end |
#ignored ⇒ Object (readonly)
Returns the value of attribute ignored.
66 67 68 |
# File 'lib/mta_sts/report.rb', line 66 def ignored @ignored end |
#rua ⇒ Object (readonly)
Returns the value of attribute rua.
66 67 68 |
# File 'lib/mta_sts/report.rb', line 66 def rua @rua end |
Class Method Details
.parse(text, domain: nil) ⇒ Object
19 20 21 |
# File 'lib/mta_sts/report.rb', line 19 def parse(text, domain: nil) new rua: uris_in(fields_in(text)), domain: domain end |
Instance Method Details
#https ⇒ Object
77 78 79 |
# File 'lib/mta_sts/report.rb', line 77 def https rua.grep(HTTPS) end |
#inspect ⇒ Object
85 86 87 |
# File 'lib/mta_sts/report.rb', line 85 def inspect "#<#{self.class.name} rua: #{rua.inspect}, ignored: #{ignored.inspect}>" end |
#mailto ⇒ Object
73 74 75 |
# File 'lib/mta_sts/report.rb', line 73 def mailto rua.grep(MAILTO) end |
#to_s ⇒ Object
81 82 83 |
# File 'lib/mta_sts/report.rb', line 81 def to_s "v=#{REPORT_VERSION}; #{RUA_FIELD}#{rua.join(", ")}" end |