-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplification of project layout; Updated all relevant GitHub actions…
… files (#133) * Simplification of project layout; Updated all relevant GitHub actions files * Patch version bump
- Loading branch information
Showing
36 changed files
with
101 additions
and
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,11 @@ on: | |
workflow_dispatch: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
paths-ignore: | ||
- '.github/**' | ||
- '*.md' | ||
- 'docs/**' | ||
paths: | ||
- 'src/**' | ||
- 'tests/**' | ||
- 'example/**' | ||
- '.github/workflows/**' | ||
|
||
jobs: | ||
|
||
|
@@ -76,7 +77,6 @@ jobs: | |
|
||
- name: Run all tests | ||
run: dotnet test OwaspHeaders.Core.sln --verbosity minimal --collect:"XPlat Code Coverage" --logger trx --results-directory coverage | ||
working-directory: ${{env.working-directory}} | ||
|
||
- name: Code Coverage Summary Report | ||
uses: irongut/[email protected] | ||
|
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
80 changes: 40 additions & 40 deletions
80
.../CustomHeaders/CrossOriginOptionsTests.cs → .../CustomHeaders/CrossOriginOptionsTests.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 |
---|---|---|
@@ -1,40 +1,40 @@ | ||
namespace OwaspHeaders.Core.Tests.CustomHeaders | ||
{ | ||
public class CrossOriginOptionsTests : SecureHeadersTests | ||
{ | ||
[Fact] | ||
public async Task When_UseCrossOriginResourcePolicyCalled_Header_Is_Present() | ||
{ | ||
// arrange | ||
var headerPresentConfig = | ||
SecureHeadersMiddlewareBuilder.CreateBuilder() | ||
.UseCrossOriginResourcePolicy().Build(); | ||
var secureHeadersMiddleware = new SecureHeadersMiddleware(_onNext, headerPresentConfig); | ||
|
||
// act | ||
await secureHeadersMiddleware.InvokeAsync(_context); | ||
|
||
// assert | ||
Assert.True(headerPresentConfig.UseCrossOriginResourcePolicy); | ||
Assert.True(_context.Response.Headers.ContainsKey(Constants.CrossOriginResourcePolicyHeaderName)); | ||
Assert.Equal(CrossOriginResourcePolicy.SameOriginValue, | ||
_context.Response.Headers[Constants.CrossOriginResourcePolicyHeaderName]); | ||
} | ||
|
||
[Fact] | ||
public async Task When_UseCrossOriginResourcePolicyNotCalled_Header_Not_Present() | ||
{ | ||
// arrange | ||
var headerNotPresentConfig = SecureHeadersMiddlewareBuilder.CreateBuilder() | ||
.Build(); | ||
var secureHeadersMiddleware = new SecureHeadersMiddleware(_onNext, headerNotPresentConfig); | ||
|
||
// act | ||
await secureHeadersMiddleware.InvokeAsync(_context); | ||
|
||
// assert | ||
Assert.False(headerNotPresentConfig.UseCrossOriginResourcePolicy); | ||
Assert.False(_context.Response.Headers.ContainsKey(Constants.CrossOriginResourcePolicyHeaderName)); | ||
} | ||
} | ||
} | ||
namespace OwaspHeaders.Core.Tests.CustomHeaders | ||
{ | ||
public class CrossOriginOptionsTests : SecureHeadersTests | ||
{ | ||
[Fact] | ||
public async Task When_UseCrossOriginResourcePolicyCalled_Header_Is_Present() | ||
{ | ||
// arrange | ||
var headerPresentConfig = | ||
SecureHeadersMiddlewareBuilder.CreateBuilder() | ||
.UseCrossOriginResourcePolicy().Build(); | ||
var secureHeadersMiddleware = new SecureHeadersMiddleware(_onNext, headerPresentConfig); | ||
|
||
// act | ||
await secureHeadersMiddleware.InvokeAsync(_context); | ||
|
||
// assert | ||
Assert.True(headerPresentConfig.UseCrossOriginResourcePolicy); | ||
Assert.True(_context.Response.Headers.ContainsKey(Constants.CrossOriginResourcePolicyHeaderName)); | ||
Assert.Equal(CrossOriginResourcePolicy.SameOriginValue, | ||
_context.Response.Headers[Constants.CrossOriginResourcePolicyHeaderName]); | ||
} | ||
|
||
[Fact] | ||
public async Task When_UseCrossOriginResourcePolicyNotCalled_Header_Not_Present() | ||
{ | ||
// arrange | ||
var headerNotPresentConfig = SecureHeadersMiddlewareBuilder.CreateBuilder() | ||
.Build(); | ||
var secureHeadersMiddleware = new SecureHeadersMiddleware(_onNext, headerNotPresentConfig); | ||
|
||
// act | ||
await secureHeadersMiddleware.InvokeAsync(_context); | ||
|
||
// assert | ||
Assert.False(headerNotPresentConfig.UseCrossOriginResourcePolicy); | ||
Assert.False(_context.Response.Headers.ContainsKey(Constants.CrossOriginResourcePolicyHeaderName)); | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
44 changes: 22 additions & 22 deletions
44
OwaspHeaders.Core.Tests/tests.sln → tests/OwaspHeaders.Core.Tests/tests.sln
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 |
---|---|---|
@@ -1,22 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2013 | ||
VisualStudioVersion = 12.0.0.0 | ||
MinimumVisualStudioVersion = 10.0.0.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests.csproj", "{0E8832DB-616D-4BC3-A193-6D1A0C1176E2}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{0E8832DB-616D-4BC3-A193-6D1A0C1176E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{0E8832DB-616D-4BC3-A193-6D1A0C1176E2}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{0E8832DB-616D-4BC3-A193-6D1A0C1176E2}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{0E8832DB-616D-4BC3-A193-6D1A0C1176E2}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2013 | ||
VisualStudioVersion = 12.0.0.0 | ||
MinimumVisualStudioVersion = 10.0.0.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests.csproj", "{0E8832DB-616D-4BC3-A193-6D1A0C1176E2}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{0E8832DB-616D-4BC3-A193-6D1A0C1176E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{0E8832DB-616D-4BC3-A193-6D1A0C1176E2}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{0E8832DB-616D-4BC3-A193-6D1A0C1176E2}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{0E8832DB-616D-4BC3-A193-6D1A0C1176E2}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |