feat: extract MyAgent core and web console
This commit is contained in:
commit
e491b1a35b
83 files changed
+13651
No files matched your search
@@ -0,0 +1,27 @@
|
||||
using MyAgent.Storage;
|
||||
using Xunit;
|
||||
|
||||
namespace MyAgent.Tests.Storage;
|
||||
|
||||
public sealed class SafePathSegmentTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(".")]
|
||||
[InlineData("..")]
|
||||
[InlineData("../other")]
|
||||
[InlineData("group/name")]
|
||||
[InlineData("group\\name")]
|
||||
public void Normalize_RejectsPathTraversal(string value)
|
||||
{
|
||||
Assert.Throws<ArgumentException>(() => SafePathSegment.Normalize(value, "groupId"));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("915449089")]
|
||||
[InlineData("demo-group")]
|
||||
[InlineData("user_1")]
|
||||
public void Normalize_AcceptsStableIdentifiers(string value)
|
||||
{
|
||||
Assert.Equal(value, SafePathSegment.Normalize(value, "id"));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user