Compare commits

...
Author SHA1 Message Date
dependabot[bot]andGitHub bb5d1a1925 Bump SSH.NET from 2025.1.0 to 2026.0.0
---
updated-dependencies:
- dependency-name: SSH.NET
  dependency-version: 2026.0.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-13 05:04:49 +00:00
Dmytro NikitinandGitHub 7a8582fef5 Fix #1494: WithClientIP(MatchOperator, IStringMatcher[]) ignores the operator (#1495) 2026-08-09 18:49:13 +02:00
Stef Heyenrath 05929bdea6 remove copilot-setup-steps.yml 2026-08-06 20:15:30 +02:00
4 changed files with 21 additions and 37 deletions
-36
View File
@@ -1,36 +0,0 @@
name: "Copilot Setup Steps"
# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-latest
# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
contents: read
# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- name: Install .NET 10.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
10.x
dotnet-quality: preview
- name: dotnet --info
run: dotnet --info
@@ -19,7 +19,7 @@ public partial class Request
{
Guard.NotNullOrEmpty(matchers);
_requestMatchers.Add(new RequestMessageClientIPMatcher(MatchBehaviour.AcceptOnMatch, MatchOperator.Or, matchers));
_requestMatchers.Add(new RequestMessageClientIPMatcher(MatchBehaviour.AcceptOnMatch, matchOperator, matchers));
return this;
}
@@ -38,6 +38,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SSH.NET" Version="2026.0.0" />
<PackageReference Include="Stef.Validation" Version="0.3.0" />
<PackageReference Include="Testcontainers" Version="4.12.0" />
</ItemGroup>
@@ -64,4 +64,23 @@ public class RequestBuilderWithClientIPTests
var requestMatchResult = new RequestMatchResult();
spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0);
}
[Fact]
public void Request_WithClientIP_MatchOperator_And_RequiresAllMatchers()
{
// given: two matchers combined with And (the client IP must satisfy BOTH)
var spec = Request.Create().WithClientIP(MatchOperator.And, new WildcardMatcher("1.2.*"), new WildcardMatcher("*.3.4"));
// when: an IP matching both matchers -> perfect match
var matchesBoth = new RequestMessage(new UrlDetails("http://localhost"), "GET", "1.2.3.4");
spec.GetMatchingScore(matchesBoth, new RequestMatchResult()).Should().Be(1.0);
// when: an IP matching only the first matcher -> mismatch
var matchesFirstOnly = new RequestMessage(new UrlDetails("http://localhost"), "GET", "1.2.9.9");
spec.GetMatchingScore(matchesFirstOnly, new RequestMatchResult()).Should().Be(0.0);
// when: an IP matching only the second matcher -> mismatch
var matchesSecondOnly = new RequestMessage(new UrlDetails("http://localhost"), "GET", "9.3.4");
spec.GetMatchingScore(matchesSecondOnly, new RequestMatchResult()).Should().Be(0.0);
}
}