From 7bde61d30c671b10bfc1ee69deadc745509c83d3 Mon Sep 17 00:00:00 2001 From: Jos Bol Date: Fri, 17 Oct 2025 12:31:49 -0300 Subject: [PATCH 1/3] Add null check for FunctionNameAttribute Added null check for nameAttr before registration. At least in the case of the endpoints added by Microsoft.Azure.WebJobs.Extensions.OpenApi, the attribute is not present. --- src/in-proc/Bindings/FunctionsAuthorizeBindingProvider.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/in-proc/Bindings/FunctionsAuthorizeBindingProvider.cs b/src/in-proc/Bindings/FunctionsAuthorizeBindingProvider.cs index 66d18fb..0dbf3ae 100644 --- a/src/in-proc/Bindings/FunctionsAuthorizeBindingProvider.cs +++ b/src/in-proc/Bindings/FunctionsAuthorizeBindingProvider.cs @@ -50,6 +50,8 @@ private void ProcessAuthorization(ParameterInfo info) var declaringType = method.DeclaringType!; var nameAttr = method.GetCustomAttribute()!; + if (nameAttr is null) return; + _options.RegisterFunctionAuthorizationAttributesMetadata( nameAttr.Name, declaringType, method); } From b38ad9f85a32076579df437332f957e5eddd94c1 Mon Sep 17 00:00:00 2001 From: Arturo Martinez Date: Tue, 21 Oct 2025 10:47:03 -0500 Subject: [PATCH 2/3] Update release properties for preview version --- .build/release.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.build/release.props b/.build/release.props index 76c8344..10ed03d 100644 --- a/.build/release.props +++ b/.build/release.props @@ -6,9 +6,9 @@ DarkLoop DarkLoop - All rights reserved DarkLoop's Azure Functions Authorization - false + true 4.0.0.0 - 4.2.0 + 4.2.1 $(Version).0 https://github.com/dark-loop/functions-authorize https://github.com/dark-loop/functions-authorize/blob/master/LICENSE From 04324d81f149416d99724acff4c2e79b52cede55 Mon Sep 17 00:00:00 2001 From: Arturo Martinez Date: Tue, 21 Oct 2025 10:53:45 -0500 Subject: [PATCH 3/3] Update ChangeLog for version 4.2.1 Added a new entry for version 4.2.1 detailing a check for FunctionNameAttribute during binding execution in InProcess mode. --- ChangeLog.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index cd42637..cf124e8 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,9 @@ # Change log Change log stars with version 3.1.3 +## 4.2.1 +- Adding check for `FunctionNameAttribute` when executing binding for InProcess mode. There are situations where other functions can be injected that are not decorated with attribute and also execute parameter binding. + ## 4.2.0 - Removing support for STS .NET versions (7.0), as these versions are not supported by Azure Functions runtime. - Removing ARM authentication support to align with Azure Functions runtime changes. @@ -99,4 +102,4 @@ The package for Azure Functions V3+ In-Proc mode is now called `DarkLoop.Azure.F Azure Functions recently [added configuration](https://github.com/Azure/azure-functions-host/pull/9678) for issuer and audience validation for the default authentication flows, not the one supported by this package through `FunctionAuthorizeAttribute`, which interferes with token validation when using our own Bearer scheme token configuration. In prior versions, this package has functionality to clear Functions built-in configuration, but it was not enabled by default when using `AddJwtBearer(Action configure, bool removeBuiltInConfig = false)`. Since the use of this package is commonly used for custom JWT token, the default value of `removeBuiltInConfig` is now `true`. > This functionality is now deprecated and no longer supported starting in version 4.1.0. It will be removed in future versions. - > Bearer scheme is now used by the Functions runtime and another one should be used for your functions. \ No newline at end of file + > Bearer scheme is now used by the Functions runtime and another one should be used for your functions.