From 8686275b69f2402923256f8fd9b29fab8da82961 Mon Sep 17 00:00:00 2001 From: thepra Date: Mon, 5 Oct 2026 07:04:35 +0200 Subject: [PATCH] The statistics name RFC 9421 signatures A delivery signed with RFC 9421 was counted under "other": its algorithm (rsa-v1_5-sha256) has an underscore, which a signature name could not hold. It is now counted as rfc9421:rsa-v1_5-sha256, as WordPress's are. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw --- PrivaPub.Tests/Statistics/InteractionsTests.cs | 2 ++ PrivaPub/Infrastructure/Statistics/Interactions.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/PrivaPub.Tests/Statistics/InteractionsTests.cs b/PrivaPub.Tests/Statistics/InteractionsTests.cs index 877d69b..d75f6f5 100644 --- a/PrivaPub.Tests/Statistics/InteractionsTests.cs +++ b/PrivaPub.Tests/Statistics/InteractionsTests.cs @@ -49,6 +49,8 @@ namespace PrivaPub.Tests.Statistics Assert.Equal("-", Interactions.Host("evil host/with path")); Assert.Equal("-", Interactions.Host(default)); Assert.Equal("social.example", Interactions.HostOf("https://Social.Example:8443/users/x")); + // RFC 9421's algorithm names carry an underscore + Assert.Equal("rfc9421:rsa-v1_5-sha256", Interactions.Sanitize(new InteractionEvent { Signature = "rfc9421:rsa-v1_5-sha256" }).Signature); } [Fact] diff --git a/PrivaPub/Infrastructure/Statistics/Interactions.cs b/PrivaPub/Infrastructure/Statistics/Interactions.cs index c2d31db..2345c20 100644 --- a/PrivaPub/Infrastructure/Statistics/Interactions.cs +++ b/PrivaPub/Infrastructure/Statistics/Interactions.cs @@ -95,7 +95,7 @@ namespace PrivaPub.Infrastructure.Statistics [GeneratedRegex("^[a-z0-9][a-z0-9-]{0,39}$")] private static partial Regex KebabWord(); - [GeneratedRegex("^[a-z0-9][a-z0-9:-]{0,39}$")] + [GeneratedRegex("^[a-z0-9][a-z0-9:_-]{0,39}$")] private static partial Regex SignatureName(); [GeneratedRegex("^[a-z0-9][a-z0-9:/+.-]{0,63}$")]