Class: AWSCDK::CloudFront::ResponseHeadersXSSProtection
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudFront::ResponseHeadersXSSProtection
- Defined in:
- cloud_front/response_headers_xss_protection.rb
Overview
Determines whether CloudFront includes the X-XSS-Protection HTTP response header and the header’s value.
Instance Attribute Summary collapse
-
#mode_block ⇒ Boolean?
readonly
A Boolean that determines whether CloudFront includes the mode=block directive in the X-XSS-Protection header.
-
#override ⇒ Boolean
readonly
A Boolean that determines whether CloudFront overrides the X-XSS-Protection HTTP response header received from the origin with the one specified in this response headers policy.
-
#protection ⇒ Boolean
readonly
A Boolean that determines the value of the X-XSS-Protection HTTP response header.
-
#report_uri ⇒ String?
readonly
A reporting URI, which CloudFront uses as the value of the report directive in the X-XSS-Protection header.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(override:, protection:, mode_block: nil, report_uri: nil) ⇒ ResponseHeadersXSSProtection
constructor
A new instance of ResponseHeadersXSSProtection.
- #to_jsii ⇒ Object
Constructor Details
#initialize(override:, protection:, mode_block: nil, report_uri: nil) ⇒ ResponseHeadersXSSProtection
Returns a new instance of ResponseHeadersXSSProtection.
11 12 13 14 15 16 17 18 19 20 |
# File 'cloud_front/response_headers_xss_protection.rb', line 11 def initialize(override:, protection:, mode_block: nil, report_uri: nil) @override = override Jsii::Type.check_type(@override, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "override") @protection = protection Jsii::Type.check_type(@protection, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "protection") @mode_block = mode_block Jsii::Type.check_type(@mode_block, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "modeBlock") unless @mode_block.nil? @report_uri = report_uri Jsii::Type.check_type(@report_uri, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "reportUri") unless @report_uri.nil? end |
Instance Attribute Details
#mode_block ⇒ Boolean? (readonly)
Default: false
A Boolean that determines whether CloudFront includes the mode=block directive in the X-XSS-Protection header.
37 38 39 |
# File 'cloud_front/response_headers_xss_protection.rb', line 37 def mode_block @mode_block end |
#override ⇒ Boolean (readonly)
A Boolean that determines whether CloudFront overrides the X-XSS-Protection HTTP response header received from the origin with the one specified in this response headers policy.
25 26 27 |
# File 'cloud_front/response_headers_xss_protection.rb', line 25 def override @override end |
#protection ⇒ Boolean (readonly)
A Boolean that determines the value of the X-XSS-Protection HTTP response header.
When this setting is true, the value of the X-XSS-Protection header is 1. When this setting is false, the value of the X-XSS-Protection header is 0.
32 33 34 |
# File 'cloud_front/response_headers_xss_protection.rb', line 32 def protection @protection end |
#report_uri ⇒ String? (readonly)
Default: - no report uri
A reporting URI, which CloudFront uses as the value of the report directive in the X-XSS-Protection header.
You cannot specify a ReportUri when ModeBlock is true.
44 45 46 |
# File 'cloud_front/response_headers_xss_protection.rb', line 44 def report_uri @report_uri end |
Class Method Details
.jsii_properties ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'cloud_front/response_headers_xss_protection.rb', line 46 def self.jsii_properties { :override => "override", :protection => "protection", :mode_block => "modeBlock", :report_uri => "reportUri", } end |
Instance Method Details
#to_jsii ⇒ Object
55 56 57 58 59 60 61 62 63 64 |
# File 'cloud_front/response_headers_xss_protection.rb', line 55 def to_jsii result = {} result.merge!({ "override" => @override, "protection" => @protection, "modeBlock" => @mode_block, "reportUri" => @report_uri, }) result.compact end |