Available security level settings.
This enforces security protocol on function URL.
Security level is only ocnfigurable for 1st Gen functions, If unspecified,
SECURE_OPTIONAL will be used. 2nd Gen functions are SECURE_ALWAYS ONLY.
Requests for a URL that match this handler that do not use HTTPS are
automatically redirected to the HTTPS URL with the same path. Query
parameters are reserved for the redirect.
SECURE_ALWAYS = 1;
SECURE_ALWAYS_VALUE
Requests for a URL that match this handler that do not use HTTPS are
automatically redirected to the HTTPS URL with the same path. Query
parameters are reserved for the redirect.
SECURE_ALWAYS = 1;
SECURE_OPTIONAL
Both HTTP and HTTPS requests with URLs that match the handler succeed
without redirects. The application can examine the request to determine
which protocol was used and respond accordingly.
SECURE_OPTIONAL = 2;
SECURE_OPTIONAL_VALUE
Both HTTP and HTTPS requests with URLs that match the handler succeed
without redirects. The application can examine the request to determine
which protocol was used and respond accordingly.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Enum ServiceConfig.SecurityLevel (0.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.16.0 (latest)](/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.functions.v2.ServiceConfig.SecurityLevel)\n- [0.15.0](/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.functions.v2.ServiceConfig.SecurityLevel)\n- [0.14.1](/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.functions.v2.ServiceConfig.SecurityLevel) \n\n public enum ServiceConfig.SecurityLevel extends Enum\u003cServiceConfig.SecurityLevel\u003e implements ProtocolMessageEnum\n\nAvailable security level settings.\nThis enforces security protocol on function URL.\nSecurity level is only ocnfigurable for 1st Gen functions, If unspecified,\nSECURE_OPTIONAL will be used. 2nd Gen functions are SECURE_ALWAYS ONLY.\n\nProtobuf enum `google.events.cloud.functions.v2.ServiceConfig.SecurityLevel` \n\nImplements\n----------\n\n[ProtocolMessageEnum](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ProtocolMessageEnum.html) \n\nInherited Members\n-----------------\n\n[Enum.\\\u003cT\\\u003evalueOf(Class\\\u003cT\\\u003e,String)](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#valueOf-java.lang.Class-java.lang.String-) \n[Enum.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#clone--) \n[Enum.compareTo(E)](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo-E-) \n[Enum.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#equals-java.lang.Object-) \n[Enum.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#finalize--) \n[Enum.getDeclaringClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getDeclaringClass--) \n[Enum.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#hashCode--) \n[Enum.name()](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name--) \n[Enum.ordinal()](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal--) \n[Enum.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#toString--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)"]]