Reference documentation and code samples for the Google Cloud Functions V2 Client class SecurityLevel.
Available security level settings.
This enforces security protocol on function URL.
Security level is only configurable for 1st Gen functions, If unspecified,
SECURE_OPTIONAL will be used. 2nd Gen functions are SECURE_ALWAYS ONLY.
Generated from protobuf enumSECURITY_LEVEL_UNSPECIFIED = 0;
SECURE_ALWAYS
Value: 1
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.
Generated from protobuf enumSECURE_ALWAYS = 1;
SECURE_OPTIONAL
Value: 2
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-09-04 UTC."],[],[],null,["# Google Cloud Functions V2 Client - Class SecurityLevel (2.0.6)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.6 (latest)](/php/docs/reference/cloud-functions/latest/V2.ServiceConfig.SecurityLevel)\n- [2.0.5](/php/docs/reference/cloud-functions/2.0.5/V2.ServiceConfig.SecurityLevel)\n- [1.7.0](/php/docs/reference/cloud-functions/1.7.0/V2.ServiceConfig.SecurityLevel)\n- [1.6.5](/php/docs/reference/cloud-functions/1.6.5/V2.ServiceConfig.SecurityLevel)\n- [1.5.0](/php/docs/reference/cloud-functions/1.5.0/V2.ServiceConfig.SecurityLevel)\n- [1.4.2](/php/docs/reference/cloud-functions/1.4.2/V2.ServiceConfig.SecurityLevel)\n- [1.3.1](/php/docs/reference/cloud-functions/1.3.1/V2.ServiceConfig.SecurityLevel)\n- [1.2.0](/php/docs/reference/cloud-functions/1.2.0/V2.ServiceConfig.SecurityLevel)\n- [1.1.2](/php/docs/reference/cloud-functions/1.1.2/V2.ServiceConfig.SecurityLevel)\n- [1.0.3](/php/docs/reference/cloud-functions/1.0.3/V2.ServiceConfig.SecurityLevel) \nReference documentation and code samples for the Google Cloud Functions V2 Client class SecurityLevel.\n\nAvailable security level settings.\n\nThis enforces security protocol on function URL.\nSecurity level is only configurable for 1st Gen functions, If unspecified,\nSECURE_OPTIONAL will be used. 2nd Gen functions are SECURE_ALWAYS ONLY.\n\nProtobuf type `google.cloud.functions.v2.ServiceConfig.SecurityLevel`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Functions \\\\ V2 \\\\ ServiceConfig\n\nMethods\n-------\n\n### static::name\n\n### static::value\n\nConstants\n---------\n\n### SECURITY_LEVEL_UNSPECIFIED\n\n Value: 0\n\nUnspecified.\n\nGenerated from protobuf enum `SECURITY_LEVEL_UNSPECIFIED = 0;`\n\n### SECURE_ALWAYS\n\n Value: 1\n\nRequests for a URL that match this handler that do not use HTTPS are\nautomatically redirected to the HTTPS URL with the same path. Query\nparameters are reserved for the redirect.\n\nGenerated from protobuf enum `SECURE_ALWAYS = 1;`\n\n### SECURE_OPTIONAL\n\n Value: 2\n\nBoth HTTP and HTTPS requests with URLs that match the handler succeed\nwithout redirects. The application can examine the request to determine\nwhich protocol was used and respond accordingly.\n\nGenerated from protobuf enum `SECURE_OPTIONAL = 2;`"]]