diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index e35661b..2b872f0 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -29,6 +29,10 @@ These items are essential and must be completed for each commit. If they are not - [ ] I have run the `dotnet-format` command and fixed any .editorconfig issues - [ ] I have ensured that the code coverage has not dropped below 65% - [ ] I have increased the version number in OwaspHeaders.Core.csproj (only relevant for code changes) +- [ ] I have updated the changelog in the root of the repository + +> [!NOTE] +> The changelog in the `docs/` directory will be updated automatically when PRs are merged into main. #### Optional diff --git a/.github/workflows/sync-changelog.yml b/.github/workflows/sync-changelog.yml new file mode 100644 index 0000000..119bd35 --- /dev/null +++ b/.github/workflows/sync-changelog.yml @@ -0,0 +1,68 @@ +name: Sync Changelog to Docs + +on: + push: + branches: [ main ] + paths: + - 'changelog.md' + workflow_dispatch: # Allow manual triggering + +permissions: + contents: write + +jobs: + sync-changelog: + runs-on: ubuntu-latest + name: Sync root changelog to docs changelog + + steps: + - name: Checkout code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + + - name: Sync changelog files + run: | + # Check if root changelog exists + if [ ! -f "changelog.md" ]; then + echo "Root changelog.md not found, skipping sync" + exit 0 + fi + + # Create docs directory if it doesn't exist + mkdir -p docs + + # Preserve Jekyll front matter and sync content + cat > docs/changelog.md << 'EOF' + --- + title: Changelog + layout: page + nav_order: 9 + --- + + EOF + + # Append the content from root changelog (skip the first line which is the title) + tail -n +2 changelog.md >> docs/changelog.md + + echo "Changelog sync completed" + + - name: Check for changes + id: verify-changed-files + run: | + if [ -n "$(git status --porcelain docs/changelog.md)" ]; then + echo "changed=true" >> $GITHUB_OUTPUT + echo "Docs changelog has changes to commit" + else + echo "changed=false" >> $GITHUB_OUTPUT + echo "No changes detected in docs changelog" + fi + + - name: Commit changes + if: steps.verify-changed-files.outputs.changed == 'true' + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add docs/changelog.md + git commit -m "docs: sync changelog from root to docs directory [skip ci]" -m "Automatically synced changelog.md to docs/changelog.md to keep documentation site up-to-date." + git push \ No newline at end of file diff --git a/changelog.md b/changelog.md index 2361cfb..292a76a 100644 --- a/changelog.md +++ b/changelog.md @@ -22,6 +22,24 @@ This version dropped support for .NET 6 and .NET 7, as they are no longer suppor All projects in the [GitHub repo](https://github.com/GaProgMan/OwaspHeaders.Core) now build and run with either .NET 8 or .NET 9, whichever is present (deferring to the highest version number if both are present). As of November 19th, 2024 there are no new features in Version 9, so if you still need to use the NuGet package with .NET 6 or 7 please use Version 8 of the package. +#### Version 9.8.x + +This version introduces comprehensive logging support via the `ILogger` interface, following Andrew Lock's high-performance logging best practices. The logging functionality provides visibility into middleware operations, helping developers troubleshoot configuration issues and monitor security header application. + +**New Features:** + +- Information-level logs for successful operations (middleware initialisation, headers added) +- Warning logs for configuration issues and header operation failures +- Error logs for validation failures and middleware exceptions +- Debug logs for detailed header addition information +- Configurable Event IDs (1000-3999 range) to avoid conflicts with application logging +- High-performance logging with log level checking to minimise performance impact +- 100% backward compatibility - existing applications continue to work without changes + +The logging is automatically enabled when an `ILogger` is available in dependency injection. Developers can customise Event IDs using `WithLoggingEventIdBase()` or `WithLoggingEventIds()` methods to avoid conflicts with existing application Event ID schemes. + +See the [Logging documentation](https://gaprogman.github.io/OwaspHeaders.Core/logging) for detailed configuration options and examples. + #### Version 9.7.x This version saw the addition of both the [Cross-Origin-Opener-Policy](https://gaprogman.github.io/OwaspHeaders.Core/configuration/Cross-Origin-Opener-Policy/) (COEP) and [Cross-Origin-Embedder-Policy](https://gaprogman.github.io/OwaspHeaders.Core/configuration/Cross-Origin-Embedder-Policy/) (COEP) headers; bringing the total number of supported headers to 83% complete (or 10 of the 12 recommended headers and values). diff --git a/docs/changelog.md b/docs/changelog.md index bf8422b..283740e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,3 +1,9 @@ +--- +title: Changelog +layout: page +nav_order: 9 +--- + # Changelog This changelog represents all the major (i.e. breaking) changes made to the OwaspHeaders.Core project since it's inception. Early in the repo's development, GitHub's "releases" where used to release builds of the code repo. However shortly after it's inception, builds and releases where moved to [AppVeyor](https://ci.appveyor.com/project/GaProgMan/owaspheaders-core). Because of this, the releases on the GitHub repo became stale. @@ -22,6 +28,24 @@ This version dropped support for .NET 6 and .NET 7, as they are no longer suppor All projects in the [GitHub repo](https://github.com/GaProgMan/OwaspHeaders.Core) now build and run with either .NET 8 or .NET 9, whichever is present (deferring to the highest version number if both are present). As of November 19th, 2024 there are no new features in Version 9, so if you still need to use the NuGet package with .NET 6 or 7 please use Version 8 of the package. +#### Version 9.8.x + +This version introduces comprehensive logging support via the `ILogger` interface, following Andrew Lock's high-performance logging best practices. The logging functionality provides visibility into middleware operations, helping developers troubleshoot configuration issues and monitor security header application. + +**New Features:** + +- Information-level logs for successful operations (middleware initialisation, headers added) +- Warning logs for configuration issues and header operation failures +- Error logs for validation failures and middleware exceptions +- Debug logs for detailed header addition information +- Configurable Event IDs (1000-3999 range) to avoid conflicts with application logging +- High-performance logging with log level checking to minimise performance impact +- 100% backward compatibility - existing applications continue to work without changes + +The logging is automatically enabled when an `ILogger` is available in dependency injection. Developers can customise Event IDs using `WithLoggingEventIdBase()` or `WithLoggingEventIds()` methods to avoid conflicts with existing application Event ID schemes. + +See the [Logging documentation](https://gaprogman.github.io/OwaspHeaders.Core/logging) for detailed configuration options and examples. + #### Verison 9.7.x This version saw the addition of both the [Cross-Origin-Opener-Policy](https://gaprogman.github.io/OwaspHeaders.Core/configuration/Cross-Origin-Opener-Policy/) (COOP) and [Cross-Origin-Embedder-Policy](https://gaprogman.github.io/OwaspHeaders.Core/configuration/Cross-Origin-Embedder-Policy/) (COEP) headers; bringing the total number of supported headers to 83% complete (or 10 of the 12 recommended headers and values). diff --git a/src/OwaspHeaders.Core.csproj b/src/OwaspHeaders.Core.csproj index 93c7b33..3b9a98b 100644 --- a/src/OwaspHeaders.Core.csproj +++ b/src/OwaspHeaders.Core.csproj @@ -8,7 +8,7 @@ OwaspHeaders.Core - 9.8.0 + 9.8.1 Jamie Taylor RJJ Software Ltd MIT diff --git a/tests/OwaspHeaders.Core.Tests/OwaspHeaders.Core.Tests.csproj b/tests/OwaspHeaders.Core.Tests/OwaspHeaders.Core.Tests.csproj index dc923cd..8d16650 100644 --- a/tests/OwaspHeaders.Core.Tests/OwaspHeaders.Core.Tests.csproj +++ b/tests/OwaspHeaders.Core.Tests/OwaspHeaders.Core.Tests.csproj @@ -2,7 +2,7 @@ A Unit Test project (using xunit) for the OwaspHeaders.Core project - 9.8.0 + 9.8.1 Jamie Taylor OwaspHeaders.Core.Tests net8.0;net9.0