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.
- Loading branch information
1 parent
6cb9a52
commit 0a01210
Showing
10 changed files
with
197 additions
and
0 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
43 changes: 43 additions & 0 deletions
43
extensions/Bitwarden.Server.Sdk/src/Bitwarden.Server.Sdk.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,43 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<!-- Not a true dependency, we just need one to make the CLI happy --> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<PackageType>MSBuildSdk</PackageType> | ||
<!-- We are a meta package, we don't actually want people to have to use netstandard to use us. --> | ||
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> | ||
<NoWarn>$(NoWarn);NU5128</NoWarn> | ||
|
||
<IncludeBuildOutput>false</IncludeBuildOutput> | ||
|
||
<PackageReadmeFile>./README.md</PackageReadmeFile> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
|
||
<Version>0.1.10</Version> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<Authors>Bitwarden Inc.</Authors> | ||
<Description>Bitwarden server sdk</Description> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<ExtensionsHostingRoot>../../Bitwarden.Extensions.Hosting/src/</ExtensionsHostingRoot> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="README.md" Pack="true" PackagePath="/" /> | ||
<None Include="Sdk/**" Pack="true" PackagePath="Sdk/" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content | ||
Include="$(ExtensionsHostingRoot)**/*.cs" | ||
Exclude="$(ExtensionsHostingRoot)bin/**;$(ExtensionsHostingRoot)obj/**" | ||
Pack="true" | ||
PackagePath="content/Bitwarden.Server.Sdk" | ||
Visible="false" | ||
BuildAction="none" | ||
/> | ||
</ItemGroup> | ||
|
||
</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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Bitwarden.Server.Sdk | ||
|
||
The Bitwarden server sdk is built for quickly getting started building | ||
a Bitwarden flavored service. The entrypoint for using it is adding `UseBitwardenSdk()` | ||
on your web application and configuring MSBuild properties to configure the features you | ||
want. | ||
|
||
## Feature Flags |
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,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<UsingBitwardenServerSdk>true</UsingBitwardenServerSdk> | ||
</PropertyGroup> | ||
</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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
These properties are read in targets to allow the csproj file to customize the behavior | ||
--> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup Condition="'$(UsingBitwardenServerSdk)' == 'true'"> | ||
<Compile Include="$(MSBuildThisFileDirectory)../content/Bitwarden.Server.Sdk/**/*.cs" /> | ||
</ItemGroup> | ||
|
||
<!-- TODO Use the constants in places to avoid any configuration that doesn't compile --> | ||
<PropertyGroup> | ||
<!-- Logging defaults to on --> | ||
<BitIncludeLogging Condition="'$(BitIncludeLogging)' == ''">true</BitIncludeLogging> | ||
<DefineConstants Condition="'$(BitIncludeLogging)' == 'true'">$(DefineConstants);BIT_INCLUDE_LOGGING</DefineConstants> | ||
<!-- Telemetry defaults to on --> | ||
<BitIncludeTelemetry Condition="'$(BitIncludeTelemetry)' == ''">true</BitIncludeTelemetry> | ||
<DefineConstants Condition="'$(BitIncludeTelemetry)' == 'true'">$(DefineConstants);BIT_INCLUDE_TELEMETRY</DefineConstants> | ||
<!-- Features defaults to on --> | ||
<BitIncludeFeatures Condition="'$(BitIncludeFeatures)' == ''">true</BitIncludeFeatures> | ||
<DefineConstants Condition="'$(BitIncludeFeatures)' == 'true'">$(DefineConstants);BIT_INCLUDE_FEATURES</DefineConstants> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition="'$(UsingBitwardenServerSdk)' == 'true'"> | ||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" /> | ||
</ItemGroup> | ||
|
||
<!-- TODO: Allow for overriding specific package versions? --> | ||
<ItemGroup Condition="'$(BitIncludeLogging)' == 'true'"> | ||
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" /> | ||
<PackageReference Include="Serilog.Formatting.Compact" Version="3.0.0" /> | ||
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.4" /> | ||
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" /> | ||
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(BitIncludeTelemetry)' == 'true'"> | ||
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" /> | ||
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(BitIncludeFeatures)' == 'true'"> | ||
<PackageReference Include="LaunchDarkly.ServerSdk" Version="8.6.0" /> | ||
</ItemGroup> | ||
</Project> |
11 changes: 11 additions & 0 deletions
11
extensions/Bitwarden.Server.Sdk/tests/MinimalApi/MinimalApi.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,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<Sdk Name="Bitwarden.Server.Sdk" Version="0.1.10" /> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
</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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var builder = WebApplication.CreateBuilder(args); | ||
|
||
builder.UseBitwardenDefaults(); | ||
|
||
var app = builder.Build(); | ||
|
||
app.Run(); |
41 changes: 41 additions & 0 deletions
41
extensions/Bitwarden.Server.Sdk/tests/MinimalApi/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,41 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/launchsettings.json", | ||
"iisSettings": { | ||
"windowsAuthentication": false, | ||
"anonymousAuthentication": true, | ||
"iisExpress": { | ||
"applicationUrl": "http://localhost:33688", | ||
"sslPort": 44324 | ||
} | ||
}, | ||
"profiles": { | ||
"http": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": true, | ||
"launchUrl": "swagger", | ||
"applicationUrl": "http://localhost:5079", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"https": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": true, | ||
"launchUrl": "swagger", | ||
"applicationUrl": "https://localhost:7263;http://localhost:5079", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"IIS Express": { | ||
"commandName": "IISExpress", | ||
"launchBrowser": true, | ||
"launchUrl": "swagger", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
extensions/Bitwarden.Server.Sdk/tests/MinimalApi/appsettings.Development.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,8 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
extensions/Bitwarden.Server.Sdk/tests/MinimalApi/appsettings.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,9 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"AllowedHosts": "*" | ||
} |