Class HeaderMutationRules

  • All Implemented Interfaces:
    com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, HeaderMutationRulesOrBuilder, Serializable

    public final class HeaderMutationRules
    extends com.google.protobuf.GeneratedMessageV3
    implements HeaderMutationRulesOrBuilder
     The HeaderMutationRules structure specifies what headers may be
     manipulated by a processing filter. This set of rules makes it
     possible to control which modifications a filter may make.
     By default, an external processing server may add, modify, or remove
     any header except for an "Envoy internal" header (which is typically
     denoted by an x-envoy prefix) or specific headers that may affect
     further filter processing:
     * ``host``
     * ``:authority``
     * ``:scheme``
     * ``:method``
     Every attempt to add, change, append, or remove a header will be
     tested against the rules here. Disallowed header mutations will be
     ignored unless ``disallow_is_error`` is set to true.
     Attempts to remove headers are further constrained -- regardless of the
     settings, system-defined headers (that start with ``:``) and the ``host``
     header may never be removed.
     In addition, a counter will be incremented whenever a mutation is
     rejected. In the ext_proc filter, that counter is named
     ``rejected_header_mutations``.
     [#next-free-field: 8]
     
    Protobuf type envoy.config.common.mutation_rules.v3.HeaderMutationRules
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  HeaderMutationRules.Builder
      The HeaderMutationRules structure specifies what headers may be manipulated by a processing filter.
      • Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3

        com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,​BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,​BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
      • Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

        com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
    • Field Detail

      • ALLOW_ALL_ROUTING_FIELD_NUMBER

        public static final int ALLOW_ALL_ROUTING_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ALLOW_ENVOY_FIELD_NUMBER

        public static final int ALLOW_ENVOY_FIELD_NUMBER
        See Also:
        Constant Field Values
      • DISALLOW_SYSTEM_FIELD_NUMBER

        public static final int DISALLOW_SYSTEM_FIELD_NUMBER
        See Also:
        Constant Field Values
      • DISALLOW_ALL_FIELD_NUMBER

        public static final int DISALLOW_ALL_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ALLOW_EXPRESSION_FIELD_NUMBER

        public static final int ALLOW_EXPRESSION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • DISALLOW_EXPRESSION_FIELD_NUMBER

        public static final int DISALLOW_EXPRESSION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • DISALLOW_IS_ERROR_FIELD_NUMBER

        public static final int DISALLOW_IS_ERROR_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getUnknownFields

        public final com.google.protobuf.UnknownFieldSet getUnknownFields()
        Specified by:
        getUnknownFields in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getUnknownFields in class com.google.protobuf.GeneratedMessageV3
      • 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
      • hasAllowAllRouting

        public boolean hasAllowAllRouting()
         By default, certain headers that could affect processing of subsequent
         filters or request routing cannot be modified. These headers are
         ``host``, ``:authority``, ``:scheme``, and ``:method``. Setting this parameter
         to true allows these headers to be modified as well.
         
        .google.protobuf.BoolValue allow_all_routing = 1;
        Specified by:
        hasAllowAllRouting in interface HeaderMutationRulesOrBuilder
        Returns:
        Whether the allowAllRouting field is set.
      • getAllowAllRouting

        public com.google.protobuf.BoolValue getAllowAllRouting()
         By default, certain headers that could affect processing of subsequent
         filters or request routing cannot be modified. These headers are
         ``host``, ``:authority``, ``:scheme``, and ``:method``. Setting this parameter
         to true allows these headers to be modified as well.
         
        .google.protobuf.BoolValue allow_all_routing = 1;
        Specified by:
        getAllowAllRouting in interface HeaderMutationRulesOrBuilder
        Returns:
        The allowAllRouting.
      • getAllowAllRoutingOrBuilder

        public com.google.protobuf.BoolValueOrBuilder getAllowAllRoutingOrBuilder()
         By default, certain headers that could affect processing of subsequent
         filters or request routing cannot be modified. These headers are
         ``host``, ``:authority``, ``:scheme``, and ``:method``. Setting this parameter
         to true allows these headers to be modified as well.
         
        .google.protobuf.BoolValue allow_all_routing = 1;
        Specified by:
        getAllowAllRoutingOrBuilder in interface HeaderMutationRulesOrBuilder
      • hasAllowEnvoy

        public boolean hasAllowEnvoy()
         If true, allow modification of envoy internal headers. By default, these
         start with ``x-envoy`` but this may be overridden in the ``Bootstrap``
         configuration using the
         :ref:`header_prefix <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.header_prefix>`
         field. Default is false.
         
        .google.protobuf.BoolValue allow_envoy = 2;
        Specified by:
        hasAllowEnvoy in interface HeaderMutationRulesOrBuilder
        Returns:
        Whether the allowEnvoy field is set.
      • getAllowEnvoy

        public com.google.protobuf.BoolValue getAllowEnvoy()
         If true, allow modification of envoy internal headers. By default, these
         start with ``x-envoy`` but this may be overridden in the ``Bootstrap``
         configuration using the
         :ref:`header_prefix <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.header_prefix>`
         field. Default is false.
         
        .google.protobuf.BoolValue allow_envoy = 2;
        Specified by:
        getAllowEnvoy in interface HeaderMutationRulesOrBuilder
        Returns:
        The allowEnvoy.
      • getAllowEnvoyOrBuilder

        public com.google.protobuf.BoolValueOrBuilder getAllowEnvoyOrBuilder()
         If true, allow modification of envoy internal headers. By default, these
         start with ``x-envoy`` but this may be overridden in the ``Bootstrap``
         configuration using the
         :ref:`header_prefix <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.header_prefix>`
         field. Default is false.
         
        .google.protobuf.BoolValue allow_envoy = 2;
        Specified by:
        getAllowEnvoyOrBuilder in interface HeaderMutationRulesOrBuilder
      • hasDisallowSystem

        public boolean hasDisallowSystem()
         If true, prevent modification of any system header, defined as a header
         that starts with a ``:`` character, regardless of any other settings.
         A processing server may still override the ``:status`` of an HTTP response
         using an ``ImmediateResponse`` message. Default is false.
         
        .google.protobuf.BoolValue disallow_system = 3;
        Specified by:
        hasDisallowSystem in interface HeaderMutationRulesOrBuilder
        Returns:
        Whether the disallowSystem field is set.
      • getDisallowSystem

        public com.google.protobuf.BoolValue getDisallowSystem()
         If true, prevent modification of any system header, defined as a header
         that starts with a ``:`` character, regardless of any other settings.
         A processing server may still override the ``:status`` of an HTTP response
         using an ``ImmediateResponse`` message. Default is false.
         
        .google.protobuf.BoolValue disallow_system = 3;
        Specified by:
        getDisallowSystem in interface HeaderMutationRulesOrBuilder
        Returns:
        The disallowSystem.
      • getDisallowSystemOrBuilder

        public com.google.protobuf.BoolValueOrBuilder getDisallowSystemOrBuilder()
         If true, prevent modification of any system header, defined as a header
         that starts with a ``:`` character, regardless of any other settings.
         A processing server may still override the ``:status`` of an HTTP response
         using an ``ImmediateResponse`` message. Default is false.
         
        .google.protobuf.BoolValue disallow_system = 3;
        Specified by:
        getDisallowSystemOrBuilder in interface HeaderMutationRulesOrBuilder
      • hasDisallowAll

        public boolean hasDisallowAll()
         If true, prevent modifications of all header values, regardless of any
         other settings. A processing server may still override the ``:status``
         of an HTTP response using an ``ImmediateResponse`` message. Default is false.
         
        .google.protobuf.BoolValue disallow_all = 4;
        Specified by:
        hasDisallowAll in interface HeaderMutationRulesOrBuilder
        Returns:
        Whether the disallowAll field is set.
      • getDisallowAll

        public com.google.protobuf.BoolValue getDisallowAll()
         If true, prevent modifications of all header values, regardless of any
         other settings. A processing server may still override the ``:status``
         of an HTTP response using an ``ImmediateResponse`` message. Default is false.
         
        .google.protobuf.BoolValue disallow_all = 4;
        Specified by:
        getDisallowAll in interface HeaderMutationRulesOrBuilder
        Returns:
        The disallowAll.
      • getDisallowAllOrBuilder

        public com.google.protobuf.BoolValueOrBuilder getDisallowAllOrBuilder()
         If true, prevent modifications of all header values, regardless of any
         other settings. A processing server may still override the ``:status``
         of an HTTP response using an ``ImmediateResponse`` message. Default is false.
         
        .google.protobuf.BoolValue disallow_all = 4;
        Specified by:
        getDisallowAllOrBuilder in interface HeaderMutationRulesOrBuilder
      • hasAllowExpression

        public boolean hasAllowExpression()
         If set, specifically allow any header that matches this regular
         expression. This overrides all other settings except for
         ``disallow_expression``.
         
        .envoy.type.matcher.v3.RegexMatcher allow_expression = 5;
        Specified by:
        hasAllowExpression in interface HeaderMutationRulesOrBuilder
        Returns:
        Whether the allowExpression field is set.
      • getAllowExpression

        public RegexMatcher getAllowExpression()
         If set, specifically allow any header that matches this regular
         expression. This overrides all other settings except for
         ``disallow_expression``.
         
        .envoy.type.matcher.v3.RegexMatcher allow_expression = 5;
        Specified by:
        getAllowExpression in interface HeaderMutationRulesOrBuilder
        Returns:
        The allowExpression.
      • getAllowExpressionOrBuilder

        public RegexMatcherOrBuilder getAllowExpressionOrBuilder()
         If set, specifically allow any header that matches this regular
         expression. This overrides all other settings except for
         ``disallow_expression``.
         
        .envoy.type.matcher.v3.RegexMatcher allow_expression = 5;
        Specified by:
        getAllowExpressionOrBuilder in interface HeaderMutationRulesOrBuilder
      • hasDisallowExpression

        public boolean hasDisallowExpression()
         If set, specifically disallow any header that matches this regular
         expression regardless of any other settings.
         
        .envoy.type.matcher.v3.RegexMatcher disallow_expression = 6;
        Specified by:
        hasDisallowExpression in interface HeaderMutationRulesOrBuilder
        Returns:
        Whether the disallowExpression field is set.
      • getDisallowExpression

        public RegexMatcher getDisallowExpression()
         If set, specifically disallow any header that matches this regular
         expression regardless of any other settings.
         
        .envoy.type.matcher.v3.RegexMatcher disallow_expression = 6;
        Specified by:
        getDisallowExpression in interface HeaderMutationRulesOrBuilder
        Returns:
        The disallowExpression.
      • hasDisallowIsError

        public boolean hasDisallowIsError()
         If true, and if the rules in this list cause a header mutation to be
         disallowed, then the filter using this configuration will terminate the
         request with a 500 error. In addition, regardless of the setting of this
         parameter, any attempt to set, add, or modify a disallowed header will
         cause the ``rejected_header_mutations`` counter to be incremented.
         Default is false.
         
        .google.protobuf.BoolValue disallow_is_error = 7;
        Specified by:
        hasDisallowIsError in interface HeaderMutationRulesOrBuilder
        Returns:
        Whether the disallowIsError field is set.
      • getDisallowIsError

        public com.google.protobuf.BoolValue getDisallowIsError()
         If true, and if the rules in this list cause a header mutation to be
         disallowed, then the filter using this configuration will terminate the
         request with a 500 error. In addition, regardless of the setting of this
         parameter, any attempt to set, add, or modify a disallowed header will
         cause the ``rejected_header_mutations`` counter to be incremented.
         Default is false.
         
        .google.protobuf.BoolValue disallow_is_error = 7;
        Specified by:
        getDisallowIsError in interface HeaderMutationRulesOrBuilder
        Returns:
        The disallowIsError.
      • getDisallowIsErrorOrBuilder

        public com.google.protobuf.BoolValueOrBuilder getDisallowIsErrorOrBuilder()
         If true, and if the rules in this list cause a header mutation to be
         disallowed, then the filter using this configuration will terminate the
         request with a 500 error. In addition, regardless of the setting of this
         parameter, any attempt to set, add, or modify a disallowed header will
         cause the ``rejected_header_mutations`` counter to be incremented.
         Default is false.
         
        .google.protobuf.BoolValue disallow_is_error = 7;
        Specified by:
        getDisallowIsErrorOrBuilder in interface HeaderMutationRulesOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static HeaderMutationRules parseFrom​(ByteBuffer data)
                                             throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HeaderMutationRules parseFrom​(ByteBuffer data,
                                                    com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                             throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HeaderMutationRules parseFrom​(com.google.protobuf.ByteString data)
                                             throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HeaderMutationRules parseFrom​(com.google.protobuf.ByteString data,
                                                    com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                             throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HeaderMutationRules parseFrom​(byte[] data)
                                             throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HeaderMutationRules parseFrom​(byte[] data,
                                                    com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                             throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HeaderMutationRules parseFrom​(com.google.protobuf.CodedInputStream input,
                                                    com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                             throws IOException
        Throws:
        IOException
      • newBuilderForType

        public HeaderMutationRules.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public HeaderMutationRules.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected HeaderMutationRules.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<HeaderMutationRules> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public HeaderMutationRules getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder