Skip to content

Incompatibility with Microsoft.Azure.WebJobs.Extensions.OpenApi #82

@josbol

Description

@josbol

At the moment, the in-processs 4.2.0 version is not compatible with Microsoft.Azure.WebJobs.Extensions.OpenApi 1.5.1. The reason being that apparently the functions registered by the OpenApi assembly do not have any function name attributes (at least, that's what it looks like when debugging).

In FunctionsAuthorizeBindingProvider.cs:

private void ProcessAuthorization(ParameterInfo info)
{
	MethodInfo methodInfo = (info.Member as MethodInfo) ?? throw new InvalidOperationException("Unable to bind authorization context for " + info.Name + ".");
	Type declaringType = methodInfo.DeclaringType;
	FunctionNameAttribute customAttribute = methodInfo.GetCustomAttribute<FunctionNameAttribute>();

        // customAttribute is null here in the case of the OpenApi functions.

	_options.RegisterFunctionAuthorizationAttributesMetadata<FunctionAuthorizeAttribute>(customAttribute.Name, declaringType, methodInfo);
}

Considering those endpoints are anonymous, just skipping processed item would do the trick I guess (didn't test this!)

The function in question is RenderOAuth2Redirect

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions