fix(secrets): audit malformed ${secret:} tokens, cap SecretName at 450, resolve local UNC shares (scadaproj#52)
Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
@@ -27,6 +27,16 @@ public class SecretNameTests
|
||||
public void RejectsRootedOrEmptySegment(string input)
|
||||
=> Assert.Throws<ArgumentException>(() => new SecretName(input));
|
||||
|
||||
[Fact]
|
||||
public void AcceptsExactlyMaxLength_AndRejectsOneOver()
|
||||
{
|
||||
Assert.Equal(450, SecretName.MaxLength);
|
||||
Assert.Equal(450, new SecretName(new string('a', 450)).Value.Length);
|
||||
Assert.Throws<ArgumentException>(() => new SecretName(new string('a', 451)));
|
||||
// Length is measured after trim/lowercase normalization.
|
||||
Assert.Equal(450, new SecretName(" " + new string('A', 450) + " ").Value.Length);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DefaultInstance_ThrowsOnValue()
|
||||
=> Assert.Throws<InvalidOperationException>(() => _ = default(SecretName).Value);
|
||||
|
||||
Reference in New Issue
Block a user