Skip to content

Commit

Permalink
Updated core tools to 3.22.0 (#3628)
Browse files Browse the repository at this point in the history
* Updated core tools to 3.22.0

* Same fixes that we have done in v4.x branch.

---------

Co-authored-by: khkh@microsoft.com <khkh@microsoft.com>
  • Loading branch information
v-imohammad and khkh-ms authored Apr 18, 2024
1 parent c21339d commit 32564dc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/Azure.Functions.Cli/Actions/HostActions/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Azure.Functions.Cli.Diagnostics;
using Azure.Functions.Cli.ExtensionBundle;
using Azure.Functions.Cli.Helpers;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Azure.WebJobs.Script;
Expand Down Expand Up @@ -73,6 +74,8 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
.AddScheme<ArmAuthenticationOptions, CliAuthenticationHandler<ArmAuthenticationOptions>>(ArmAuthenticationDefaults.AuthenticationScheme, _ => { });
}

services.AddSingleton<IAuthorizationHandler, CoreToolsAuthorizationHandler>();

services.AddWebJobsScriptHostAuthorization();

services.AddMvc()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
using System.Security.Claims;
using Microsoft.Azure.WebJobs.Script.WebHost.Security.Authentication;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Azure.WebJobs.Script.WebHost.Security.Authorization;
using Microsoft.Azure.WebJobs.Script.Description;

namespace Azure.Functions.Cli.Actions.HostActions.WebHost.Security
{
Expand All @@ -33,4 +36,14 @@ protected override Task<AuthenticateResult> HandleAuthenticateAsync()
return Task.FromResult(result);
}
}

public class CoreToolsAuthorizationHandler : AuthorizationHandler<FunctionAuthorizationRequirement, FunctionDescriptor>
{
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, FunctionAuthorizationRequirement requirement, FunctionDescriptor resource)
{
context.Succeed(requirement);

return Task.CompletedTask;
}
}
}
2 changes: 1 addition & 1 deletion src/Azure.Functions.Cli/Azure.Functions.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
<PackageReference Include="DotNetZip" Version="1.13.3" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="2.2.0" />
<PackageReference Include="Microsoft.Azure.DurableTask.AzureStorage.Internal" Version="1.4.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Script.WebHost" Version="3.21.1" />
<PackageReference Include="Microsoft.Azure.WebJobs.Script.WebHost" Version="3.22.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="YamlDotNet" Version="6.0.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/Azure.Functions.Cli.Tests/E2E/StartTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ await CliTester.Run(new RunConfiguration
}, _output);
}

[Theory]
[Theory(Skip = "https://github.com/Azure/azure-functions-core-tools/issues/3644")]
[InlineData("dotnet")]
[InlineData("dotnet-isolated")]
public async Task start_with_user_secrets(string language)
Expand Down

0 comments on commit 32564dc

Please sign in to comment.