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). Its field-delim is *WSP ";" *WSP while its prose discards records not beginning with "v=TLSRPTv1;" — the same contradiction RFC 8461 §3.1 has
/\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.
68 69 70 |
# File 'lib/mta_sts/report.rb', line 68 def domain @domain end |
#ignored ⇒ Object (readonly)
Returns the value of attribute ignored.
68 69 70 |
# File 'lib/mta_sts/report.rb', line 68 def ignored @ignored end |
#rua ⇒ Object (readonly)
Returns the value of attribute rua.
68 69 70 |
# File 'lib/mta_sts/report.rb', line 68 def rua @rua end |
Class Method Details
.parse(text, domain: nil) ⇒ Object
21 22 23 |
# File 'lib/mta_sts/report.rb', line 21 def parse(text, domain: nil) new rua: uris_in(fields_in(text)), domain: domain end |
Instance Method Details
#https ⇒ Object
79 80 81 |
# File 'lib/mta_sts/report.rb', line 79 def https rua.grep(HTTPS) end |
#inspect ⇒ Object
87 88 89 |
# File 'lib/mta_sts/report.rb', line 87 def inspect "#<#{self.class.name} rua: #{rua.inspect}, ignored: #{ignored.inspect}>" end |
#mailto ⇒ Object
75 76 77 |
# File 'lib/mta_sts/report.rb', line 75 def mailto rua.grep(MAILTO) end |
#to_s ⇒ Object
83 84 85 |
# File 'lib/mta_sts/report.rb', line 83 def to_s "v=#{REPORT_VERSION}; #{RUA_FIELD}#{rua.join(", ")}" end |