Class JwtRequirement

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

    public final class JwtRequirement
    extends com.google.protobuf.GeneratedMessageV3
    implements JwtRequirementOrBuilder
     This message specifies a Jwt requirement. An empty message means JWT verification is not
     required. Here are some config examples:
     .. code-block:: yaml
      # Example 1: not required with an empty message
      # Example 2: require A
      provider_name: provider-A
      # Example 3: require A or B
      requires_any:
        requirements:
          - provider_name: provider-A
          - provider_name: provider-B
      # Example 4: require A and B
      requires_all:
        requirements:
          - provider_name: provider-A
          - provider_name: provider-B
      # Example 5: require A and (B or C)
      requires_all:
        requirements:
          - provider_name: provider-A
          - requires_any:
            requirements:
              - provider_name: provider-B
              - provider_name: provider-C
      # Example 6: require A or (B and C)
      requires_any:
        requirements:
          - provider_name: provider-A
          - requires_all:
            requirements:
              - provider_name: provider-B
              - provider_name: provider-C
      # Example 7: A is optional (if token from A is provided, it must be valid, but also allows
      missing token.)
      requires_any:
        requirements:
        - provider_name: provider-A
        - allow_missing: {}
      # Example 8: A is optional and B is required.
      requires_all:
        requirements:
        - requires_any:
            requirements:
            - provider_name: provider-A
            - allow_missing: {}
        - provider_name: provider-B
     [#next-free-field: 7]
     
    Protobuf type envoy.extensions.filters.http.jwt_authn.v3.JwtRequirement
    See Also:
    Serialized Form
    • Field Detail

      • PROVIDER_NAME_FIELD_NUMBER

        public static final int PROVIDER_NAME_FIELD_NUMBER
        See Also:
        Constant Field Values
      • PROVIDER_AND_AUDIENCES_FIELD_NUMBER

        public static final int PROVIDER_AND_AUDIENCES_FIELD_NUMBER
        See Also:
        Constant Field Values
      • REQUIRES_ANY_FIELD_NUMBER

        public static final int REQUIRES_ANY_FIELD_NUMBER
        See Also:
        Constant Field Values
      • REQUIRES_ALL_FIELD_NUMBER

        public static final int REQUIRES_ALL_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ALLOW_MISSING_OR_FAILED_FIELD_NUMBER

        public static final int ALLOW_MISSING_OR_FAILED_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ALLOW_MISSING_FIELD_NUMBER

        public static final int ALLOW_MISSING_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
      • hasProviderName

        public boolean hasProviderName()
         Specify a required provider name.
         
        string provider_name = 1;
        Specified by:
        hasProviderName in interface JwtRequirementOrBuilder
        Returns:
        Whether the providerName field is set.
      • getProviderNameBytes

        public com.google.protobuf.ByteString getProviderNameBytes()
         Specify a required provider name.
         
        string provider_name = 1;
        Specified by:
        getProviderNameBytes in interface JwtRequirementOrBuilder
        Returns:
        The bytes for providerName.
      • hasProviderAndAudiences

        public boolean hasProviderAndAudiences()
         Specify a required provider with audiences.
         
        .envoy.extensions.filters.http.jwt_authn.v3.ProviderWithAudiences provider_and_audiences = 2;
        Specified by:
        hasProviderAndAudiences in interface JwtRequirementOrBuilder
        Returns:
        Whether the providerAndAudiences field is set.
      • hasRequiresAny

        public boolean hasRequiresAny()
         Specify list of JwtRequirement. Their results are OR-ed.
         If any one of them passes, the result is passed.
         
        .envoy.extensions.filters.http.jwt_authn.v3.JwtRequirementOrList requires_any = 3;
        Specified by:
        hasRequiresAny in interface JwtRequirementOrBuilder
        Returns:
        Whether the requiresAny field is set.
      • getRequiresAny

        public JwtRequirementOrList getRequiresAny()
         Specify list of JwtRequirement. Their results are OR-ed.
         If any one of them passes, the result is passed.
         
        .envoy.extensions.filters.http.jwt_authn.v3.JwtRequirementOrList requires_any = 3;
        Specified by:
        getRequiresAny in interface JwtRequirementOrBuilder
        Returns:
        The requiresAny.
      • hasRequiresAll

        public boolean hasRequiresAll()
         Specify list of JwtRequirement. Their results are AND-ed.
         All of them must pass, if one of them fails or missing, it fails.
         
        .envoy.extensions.filters.http.jwt_authn.v3.JwtRequirementAndList requires_all = 4;
        Specified by:
        hasRequiresAll in interface JwtRequirementOrBuilder
        Returns:
        Whether the requiresAll field is set.
      • getRequiresAll

        public JwtRequirementAndList getRequiresAll()
         Specify list of JwtRequirement. Their results are AND-ed.
         All of them must pass, if one of them fails or missing, it fails.
         
        .envoy.extensions.filters.http.jwt_authn.v3.JwtRequirementAndList requires_all = 4;
        Specified by:
        getRequiresAll in interface JwtRequirementOrBuilder
        Returns:
        The requiresAll.
      • hasAllowMissingOrFailed

        public boolean hasAllowMissingOrFailed()
         The requirement is always satisfied even if JWT is missing or the JWT
         verification fails. A typical usage is: this filter is used to only verify
         JWTs and pass the verified JWT payloads to another filter, the other filter
         will make decision. In this mode, all JWT tokens will be verified.
         
        .google.protobuf.Empty allow_missing_or_failed = 5;
        Specified by:
        hasAllowMissingOrFailed in interface JwtRequirementOrBuilder
        Returns:
        Whether the allowMissingOrFailed field is set.
      • getAllowMissingOrFailed

        public com.google.protobuf.Empty getAllowMissingOrFailed()
         The requirement is always satisfied even if JWT is missing or the JWT
         verification fails. A typical usage is: this filter is used to only verify
         JWTs and pass the verified JWT payloads to another filter, the other filter
         will make decision. In this mode, all JWT tokens will be verified.
         
        .google.protobuf.Empty allow_missing_or_failed = 5;
        Specified by:
        getAllowMissingOrFailed in interface JwtRequirementOrBuilder
        Returns:
        The allowMissingOrFailed.
      • getAllowMissingOrFailedOrBuilder

        public com.google.protobuf.EmptyOrBuilder getAllowMissingOrFailedOrBuilder()
         The requirement is always satisfied even if JWT is missing or the JWT
         verification fails. A typical usage is: this filter is used to only verify
         JWTs and pass the verified JWT payloads to another filter, the other filter
         will make decision. In this mode, all JWT tokens will be verified.
         
        .google.protobuf.Empty allow_missing_or_failed = 5;
        Specified by:
        getAllowMissingOrFailedOrBuilder in interface JwtRequirementOrBuilder
      • hasAllowMissing

        public boolean hasAllowMissing()
         The requirement is satisfied if JWT is missing, but failed if JWT is
         presented but invalid. Similar to allow_missing_or_failed, this is used
         to only verify JWTs and pass the verified payload to another filter. The
         different is this mode will reject requests with invalid tokens.
         
        .google.protobuf.Empty allow_missing = 6;
        Specified by:
        hasAllowMissing in interface JwtRequirementOrBuilder
        Returns:
        Whether the allowMissing field is set.
      • getAllowMissing

        public com.google.protobuf.Empty getAllowMissing()
         The requirement is satisfied if JWT is missing, but failed if JWT is
         presented but invalid. Similar to allow_missing_or_failed, this is used
         to only verify JWTs and pass the verified payload to another filter. The
         different is this mode will reject requests with invalid tokens.
         
        .google.protobuf.Empty allow_missing = 6;
        Specified by:
        getAllowMissing in interface JwtRequirementOrBuilder
        Returns:
        The allowMissing.
      • getAllowMissingOrBuilder

        public com.google.protobuf.EmptyOrBuilder getAllowMissingOrBuilder()
         The requirement is satisfied if JWT is missing, but failed if JWT is
         presented but invalid. Similar to allow_missing_or_failed, this is used
         to only verify JWTs and pass the verified payload to another filter. The
         different is this mode will reject requests with invalid tokens.
         
        .google.protobuf.Empty allow_missing = 6;
        Specified by:
        getAllowMissingOrBuilder in interface JwtRequirementOrBuilder
      • 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 JwtRequirement parseFrom​(ByteBuffer data)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

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

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

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

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

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

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

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

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

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

        public static JwtRequirement getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<JwtRequirement> parser()
      • getParserForType

        public com.google.protobuf.Parser<JwtRequirement> 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 JwtRequirement getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder