Class HeaderValidatorConfig.Builder

  • All Implemented Interfaces:
    com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, HeaderValidatorConfigOrBuilder, Cloneable
    Enclosing class:
    HeaderValidatorConfig

    public static final class HeaderValidatorConfig.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<HeaderValidatorConfig.Builder>
    implements HeaderValidatorConfigOrBuilder
     This extension validates that HTTP request and response headers are well formed according to respective RFCs.
     #. HTTP/1 header map validity according to `RFC 7230 section 3.2 <https://datatracker.ietf.org/doc/html/rfc7230#section-3.2>`_
     #. Syntax of HTTP/1 request target URI and response status
     #. HTTP/2 header map validity according to `RFC 7540 section 8.1.2 <https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2>`_
     #. Syntax of HTTP/2 pseudo headers
     #. HTTP/3 header map validity according to `RFC 9114 section 4.3  <https://www.rfc-editor.org/rfc/rfc9114.html>`_
     #. Syntax of HTTP/3 pseudo headers
     #. Syntax of Content-Length and Transfer-Encoding
     #. Validation of HTTP/1 requests with both ``Content-Length`` and ``Transfer-Encoding`` headers
     #. Normalization of the URI path according to `Normalization and Comparison <https://datatracker.ietf.org/doc/html/rfc3986#section-6>`_
        without `case normalization <https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2.1>`_
     
    Protobuf type envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<HeaderValidatorConfig.Builder>
      • clear

        public HeaderValidatorConfig.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<HeaderValidatorConfig.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<HeaderValidatorConfig.Builder>
      • getDefaultInstanceForType

        public HeaderValidatorConfig getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public HeaderValidatorConfig build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public HeaderValidatorConfig buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public HeaderValidatorConfig.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<HeaderValidatorConfig.Builder>
      • clearField

        public HeaderValidatorConfig.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<HeaderValidatorConfig.Builder>
      • clearOneof

        public HeaderValidatorConfig.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<HeaderValidatorConfig.Builder>
      • setRepeatedField

        public HeaderValidatorConfig.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                              int index,
                                                              Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<HeaderValidatorConfig.Builder>
      • addRepeatedField

        public HeaderValidatorConfig.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                              Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<HeaderValidatorConfig.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<HeaderValidatorConfig.Builder>
      • mergeFrom

        public HeaderValidatorConfig.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                                       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<HeaderValidatorConfig.Builder>
        Throws:
        IOException
      • hasHttp1ProtocolOptions

        public boolean hasHttp1ProtocolOptions()
        .envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.Http1ProtocolOptions http1_protocol_options = 1;
        Specified by:
        hasHttp1ProtocolOptions in interface HeaderValidatorConfigOrBuilder
        Returns:
        Whether the http1ProtocolOptions field is set.
      • clearHttp1ProtocolOptions

        public HeaderValidatorConfig.Builder clearHttp1ProtocolOptions()
        .envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.Http1ProtocolOptions http1_protocol_options = 1;
      • getHttp1ProtocolOptionsBuilder

        public HeaderValidatorConfig.Http1ProtocolOptions.Builder getHttp1ProtocolOptionsBuilder()
        .envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.Http1ProtocolOptions http1_protocol_options = 1;
      • hasUriPathNormalizationOptions

        public boolean hasUriPathNormalizationOptions()
         The URI path normalization options.
         By default Envoy normalizes URI path using the default values of the :ref:`UriPathNormalizationOptions
         <envoy_v3_api_msg_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions>`.
         URI path transformations specified by the ``uri_path_normalization_options`` configuration can be applied to a portion
         of requests by setting the ``envoy_default_header_validator.uri_path_transformations`` runtime value.
         Caution: disabling path normalization may lead to path confusion vulnerabilities in access control or incorrect service
         selection.
         
        .envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions uri_path_normalization_options = 2;
        Specified by:
        hasUriPathNormalizationOptions in interface HeaderValidatorConfigOrBuilder
        Returns:
        Whether the uriPathNormalizationOptions field is set.
      • getUriPathNormalizationOptions

        public HeaderValidatorConfig.UriPathNormalizationOptions getUriPathNormalizationOptions()
         The URI path normalization options.
         By default Envoy normalizes URI path using the default values of the :ref:`UriPathNormalizationOptions
         <envoy_v3_api_msg_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions>`.
         URI path transformations specified by the ``uri_path_normalization_options`` configuration can be applied to a portion
         of requests by setting the ``envoy_default_header_validator.uri_path_transformations`` runtime value.
         Caution: disabling path normalization may lead to path confusion vulnerabilities in access control or incorrect service
         selection.
         
        .envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions uri_path_normalization_options = 2;
        Specified by:
        getUriPathNormalizationOptions in interface HeaderValidatorConfigOrBuilder
        Returns:
        The uriPathNormalizationOptions.
      • setUriPathNormalizationOptions

        public HeaderValidatorConfig.Builder setUriPathNormalizationOptions​(HeaderValidatorConfig.UriPathNormalizationOptions value)
         The URI path normalization options.
         By default Envoy normalizes URI path using the default values of the :ref:`UriPathNormalizationOptions
         <envoy_v3_api_msg_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions>`.
         URI path transformations specified by the ``uri_path_normalization_options`` configuration can be applied to a portion
         of requests by setting the ``envoy_default_header_validator.uri_path_transformations`` runtime value.
         Caution: disabling path normalization may lead to path confusion vulnerabilities in access control or incorrect service
         selection.
         
        .envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions uri_path_normalization_options = 2;
      • setUriPathNormalizationOptions

        public HeaderValidatorConfig.Builder setUriPathNormalizationOptions​(HeaderValidatorConfig.UriPathNormalizationOptions.Builder builderForValue)
         The URI path normalization options.
         By default Envoy normalizes URI path using the default values of the :ref:`UriPathNormalizationOptions
         <envoy_v3_api_msg_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions>`.
         URI path transformations specified by the ``uri_path_normalization_options`` configuration can be applied to a portion
         of requests by setting the ``envoy_default_header_validator.uri_path_transformations`` runtime value.
         Caution: disabling path normalization may lead to path confusion vulnerabilities in access control or incorrect service
         selection.
         
        .envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions uri_path_normalization_options = 2;
      • mergeUriPathNormalizationOptions

        public HeaderValidatorConfig.Builder mergeUriPathNormalizationOptions​(HeaderValidatorConfig.UriPathNormalizationOptions value)
         The URI path normalization options.
         By default Envoy normalizes URI path using the default values of the :ref:`UriPathNormalizationOptions
         <envoy_v3_api_msg_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions>`.
         URI path transformations specified by the ``uri_path_normalization_options`` configuration can be applied to a portion
         of requests by setting the ``envoy_default_header_validator.uri_path_transformations`` runtime value.
         Caution: disabling path normalization may lead to path confusion vulnerabilities in access control or incorrect service
         selection.
         
        .envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions uri_path_normalization_options = 2;
      • clearUriPathNormalizationOptions

        public HeaderValidatorConfig.Builder clearUriPathNormalizationOptions()
         The URI path normalization options.
         By default Envoy normalizes URI path using the default values of the :ref:`UriPathNormalizationOptions
         <envoy_v3_api_msg_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions>`.
         URI path transformations specified by the ``uri_path_normalization_options`` configuration can be applied to a portion
         of requests by setting the ``envoy_default_header_validator.uri_path_transformations`` runtime value.
         Caution: disabling path normalization may lead to path confusion vulnerabilities in access control or incorrect service
         selection.
         
        .envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions uri_path_normalization_options = 2;
      • getUriPathNormalizationOptionsBuilder

        public HeaderValidatorConfig.UriPathNormalizationOptions.Builder getUriPathNormalizationOptionsBuilder()
         The URI path normalization options.
         By default Envoy normalizes URI path using the default values of the :ref:`UriPathNormalizationOptions
         <envoy_v3_api_msg_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions>`.
         URI path transformations specified by the ``uri_path_normalization_options`` configuration can be applied to a portion
         of requests by setting the ``envoy_default_header_validator.uri_path_transformations`` runtime value.
         Caution: disabling path normalization may lead to path confusion vulnerabilities in access control or incorrect service
         selection.
         
        .envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions uri_path_normalization_options = 2;
      • getUriPathNormalizationOptionsOrBuilder

        public HeaderValidatorConfig.UriPathNormalizationOptionsOrBuilder getUriPathNormalizationOptionsOrBuilder()
         The URI path normalization options.
         By default Envoy normalizes URI path using the default values of the :ref:`UriPathNormalizationOptions
         <envoy_v3_api_msg_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions>`.
         URI path transformations specified by the ``uri_path_normalization_options`` configuration can be applied to a portion
         of requests by setting the ``envoy_default_header_validator.uri_path_transformations`` runtime value.
         Caution: disabling path normalization may lead to path confusion vulnerabilities in access control or incorrect service
         selection.
         
        .envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions uri_path_normalization_options = 2;
        Specified by:
        getUriPathNormalizationOptionsOrBuilder in interface HeaderValidatorConfigOrBuilder
      • getRestrictHttpMethods

        public boolean getRestrictHttpMethods()
         Restrict HTTP methods to these defined in the `RFC 7231 section 4.1 <https://datatracker.ietf.org/doc/html/rfc7231#section-4.1>`_
         Envoy will respond with 400 to requests with disallowed methods.
         By default methods with arbitrary names are accepted.
         
        bool restrict_http_methods = 3;
        Specified by:
        getRestrictHttpMethods in interface HeaderValidatorConfigOrBuilder
        Returns:
        The restrictHttpMethods.
      • setRestrictHttpMethods

        public HeaderValidatorConfig.Builder setRestrictHttpMethods​(boolean value)
         Restrict HTTP methods to these defined in the `RFC 7231 section 4.1 <https://datatracker.ietf.org/doc/html/rfc7231#section-4.1>`_
         Envoy will respond with 400 to requests with disallowed methods.
         By default methods with arbitrary names are accepted.
         
        bool restrict_http_methods = 3;
        Parameters:
        value - The restrictHttpMethods to set.
        Returns:
        This builder for chaining.
      • clearRestrictHttpMethods

        public HeaderValidatorConfig.Builder clearRestrictHttpMethods()
         Restrict HTTP methods to these defined in the `RFC 7231 section 4.1 <https://datatracker.ietf.org/doc/html/rfc7231#section-4.1>`_
         Envoy will respond with 400 to requests with disallowed methods.
         By default methods with arbitrary names are accepted.
         
        bool restrict_http_methods = 3;
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final HeaderValidatorConfig.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<HeaderValidatorConfig.Builder>
      • mergeUnknownFields

        public final HeaderValidatorConfig.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<HeaderValidatorConfig.Builder>