Class: AWSCDK::CloudFront::CfnResponseHeadersPolicy::ContentSecurityPolicyProperty

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

Overview

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

For more information about the Content-Security-Policy HTTP response header, see Content-Security-Policy in the MDN Web Docs.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content_security_policy:, override:) ⇒ ContentSecurityPolicyProperty

Returns a new instance of ContentSecurityPolicyProperty.

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, AWSCDK::IResolvable)

    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.



684
685
686
687
688
689
# File 'cloud_front/cfn_response_headers_policy.rb', line 684

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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "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.



695
696
697
# File 'cloud_front/cfn_response_headers_policy.rb', line 695

def content_security_policy
  @content_security_policy
end

#overrideBoolean, AWSCDK::IResolvable (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.



700
701
702
# File 'cloud_front/cfn_response_headers_policy.rb', line 700

def override
  @override
end

Class Method Details

.jsii_propertiesObject



702
703
704
705
706
707
# File 'cloud_front/cfn_response_headers_policy.rb', line 702

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

Instance Method Details

#to_jsiiObject



709
710
711
712
713
714
715
716
# File 'cloud_front/cfn_response_headers_policy.rb', line 709

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