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 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. 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); }