generated from bitwarden/template
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move Features to SDK #70
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
95f87d9
Move features to SDK
justindbaur baa2a70
Finish Features Migration
justindbaur c21d5a6
Update Mode
justindbaur 26178d6
Merge branch 'main' into features-to-sdk
justindbaur a7d1b19
Lower TargetFramework
justindbaur 396e0b8
Merge branch 'features-to-sdk' of github.com:bitwarden/dotnet-extensiโฆ
justindbaur 146dcde
Lower Microsoft.AspNetCore.TestHost Version
justindbaur File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'"> | ||
withinfocus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is what a
<Sdk />
reference does for you under the hood so this is a good test of the SDK.