
com.amazonaws.services.cloudfront.model.ResponseHeadersPolicySecurityHeadersConfig Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudfront Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.cloudfront.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* A configuration for a set of security-related HTTP response headers. CloudFront adds these headers to HTTP responses
* that it sends for requests that match a cache behavior associated with this response headers policy.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ResponseHeadersPolicySecurityHeadersConfig implements Serializable, Cloneable {
/**
*
* Determines whether CloudFront includes the X-XSS-Protection
HTTP response header and the header's
* value.
*
*
* For more information about the X-XSS-Protection
HTTP response header, see X-XSS-Protection in the MDN
* Web Docs.
*
*/
private ResponseHeadersPolicyXSSProtection xSSProtection;
/**
*
* Determines whether CloudFront includes the X-Frame-Options
HTTP response header and the header's
* value.
*
*
* For more information about the X-Frame-Options
HTTP response header, see X-Frame-Options in the MDN
* Web Docs.
*
*/
private ResponseHeadersPolicyFrameOptions frameOptions;
/**
*
* Determines whether CloudFront includes the Referrer-Policy
HTTP response header and the header's
* value.
*
*
* For more information about the Referrer-Policy
HTTP response header, see Referrer-Policy in the MDN
* Web Docs.
*
*/
private ResponseHeadersPolicyReferrerPolicy referrerPolicy;
/**
*
* 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.
*
*/
private ResponseHeadersPolicyContentSecurityPolicy contentSecurityPolicy;
/**
*
* Determines whether CloudFront includes the X-Content-Type-Options
HTTP response header with its
* value set to nosniff
.
*
*
* For more information about the X-Content-Type-Options
HTTP response header, see X-Content-Type-Options in the MDN Web Docs.
*
*/
private ResponseHeadersPolicyContentTypeOptions contentTypeOptions;
/**
*
* Determines whether CloudFront includes the Strict-Transport-Security
HTTP response header and the
* header's value.
*
*
* For more information about the Strict-Transport-Security
HTTP response header, see Security headers in the Amazon CloudFront Developer Guide and Strict-Transport-Security in the MDN Web Docs.
*
*/
private ResponseHeadersPolicyStrictTransportSecurity strictTransportSecurity;
/**
*
* Determines whether CloudFront includes the X-XSS-Protection
HTTP response header and the header's
* value.
*
*
* For more information about the X-XSS-Protection
HTTP response header, see X-XSS-Protection in the MDN
* Web Docs.
*
*
* @param xSSProtection
* Determines whether CloudFront includes the X-XSS-Protection
HTTP response header and the
* header's value.
*
* For more information about the X-XSS-Protection
HTTP response header, see X-XSS-Protection in
* the MDN Web Docs.
*/
public void setXSSProtection(ResponseHeadersPolicyXSSProtection xSSProtection) {
this.xSSProtection = xSSProtection;
}
/**
*
* Determines whether CloudFront includes the X-XSS-Protection
HTTP response header and the header's
* value.
*
*
* For more information about the X-XSS-Protection
HTTP response header, see X-XSS-Protection in the MDN
* Web Docs.
*
*
* @return Determines whether CloudFront includes the X-XSS-Protection
HTTP response header and the
* header's value.
*
* For more information about the X-XSS-Protection
HTTP response header, see X-XSS-Protection in
* the MDN Web Docs.
*/
public ResponseHeadersPolicyXSSProtection getXSSProtection() {
return this.xSSProtection;
}
/**
*
* Determines whether CloudFront includes the X-XSS-Protection
HTTP response header and the header's
* value.
*
*
* For more information about the X-XSS-Protection
HTTP response header, see X-XSS-Protection in the MDN
* Web Docs.
*
*
* @param xSSProtection
* Determines whether CloudFront includes the X-XSS-Protection
HTTP response header and the
* header's value.
*
* For more information about the X-XSS-Protection
HTTP response header, see X-XSS-Protection in
* the MDN Web Docs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResponseHeadersPolicySecurityHeadersConfig withXSSProtection(ResponseHeadersPolicyXSSProtection xSSProtection) {
setXSSProtection(xSSProtection);
return this;
}
/**
*
* Determines whether CloudFront includes the X-Frame-Options
HTTP response header and the header's
* value.
*
*
* For more information about the X-Frame-Options
HTTP response header, see X-Frame-Options in the MDN
* Web Docs.
*
*
* @param frameOptions
* Determines whether CloudFront includes the X-Frame-Options
HTTP response header and the
* header's value.
*
* For more information about the X-Frame-Options
HTTP response header, see X-Frame-Options in
* the MDN Web Docs.
*/
public void setFrameOptions(ResponseHeadersPolicyFrameOptions frameOptions) {
this.frameOptions = frameOptions;
}
/**
*
* Determines whether CloudFront includes the X-Frame-Options
HTTP response header and the header's
* value.
*
*
* For more information about the X-Frame-Options
HTTP response header, see X-Frame-Options in the MDN
* Web Docs.
*
*
* @return Determines whether CloudFront includes the X-Frame-Options
HTTP response header and the
* header's value.
*
* For more information about the X-Frame-Options
HTTP response header, see X-Frame-Options in
* the MDN Web Docs.
*/
public ResponseHeadersPolicyFrameOptions getFrameOptions() {
return this.frameOptions;
}
/**
*
* Determines whether CloudFront includes the X-Frame-Options
HTTP response header and the header's
* value.
*
*
* For more information about the X-Frame-Options
HTTP response header, see X-Frame-Options in the MDN
* Web Docs.
*
*
* @param frameOptions
* Determines whether CloudFront includes the X-Frame-Options
HTTP response header and the
* header's value.
*
* For more information about the X-Frame-Options
HTTP response header, see X-Frame-Options in
* the MDN Web Docs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResponseHeadersPolicySecurityHeadersConfig withFrameOptions(ResponseHeadersPolicyFrameOptions frameOptions) {
setFrameOptions(frameOptions);
return this;
}
/**
*
* Determines whether CloudFront includes the Referrer-Policy
HTTP response header and the header's
* value.
*
*
* For more information about the Referrer-Policy
HTTP response header, see Referrer-Policy in the MDN
* Web Docs.
*
*
* @param referrerPolicy
* Determines whether CloudFront includes the Referrer-Policy
HTTP response header and the
* header's value.
*
* For more information about the Referrer-Policy
HTTP response header, see Referrer-Policy in
* the MDN Web Docs.
*/
public void setReferrerPolicy(ResponseHeadersPolicyReferrerPolicy referrerPolicy) {
this.referrerPolicy = referrerPolicy;
}
/**
*
* Determines whether CloudFront includes the Referrer-Policy
HTTP response header and the header's
* value.
*
*
* For more information about the Referrer-Policy
HTTP response header, see Referrer-Policy in the MDN
* Web Docs.
*
*
* @return Determines whether CloudFront includes the Referrer-Policy
HTTP response header and the
* header's value.
*
* For more information about the Referrer-Policy
HTTP response header, see Referrer-Policy in
* the MDN Web Docs.
*/
public ResponseHeadersPolicyReferrerPolicy getReferrerPolicy() {
return this.referrerPolicy;
}
/**
*
* Determines whether CloudFront includes the Referrer-Policy
HTTP response header and the header's
* value.
*
*
* For more information about the Referrer-Policy
HTTP response header, see Referrer-Policy in the MDN
* Web Docs.
*
*
* @param referrerPolicy
* Determines whether CloudFront includes the Referrer-Policy
HTTP response header and the
* header's value.
*
* For more information about the Referrer-Policy
HTTP response header, see Referrer-Policy in
* the MDN Web Docs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResponseHeadersPolicySecurityHeadersConfig withReferrerPolicy(ResponseHeadersPolicyReferrerPolicy referrerPolicy) {
setReferrerPolicy(referrerPolicy);
return this;
}
/**
*
* 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.
*
*
* @param contentSecurityPolicy
* 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.
*/
public void setContentSecurityPolicy(ResponseHeadersPolicyContentSecurityPolicy contentSecurityPolicy) {
this.contentSecurityPolicy = contentSecurityPolicy;
}
/**
*
* 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.
*
*
* @return 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.
*/
public ResponseHeadersPolicyContentSecurityPolicy getContentSecurityPolicy() {
return this.contentSecurityPolicy;
}
/**
*
* 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.
*
*
* @param contentSecurityPolicy
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResponseHeadersPolicySecurityHeadersConfig withContentSecurityPolicy(ResponseHeadersPolicyContentSecurityPolicy contentSecurityPolicy) {
setContentSecurityPolicy(contentSecurityPolicy);
return this;
}
/**
*
* Determines whether CloudFront includes the X-Content-Type-Options
HTTP response header with its
* value set to nosniff
.
*
*
* For more information about the X-Content-Type-Options
HTTP response header, see X-Content-Type-Options in the MDN Web Docs.
*
*
* @param contentTypeOptions
* Determines whether CloudFront includes the X-Content-Type-Options
HTTP response header with
* its value set to nosniff
.
*
* For more information about the X-Content-Type-Options
HTTP response header, see X-Content-Type-Options in the MDN Web Docs.
*/
public void setContentTypeOptions(ResponseHeadersPolicyContentTypeOptions contentTypeOptions) {
this.contentTypeOptions = contentTypeOptions;
}
/**
*
* Determines whether CloudFront includes the X-Content-Type-Options
HTTP response header with its
* value set to nosniff
.
*
*
* For more information about the X-Content-Type-Options
HTTP response header, see X-Content-Type-Options in the MDN Web Docs.
*
*
* @return Determines whether CloudFront includes the X-Content-Type-Options
HTTP response header with
* its value set to nosniff
.
*
* For more information about the X-Content-Type-Options
HTTP response header, see X-Content-Type-Options in the MDN Web Docs.
*/
public ResponseHeadersPolicyContentTypeOptions getContentTypeOptions() {
return this.contentTypeOptions;
}
/**
*
* Determines whether CloudFront includes the X-Content-Type-Options
HTTP response header with its
* value set to nosniff
.
*
*
* For more information about the X-Content-Type-Options
HTTP response header, see X-Content-Type-Options in the MDN Web Docs.
*
*
* @param contentTypeOptions
* Determines whether CloudFront includes the X-Content-Type-Options
HTTP response header with
* its value set to nosniff
.
*
* For more information about the X-Content-Type-Options
HTTP response header, see X-Content-Type-Options in the MDN Web Docs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResponseHeadersPolicySecurityHeadersConfig withContentTypeOptions(ResponseHeadersPolicyContentTypeOptions contentTypeOptions) {
setContentTypeOptions(contentTypeOptions);
return this;
}
/**
*
* Determines whether CloudFront includes the Strict-Transport-Security
HTTP response header and the
* header's value.
*
*
* For more information about the Strict-Transport-Security
HTTP response header, see Security headers in the Amazon CloudFront Developer Guide and Strict-Transport-Security in the MDN Web Docs.
*
*
* @param strictTransportSecurity
* Determines whether CloudFront includes the Strict-Transport-Security
HTTP response header and
* the header's value.
*
* For more information about the Strict-Transport-Security
HTTP response header, see Security headers in the Amazon CloudFront Developer Guide and Strict-Transport-Security in the MDN Web Docs.
*/
public void setStrictTransportSecurity(ResponseHeadersPolicyStrictTransportSecurity strictTransportSecurity) {
this.strictTransportSecurity = strictTransportSecurity;
}
/**
*
* Determines whether CloudFront includes the Strict-Transport-Security
HTTP response header and the
* header's value.
*
*
* For more information about the Strict-Transport-Security
HTTP response header, see Security headers in the Amazon CloudFront Developer Guide and Strict-Transport-Security in the MDN Web Docs.
*
*
* @return Determines whether CloudFront includes the Strict-Transport-Security
HTTP response header
* and the header's value.
*
* For more information about the Strict-Transport-Security
HTTP response header, see Security headers in the Amazon CloudFront Developer Guide and Strict-Transport-Security in the MDN Web Docs.
*/
public ResponseHeadersPolicyStrictTransportSecurity getStrictTransportSecurity() {
return this.strictTransportSecurity;
}
/**
*
* Determines whether CloudFront includes the Strict-Transport-Security
HTTP response header and the
* header's value.
*
*
* For more information about the Strict-Transport-Security
HTTP response header, see Security headers in the Amazon CloudFront Developer Guide and Strict-Transport-Security in the MDN Web Docs.
*
*
* @param strictTransportSecurity
* Determines whether CloudFront includes the Strict-Transport-Security
HTTP response header and
* the header's value.
*
* For more information about the Strict-Transport-Security
HTTP response header, see Security headers in the Amazon CloudFront Developer Guide and Strict-Transport-Security in the MDN Web Docs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResponseHeadersPolicySecurityHeadersConfig withStrictTransportSecurity(ResponseHeadersPolicyStrictTransportSecurity strictTransportSecurity) {
setStrictTransportSecurity(strictTransportSecurity);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getXSSProtection() != null)
sb.append("XSSProtection: ").append(getXSSProtection()).append(",");
if (getFrameOptions() != null)
sb.append("FrameOptions: ").append(getFrameOptions()).append(",");
if (getReferrerPolicy() != null)
sb.append("ReferrerPolicy: ").append(getReferrerPolicy()).append(",");
if (getContentSecurityPolicy() != null)
sb.append("ContentSecurityPolicy: ").append(getContentSecurityPolicy()).append(",");
if (getContentTypeOptions() != null)
sb.append("ContentTypeOptions: ").append(getContentTypeOptions()).append(",");
if (getStrictTransportSecurity() != null)
sb.append("StrictTransportSecurity: ").append(getStrictTransportSecurity());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ResponseHeadersPolicySecurityHeadersConfig == false)
return false;
ResponseHeadersPolicySecurityHeadersConfig other = (ResponseHeadersPolicySecurityHeadersConfig) obj;
if (other.getXSSProtection() == null ^ this.getXSSProtection() == null)
return false;
if (other.getXSSProtection() != null && other.getXSSProtection().equals(this.getXSSProtection()) == false)
return false;
if (other.getFrameOptions() == null ^ this.getFrameOptions() == null)
return false;
if (other.getFrameOptions() != null && other.getFrameOptions().equals(this.getFrameOptions()) == false)
return false;
if (other.getReferrerPolicy() == null ^ this.getReferrerPolicy() == null)
return false;
if (other.getReferrerPolicy() != null && other.getReferrerPolicy().equals(this.getReferrerPolicy()) == false)
return false;
if (other.getContentSecurityPolicy() == null ^ this.getContentSecurityPolicy() == null)
return false;
if (other.getContentSecurityPolicy() != null && other.getContentSecurityPolicy().equals(this.getContentSecurityPolicy()) == false)
return false;
if (other.getContentTypeOptions() == null ^ this.getContentTypeOptions() == null)
return false;
if (other.getContentTypeOptions() != null && other.getContentTypeOptions().equals(this.getContentTypeOptions()) == false)
return false;
if (other.getStrictTransportSecurity() == null ^ this.getStrictTransportSecurity() == null)
return false;
if (other.getStrictTransportSecurity() != null && other.getStrictTransportSecurity().equals(this.getStrictTransportSecurity()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getXSSProtection() == null) ? 0 : getXSSProtection().hashCode());
hashCode = prime * hashCode + ((getFrameOptions() == null) ? 0 : getFrameOptions().hashCode());
hashCode = prime * hashCode + ((getReferrerPolicy() == null) ? 0 : getReferrerPolicy().hashCode());
hashCode = prime * hashCode + ((getContentSecurityPolicy() == null) ? 0 : getContentSecurityPolicy().hashCode());
hashCode = prime * hashCode + ((getContentTypeOptions() == null) ? 0 : getContentTypeOptions().hashCode());
hashCode = prime * hashCode + ((getStrictTransportSecurity() == null) ? 0 : getStrictTransportSecurity().hashCode());
return hashCode;
}
@Override
public ResponseHeadersPolicySecurityHeadersConfig clone() {
try {
return (ResponseHeadersPolicySecurityHeadersConfig) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}