generated from bitwarden/template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move features to SDK * Finish Features Migration * Update Mode * Lower TargetFramework * Lower Microsoft.AspNetCore.TestHost Version
- Loading branch information
1 parent
ac75a69
commit 99e0770
Showing
34 changed files
with
277 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
extensions/Bitwarden.Extensions.Hosting/examples/MinimalApi/MinimalApi.csproj
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
extensions/Bitwarden.Extensions.Hosting/examples/MinimalApi/Program.cs
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
extensions/Bitwarden.Extensions.Hosting/examples/MinimalApi/Properties/launchSettings.json
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
extensions/Bitwarden.Extensions.Hosting/src/BitwardenHostOptions.cs
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
extensions/Bitwarden.Extensions.Hosting/src/Features/IFeatureMetadata.cs
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
extensions/Bitwarden.Server.Sdk/examples/Standard/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#if BIT_INCLUDE_FEATURES | ||
using Bitwarden.Server.Sdk.Features; | ||
#endif | ||
|
||
var builder = WebApplication.CreateBuilder(args); | ||
|
||
builder.UseBitwardenSdk(); | ||
|
||
var app = builder.Build(); | ||
|
||
#if BIT_INCLUDE_FEATURES | ||
app.MapGet("/features", (IFeatureService featureService) => | ||
{ | ||
return featureService.GetAll(); | ||
}); | ||
#endif | ||
|
||
app.Run(); |
23 changes: 23 additions & 0 deletions
23
extensions/Bitwarden.Server.Sdk/examples/Standard/Properties/launchSettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/launchsettings.json", | ||
"profiles": { | ||
"http": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": false, | ||
"applicationUrl": "http://localhost:5087", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"https": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": false, | ||
"applicationUrl": "https://localhost:7186;http://localhost:5087", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
extensions/Bitwarden.Server.Sdk/examples/Standard/Standard.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<Import Project="../../src/Sdk/Sdk.props" /> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Mode)' == '1'"> | ||
<BitIncludeLogging>false</BitIncludeLogging> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Mode)' == '2'"> | ||
<BitIncludeLogging>false</BitIncludeLogging> | ||
<BitIncludeTelemetry>false</BitIncludeTelemetry> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Mode)' == '3'"> | ||
<BitIncludeLogging>false</BitIncludeLogging> | ||
<BitIncludeTelemetry>false</BitIncludeTelemetry> | ||
<BitIncludeFeatures>false</BitIncludeFeatures> | ||
</PropertyGroup> | ||
|
||
<Import Project="../../src/Sdk/Sdk.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,5 @@ | |
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"AllowedHosts": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...es/FeatureApplicationBuilderExtensions.cs → ...es/FeatureApplicationBuilderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
...ng/src/Features/FeatureCheckMiddleware.cs → ...ontent/Features/FeatureCheckMiddleware.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ureEndpointConventionBuilderExtensions.cs → ...ureEndpointConventionBuilderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...osting/src/Features/FeatureFlagOptions.cs → ...rc/Content/Features/FeatureFlagOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...res/FeatureServiceCollectionExtensions.cs → ...res/FeatureServiceCollectionExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
extensions/Bitwarden.Server.Sdk/src/Content/Features/IFeatureMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma warning disable BWSDK0001 | ||
#nullable enable | ||
|
||
using System.ComponentModel; | ||
using Bitwarden.Server.Sdk.Utilities.Internal; | ||
|
||
namespace Bitwarden.Server.Sdk.Features; | ||
|
||
|
||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
[Obsolete(InternalConstants.InternalMessage, DiagnosticId = InternalConstants.InternalId)] | ||
internal interface IFeatureMetadata | ||
{ | ||
/// <summary> | ||
/// A method to run to check if the feature is enabled. | ||
/// </summary> | ||
Func<IFeatureService, bool> FeatureCheck { get; set; } | ||
} |
4 changes: 3 additions & 1 deletion
4
...s.Hosting/src/Features/IFeatureService.cs → ...k/src/Content/Features/IFeatureService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.