类 VirtualServiceOuterClass.CorsPolicy

  • 所有已实现的接口:
    com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, VirtualServiceOuterClass.CorsPolicyOrBuilder, java.io.Serializable
    封闭类:
    VirtualServiceOuterClass

    public static final class VirtualServiceOuterClass.CorsPolicy
    extends com.google.protobuf.GeneratedMessageV3
    implements VirtualServiceOuterClass.CorsPolicyOrBuilder
     Describes the Cross-Origin Resource Sharing (CORS) policy, for a given
     service. Refer to [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS)
     for further details about cross origin resource sharing. For example,
     the following rule restricts cross origin requests to those originating
     from example.com domain using HTTP POST/GET, and sets the
     `Access-Control-Allow-Credentials` header to false. In addition, it only
     exposes `X-Foo-bar` header and sets an expiry period of 1 day.
     {{<tabset category-name="example">}}
     {{<tab name="v1alpha3" category-value="v1alpha3">}}
     ```yaml
     apiVersion: networking.istio.io/v1alpha3
     kind: VirtualService
     metadata:
       name: ratings-route
     spec:
       hosts:
       - ratings.prod.svc.cluster.local
       http:
       - route:
         - destination:
             host: ratings.prod.svc.cluster.local
             subset: v1
         corsPolicy:
           allowOrigins:
           - exact: https://example.com
           allowMethods:
           - POST
           - GET
           allowCredentials: false
           allowHeaders:
           - X-Foo-Bar
           maxAge: "24h"
     ```
     {{</tab>}}
     {{<tab name="v1beta1" category-value="v1beta1">}}
     ```yaml
     apiVersion: networking.istio.io/v1beta1
     kind: VirtualService
     metadata:
       name: ratings-route
     spec:
       hosts:
       - ratings.prod.svc.cluster.local
       http:
       - route:
         - destination:
             host: ratings.prod.svc.cluster.local
             subset: v1
         corsPolicy:
           allowOrigins:
           - exact: https://example.com
           allowMethods:
           - POST
           - GET
           allowCredentials: false
           allowHeaders:
           - X-Foo-Bar
           maxAge: "24h"
     ```
     {{</tab>}}
     {{</tabset>}}
     
    Protobuf type istio.networking.v1alpha3.CorsPolicy
    另请参阅:
    序列化表格
    • 字段详细资料

      • serialVersionUID

        private static final long serialVersionUID
        另请参阅:
        常量字段值
      • ALLOW_ORIGIN_FIELD_NUMBER

        public static final int ALLOW_ORIGIN_FIELD_NUMBER
        另请参阅:
        常量字段值
      • allowOrigin_

        private com.google.protobuf.LazyStringList allowOrigin_
      • ALLOW_ORIGINS_FIELD_NUMBER

        public static final int ALLOW_ORIGINS_FIELD_NUMBER
        另请参阅:
        常量字段值
      • ALLOW_METHODS_FIELD_NUMBER

        public static final int ALLOW_METHODS_FIELD_NUMBER
        另请参阅:
        常量字段值
      • allowMethods_

        private com.google.protobuf.LazyStringList allowMethods_
      • ALLOW_HEADERS_FIELD_NUMBER

        public static final int ALLOW_HEADERS_FIELD_NUMBER
        另请参阅:
        常量字段值
      • allowHeaders_

        private com.google.protobuf.LazyStringList allowHeaders_
      • EXPOSE_HEADERS_FIELD_NUMBER

        public static final int EXPOSE_HEADERS_FIELD_NUMBER
        另请参阅:
        常量字段值
      • exposeHeaders_

        private com.google.protobuf.LazyStringList exposeHeaders_
      • MAX_AGE_FIELD_NUMBER

        public static final int MAX_AGE_FIELD_NUMBER
        另请参阅:
        常量字段值
      • maxAge_

        private com.google.protobuf.Duration maxAge_
      • ALLOW_CREDENTIALS_FIELD_NUMBER

        public static final int ALLOW_CREDENTIALS_FIELD_NUMBER
        另请参阅:
        常量字段值
      • allowCredentials_

        private com.google.protobuf.BoolValue allowCredentials_
      • memoizedIsInitialized

        private byte memoizedIsInitialized
    • 构造器详细资料

      • CorsPolicy

        private CorsPolicy​(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)
      • CorsPolicy

        private CorsPolicy()
    • 方法详细资料

      • newInstance

        protected java.lang.Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        覆盖:
        newInstance 在类中 com.google.protobuf.GeneratedMessageV3
      • getUnknownFields

        public final com.google.protobuf.UnknownFieldSet getUnknownFields()
        指定者:
        getUnknownFields 在接口中 com.google.protobuf.MessageOrBuilder
        覆盖:
        getUnknownFields 在类中 com.google.protobuf.GeneratedMessageV3
      • getDescriptor

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

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        指定者:
        internalGetFieldAccessorTable 在类中 com.google.protobuf.GeneratedMessageV3
      • getAllowOriginList

        @Deprecated
        public com.google.protobuf.ProtocolStringList getAllowOriginList()
        已过时。
        istio.networking.v1alpha3.CorsPolicy.allow_origin is deprecated. See networking/v1alpha3/virtual_service.proto;l=1632
         The list of origins that are allowed to perform CORS requests. The
         content will be serialized into the Access-Control-Allow-Origin
         header. Wildcard * will allow all origins.
         $hide_from_docs
         
        repeated string allow_origin = 1 [deprecated = true];
        指定者:
        getAllowOriginList 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        返回:
        A list containing the allowOrigin.
      • getAllowOriginCount

        @Deprecated
        public int getAllowOriginCount()
        已过时。
        istio.networking.v1alpha3.CorsPolicy.allow_origin is deprecated. See networking/v1alpha3/virtual_service.proto;l=1632
         The list of origins that are allowed to perform CORS requests. The
         content will be serialized into the Access-Control-Allow-Origin
         header. Wildcard * will allow all origins.
         $hide_from_docs
         
        repeated string allow_origin = 1 [deprecated = true];
        指定者:
        getAllowOriginCount 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        返回:
        The count of allowOrigin.
      • getAllowOrigin

        @Deprecated
        public java.lang.String getAllowOrigin​(int index)
        已过时。
        istio.networking.v1alpha3.CorsPolicy.allow_origin is deprecated. See networking/v1alpha3/virtual_service.proto;l=1632
         The list of origins that are allowed to perform CORS requests. The
         content will be serialized into the Access-Control-Allow-Origin
         header. Wildcard * will allow all origins.
         $hide_from_docs
         
        repeated string allow_origin = 1 [deprecated = true];
        指定者:
        getAllowOrigin 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        参数:
        index - The index of the element to return.
        返回:
        The allowOrigin at the given index.
      • getAllowOriginBytes

        @Deprecated
        public com.google.protobuf.ByteString getAllowOriginBytes​(int index)
        已过时。
        istio.networking.v1alpha3.CorsPolicy.allow_origin is deprecated. See networking/v1alpha3/virtual_service.proto;l=1632
         The list of origins that are allowed to perform CORS requests. The
         content will be serialized into the Access-Control-Allow-Origin
         header. Wildcard * will allow all origins.
         $hide_from_docs
         
        repeated string allow_origin = 1 [deprecated = true];
        指定者:
        getAllowOriginBytes 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        参数:
        index - The index of the value to return.
        返回:
        The bytes of the allowOrigin at the given index.
      • getAllowOriginsCount

        public int getAllowOriginsCount()
         String patterns that match allowed origins.
         An origin is allowed if any of the string matchers match.
         If a match is found, then the outgoing Access-Control-Allow-Origin would be set to the origin as provided by the client.
         
        repeated .istio.networking.v1alpha3.StringMatch allow_origins = 7;
        指定者:
        getAllowOriginsCount 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
      • getAllowMethodsList

        public com.google.protobuf.ProtocolStringList getAllowMethodsList()
         List of HTTP methods allowed to access the resource. The content will
         be serialized into the Access-Control-Allow-Methods header.
         
        repeated string allow_methods = 2;
        指定者:
        getAllowMethodsList 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        返回:
        A list containing the allowMethods.
      • getAllowMethodsCount

        public int getAllowMethodsCount()
         List of HTTP methods allowed to access the resource. The content will
         be serialized into the Access-Control-Allow-Methods header.
         
        repeated string allow_methods = 2;
        指定者:
        getAllowMethodsCount 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        返回:
        The count of allowMethods.
      • getAllowMethods

        public java.lang.String getAllowMethods​(int index)
         List of HTTP methods allowed to access the resource. The content will
         be serialized into the Access-Control-Allow-Methods header.
         
        repeated string allow_methods = 2;
        指定者:
        getAllowMethods 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        参数:
        index - The index of the element to return.
        返回:
        The allowMethods at the given index.
      • getAllowMethodsBytes

        public com.google.protobuf.ByteString getAllowMethodsBytes​(int index)
         List of HTTP methods allowed to access the resource. The content will
         be serialized into the Access-Control-Allow-Methods header.
         
        repeated string allow_methods = 2;
        指定者:
        getAllowMethodsBytes 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        参数:
        index - The index of the value to return.
        返回:
        The bytes of the allowMethods at the given index.
      • getAllowHeadersList

        public com.google.protobuf.ProtocolStringList getAllowHeadersList()
         List of HTTP headers that can be used when requesting the
         resource. Serialized to Access-Control-Allow-Headers header.
         
        repeated string allow_headers = 3;
        指定者:
        getAllowHeadersList 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        返回:
        A list containing the allowHeaders.
      • getAllowHeadersCount

        public int getAllowHeadersCount()
         List of HTTP headers that can be used when requesting the
         resource. Serialized to Access-Control-Allow-Headers header.
         
        repeated string allow_headers = 3;
        指定者:
        getAllowHeadersCount 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        返回:
        The count of allowHeaders.
      • getAllowHeaders

        public java.lang.String getAllowHeaders​(int index)
         List of HTTP headers that can be used when requesting the
         resource. Serialized to Access-Control-Allow-Headers header.
         
        repeated string allow_headers = 3;
        指定者:
        getAllowHeaders 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        参数:
        index - The index of the element to return.
        返回:
        The allowHeaders at the given index.
      • getAllowHeadersBytes

        public com.google.protobuf.ByteString getAllowHeadersBytes​(int index)
         List of HTTP headers that can be used when requesting the
         resource. Serialized to Access-Control-Allow-Headers header.
         
        repeated string allow_headers = 3;
        指定者:
        getAllowHeadersBytes 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        参数:
        index - The index of the value to return.
        返回:
        The bytes of the allowHeaders at the given index.
      • getExposeHeadersList

        public com.google.protobuf.ProtocolStringList getExposeHeadersList()
         A list of HTTP headers that the browsers are allowed to
         access. Serialized into Access-Control-Expose-Headers header.
         
        repeated string expose_headers = 4;
        指定者:
        getExposeHeadersList 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        返回:
        A list containing the exposeHeaders.
      • getExposeHeadersCount

        public int getExposeHeadersCount()
         A list of HTTP headers that the browsers are allowed to
         access. Serialized into Access-Control-Expose-Headers header.
         
        repeated string expose_headers = 4;
        指定者:
        getExposeHeadersCount 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        返回:
        The count of exposeHeaders.
      • getExposeHeaders

        public java.lang.String getExposeHeaders​(int index)
         A list of HTTP headers that the browsers are allowed to
         access. Serialized into Access-Control-Expose-Headers header.
         
        repeated string expose_headers = 4;
        指定者:
        getExposeHeaders 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        参数:
        index - The index of the element to return.
        返回:
        The exposeHeaders at the given index.
      • getExposeHeadersBytes

        public com.google.protobuf.ByteString getExposeHeadersBytes​(int index)
         A list of HTTP headers that the browsers are allowed to
         access. Serialized into Access-Control-Expose-Headers header.
         
        repeated string expose_headers = 4;
        指定者:
        getExposeHeadersBytes 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        参数:
        index - The index of the value to return.
        返回:
        The bytes of the exposeHeaders at the given index.
      • hasMaxAge

        public boolean hasMaxAge()
         Specifies how long the results of a preflight request can be
         cached. Translates to the `Access-Control-Max-Age` header.
         
        .google.protobuf.Duration max_age = 5;
        指定者:
        hasMaxAge 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        返回:
        Whether the maxAge field is set.
      • getMaxAge

        public com.google.protobuf.Duration getMaxAge()
         Specifies how long the results of a preflight request can be
         cached. Translates to the `Access-Control-Max-Age` header.
         
        .google.protobuf.Duration max_age = 5;
        指定者:
        getMaxAge 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        返回:
        The maxAge.
      • getMaxAgeOrBuilder

        public com.google.protobuf.DurationOrBuilder getMaxAgeOrBuilder()
         Specifies how long the results of a preflight request can be
         cached. Translates to the `Access-Control-Max-Age` header.
         
        .google.protobuf.Duration max_age = 5;
        指定者:
        getMaxAgeOrBuilder 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
      • hasAllowCredentials

        public boolean hasAllowCredentials()
         Indicates whether the caller is allowed to send the actual request
         (not the preflight) using credentials. Translates to
         `Access-Control-Allow-Credentials` header.
         
        .google.protobuf.BoolValue allow_credentials = 6;
        指定者:
        hasAllowCredentials 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        返回:
        Whether the allowCredentials field is set.
      • getAllowCredentials

        public com.google.protobuf.BoolValue getAllowCredentials()
         Indicates whether the caller is allowed to send the actual request
         (not the preflight) using credentials. Translates to
         `Access-Control-Allow-Credentials` header.
         
        .google.protobuf.BoolValue allow_credentials = 6;
        指定者:
        getAllowCredentials 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
        返回:
        The allowCredentials.
      • getAllowCredentialsOrBuilder

        public com.google.protobuf.BoolValueOrBuilder getAllowCredentialsOrBuilder()
         Indicates whether the caller is allowed to send the actual request
         (not the preflight) using credentials. Translates to
         `Access-Control-Allow-Credentials` header.
         
        .google.protobuf.BoolValue allow_credentials = 6;
        指定者:
        getAllowCredentialsOrBuilder 在接口中 VirtualServiceOuterClass.CorsPolicyOrBuilder
      • isInitialized

        public final boolean isInitialized()
        指定者:
        isInitialized 在接口中 com.google.protobuf.MessageLiteOrBuilder
        覆盖:
        isInitialized 在类中 com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws java.io.IOException
        指定者:
        writeTo 在接口中 com.google.protobuf.MessageLite
        覆盖:
        writeTo 在类中 com.google.protobuf.GeneratedMessageV3
        抛出:
        java.io.IOException
      • getSerializedSize

        public int getSerializedSize()
        指定者:
        getSerializedSize 在接口中 com.google.protobuf.MessageLite
        覆盖:
        getSerializedSize 在类中 com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(java.lang.Object obj)
        指定者:
        equals 在接口中 com.google.protobuf.Message
        覆盖:
        equals 在类中 com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        指定者:
        hashCode 在接口中 com.google.protobuf.Message
        覆盖:
        hashCode 在类中 com.google.protobuf.AbstractMessage
      • parseFrom

        public static VirtualServiceOuterClass.CorsPolicy parseFrom​(java.nio.ByteBuffer data)
                                                             throws com.google.protobuf.InvalidProtocolBufferException
        抛出:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static VirtualServiceOuterClass.CorsPolicy parseFrom​(java.nio.ByteBuffer data,
                                                                    com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                             throws com.google.protobuf.InvalidProtocolBufferException
        抛出:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static VirtualServiceOuterClass.CorsPolicy parseFrom​(com.google.protobuf.ByteString data)
                                                             throws com.google.protobuf.InvalidProtocolBufferException
        抛出:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static VirtualServiceOuterClass.CorsPolicy parseFrom​(com.google.protobuf.ByteString data,
                                                                    com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                             throws com.google.protobuf.InvalidProtocolBufferException
        抛出:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static VirtualServiceOuterClass.CorsPolicy parseFrom​(byte[] data)
                                                             throws com.google.protobuf.InvalidProtocolBufferException
        抛出:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static VirtualServiceOuterClass.CorsPolicy parseFrom​(byte[] data,
                                                                    com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                             throws com.google.protobuf.InvalidProtocolBufferException
        抛出:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static VirtualServiceOuterClass.CorsPolicy parseFrom​(java.io.InputStream input,
                                                                    com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                             throws java.io.IOException
        抛出:
        java.io.IOException
      • parseDelimitedFrom

        public static VirtualServiceOuterClass.CorsPolicy parseDelimitedFrom​(java.io.InputStream input)
                                                                      throws java.io.IOException
        抛出:
        java.io.IOException
      • parseDelimitedFrom

        public static VirtualServiceOuterClass.CorsPolicy parseDelimitedFrom​(java.io.InputStream input,
                                                                             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                      throws java.io.IOException
        抛出:
        java.io.IOException
      • parseFrom

        public static VirtualServiceOuterClass.CorsPolicy parseFrom​(com.google.protobuf.CodedInputStream input)
                                                             throws java.io.IOException
        抛出:
        java.io.IOException
      • parseFrom

        public static VirtualServiceOuterClass.CorsPolicy parseFrom​(com.google.protobuf.CodedInputStream input,
                                                                    com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                             throws java.io.IOException
        抛出:
        java.io.IOException
      • newBuilderForType

        public VirtualServiceOuterClass.CorsPolicy.Builder newBuilderForType()
        指定者:
        newBuilderForType 在接口中 com.google.protobuf.Message
        指定者:
        newBuilderForType 在接口中 com.google.protobuf.MessageLite
      • newBuilderForType

        protected VirtualServiceOuterClass.CorsPolicy.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        指定者:
        newBuilderForType 在类中 com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<VirtualServiceOuterClass.CorsPolicy> getParserForType()
        指定者:
        getParserForType 在接口中 com.google.protobuf.Message
        指定者:
        getParserForType 在接口中 com.google.protobuf.MessageLite
        覆盖:
        getParserForType 在类中 com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public VirtualServiceOuterClass.CorsPolicy getDefaultInstanceForType()
        指定者:
        getDefaultInstanceForType 在接口中 com.google.protobuf.MessageLiteOrBuilder
        指定者:
        getDefaultInstanceForType 在接口中 com.google.protobuf.MessageOrBuilder