Skip to content

Commit

Permalink
removed superfluous support for UserSecrets; default to no HttpsRedir…
Browse files Browse the repository at this point in the history
…ect (#57)

force merge because there was a breaking change to the WebApiConfigurator
  • Loading branch information
johnazariah authored Oct 14, 2020
1 parent cbffdeb commit 01f9ea1
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 20 deletions.
2 changes: 1 addition & 1 deletion proto-csharp/webapi-directclient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class WebApiConfigurator : Orleans.Contrib.UniversalSilo.WebApiConfigurator
},
};

public WebApiConfigurator() : base(_apiInfo)
public WebApiConfigurator() : base(_apiInfo, false)
{ }
}

Expand Down
18 changes: 4 additions & 14 deletions proto-csharp/webapi-directclient/webapi-directclient.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
Expand All @@ -9,16 +9,13 @@
<ServerGarbageCollection>true</ServerGarbageCollection>
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
</PropertyGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>

<PropertyGroup>
<DefineConstants>TRACE;HTTPS</DefineConstants>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.8" />
Expand All @@ -29,16 +26,13 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="3.1.8" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.15.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="5.6.3" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Orleans.Client" Version="3.3.0" />
<PackageReference Include="Microsoft.Orleans.Clustering.AzureStorage" Version="3.3.0" />
Expand All @@ -52,21 +46,17 @@
<PackageReference Include="Microsoft.Orleans.Runtime.Abstractions" Version="3.3.0" />
<PackageReference Include="Microsoft.Orleans.Server" Version="3.3.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Orleans.Clustering.Kubernetes" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="OrleansDashboard" Version="3.1.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\universal-silo\universal-silo.fsproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\grain-controllers\grain-controllers.csproj" />
<ProjectReference Include="..\grains\grains.csproj" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion proto-fsharp/webapi-directclient/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module OpenApiConfiguration =

/// Override methods in this class to take over how the web-api host is configured
type WebApiConfigurator() = class
inherit Orleans.Contrib.UniversalSilo.WebApiConfigurator(OpenApiConfiguration.ApiInfo)
inherit Orleans.Contrib.UniversalSilo.WebApiConfigurator(OpenApiConfiguration.ApiInfo, false)
end

/// Override methods in this class to take over how the silo is configured
Expand Down
1 change: 0 additions & 1 deletion universal-silo/Client.fs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ type ClientConfiguration() = class
default __.ConfigureAppConfiguration _ configBuilder =
configBuilder
.SetBasePath(Directory.GetCurrentDirectory ())
.AddUserSecrets(System.Reflection.Assembly.GetExecutingAssembly())
|> ignore

abstract ConfigureServicesCore : HostBuilderContext -> IServiceCollection -> unit
Expand Down
1 change: 0 additions & 1 deletion universal-silo/Configuration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ module Extensions =
this.ConfigureHostConfiguration (fun cb ->
cb
.SetBasePath(Directory.GetCurrentDirectory())
.AddUserSecrets(System.Reflection.Assembly.GetExecutingAssembly())
|> ignore)

member this.ApplyConfiguration f =
Expand Down
5 changes: 3 additions & 2 deletions universal-silo/WebApiConfigurator.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ open Microsoft.Extensions.Diagnostics.HealthChecks
open Microsoft.AspNetCore.Http

[<AbstractClass>]
type WebApiConfigurator (apiInfo : OpenApiInfo) = class
type WebApiConfigurator (apiInfo : OpenApiInfo, useHttpsRedirection : bool) = class
let mutable configuration : IConfiguration = null
member val public Configuration = configuration

Expand Down Expand Up @@ -83,10 +83,11 @@ type WebApiConfigurator (apiInfo : OpenApiInfo) = class
]
|> dict

if useHttpsRedirection then ignore <| builder.UseHttpsRedirection()

builder
.UseDefaultFiles()
.UseStaticFiles()
.UseHttpsRedirection()
.UseSwagger()
.UseSwaggerUI(fun options -> options.SwaggerEndpoint(swaggerUri, swaggerName))
.UseResponseCompression()
Expand Down

0 comments on commit 01f9ea1

Please sign in to comment.