Class: AWSCDK::CloudFront::ResponseHeadersContentSecurityPolicy

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_front/response_headers_content_security_policy.rb

Overview

The policy directives and their values that CloudFront includes as values for the Content-Security-Policy HTTP response header.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content_security_policy:, override:) ⇒ ResponseHeadersContentSecurityPolicy

Returns a new instance of ResponseHeadersContentSecurityPolicy.

Parameters:

  • content_security_policy (String)

    The policy directives and their values that CloudFront includes as values for the Content-Security-Policy HTTP response header.

  • override (Boolean)

    A Boolean that determines whether CloudFront overrides the Content-Security-Policy HTTP response header received from the origin with the one specified in this response headers policy.



9
10
11
12
13
14
# File 'cloud_front/response_headers_content_security_policy.rb', line 9

def initialize(content_security_policy:, override:)
  @content_security_policy = content_security_policy
  Jsii::Type.check_type(@content_security_policy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "contentSecurityPolicy")
  @override = override
  Jsii::Type.check_type(@override, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "override")
end

Instance Attribute Details

#content_security_policyString (readonly)

The policy directives and their values that CloudFront includes as values for the Content-Security-Policy HTTP response header.

Returns:

  • (String)


19
20
21
# File 'cloud_front/response_headers_content_security_policy.rb', line 19

def content_security_policy
  @content_security_policy
end

#overrideBoolean (readonly)

A Boolean that determines whether CloudFront overrides the Content-Security-Policy HTTP response header received from the origin with the one specified in this response headers policy.

Returns:

  • (Boolean)


23
24
25
# File 'cloud_front/response_headers_content_security_policy.rb', line 23

def override
  @override
end

Class Method Details

.jsii_propertiesObject



25
26
27
28
29
30
# File 'cloud_front/response_headers_content_security_policy.rb', line 25

def self.jsii_properties
  {
    :content_security_policy => "contentSecurityPolicy",
    :override => "override",
  }
end

Instance Method Details

#to_jsiiObject



32
33
34
35
36
37
38
39
# File 'cloud_front/response_headers_content_security_policy.rb', line 32

def to_jsii
  result = {}
  result.merge!({
    "contentSecurityPolicy" => @content_security_policy,
    "override" => @override,
  })
  result.compact
end