diff --git a/src/UiPath.CoreIpc.Tests/NestedStreamTests.cs b/src/UiPath.CoreIpc.Tests/NestedStreamTests.cs index a19afc50..a96af00a 100644 --- a/src/UiPath.CoreIpc.Tests/NestedStreamTests.cs +++ b/src/UiPath.CoreIpc.Tests/NestedStreamTests.cs @@ -358,7 +358,7 @@ public async Task ReadAsync_ValidatesArguments() await Assert.ThrowsAsync(() => this.stream.ReadAsync(buffer, 1, buffer.Length)); } } -public static class StreamExtensions +internal static class StreamExtensions { /// /// Creates a that can read no more than a given number of bytes from an underlying stream. diff --git a/src/UiPath.CoreIpc/Helpers.cs b/src/UiPath.CoreIpc/Helpers.cs index 7abe2292..edebc667 100644 --- a/src/UiPath.CoreIpc/Helpers.cs +++ b/src/UiPath.CoreIpc/Helpers.cs @@ -8,7 +8,7 @@ using System.Security.Principal; namespace UiPath.Ipc; using static CancellationTokenSourcePool; -public static class Helpers +internal static class Helpers { public const BindingFlags InstanceFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly; #if NET461 @@ -92,27 +92,27 @@ internal static NamedPipeServerStream NewNamedPipeServerStream(string pipeName, #endif } - public static PipeSecurity LocalOnly(this PipeSecurity pipeSecurity) => pipeSecurity.Deny(WellKnownSidType.NetworkSid, PipeAccessRights.FullControl); + internal static PipeSecurity LocalOnly(this PipeSecurity pipeSecurity) => pipeSecurity.Deny(WellKnownSidType.NetworkSid, PipeAccessRights.FullControl); - public static PipeSecurity Deny(this PipeSecurity pipeSecurity, WellKnownSidType sid, PipeAccessRights pipeAccessRights) => + internal static PipeSecurity Deny(this PipeSecurity pipeSecurity, WellKnownSidType sid, PipeAccessRights pipeAccessRights) => pipeSecurity.Deny(new SecurityIdentifier(sid, null), pipeAccessRights); - public static PipeSecurity Deny(this PipeSecurity pipeSecurity, IdentityReference sid, PipeAccessRights pipeAccessRights) + internal static PipeSecurity Deny(this PipeSecurity pipeSecurity, IdentityReference sid, PipeAccessRights pipeAccessRights) { pipeSecurity.SetAccessRule(new(sid, pipeAccessRights, AccessControlType.Deny)); return pipeSecurity; } - public static PipeSecurity Allow(this PipeSecurity pipeSecurity, WellKnownSidType sid, PipeAccessRights pipeAccessRights) => + internal static PipeSecurity Allow(this PipeSecurity pipeSecurity, WellKnownSidType sid, PipeAccessRights pipeAccessRights) => pipeSecurity.Allow(new SecurityIdentifier(sid, null), pipeAccessRights); - public static PipeSecurity Allow(this PipeSecurity pipeSecurity, IdentityReference sid, PipeAccessRights pipeAccessRights) + internal static PipeSecurity Allow(this PipeSecurity pipeSecurity, IdentityReference sid, PipeAccessRights pipeAccessRights) { pipeSecurity.SetAccessRule(new(sid, pipeAccessRights, AccessControlType.Allow)); return pipeSecurity; } - public static PipeSecurity AllowCurrentUser(this PipeSecurity pipeSecurity, bool onlyNonAdmin = false) + internal static PipeSecurity AllowCurrentUser(this PipeSecurity pipeSecurity, bool onlyNonAdmin = false) { using (var currentIdentity = WindowsIdentity.GetCurrent()) { @@ -167,7 +167,7 @@ private static async ValueTask WriteMessageCore(this Stream stream, RecyclableMe internal static Task WriteBuffer(this Stream stream, byte[] buffer, CancellationToken cancellationToken) => stream.WriteAsync(buffer, 0, buffer.Length, cancellationToken); } -public static class Validator +internal static class Validator { public static void Validate(ServiceHostBuilder serviceHostBuilder) { @@ -267,7 +267,7 @@ private static void CheckDerivedStream(MethodInfo method, Type type) } } } -public readonly struct TimeoutHelper : IDisposable +internal readonly struct TimeoutHelper : IDisposable { private static readonly Action LinkedTokenCancelDelegate = static s => ((CancellationTokenSource)s).Cancel(); private readonly PooledCancellationTokenSource _timeoutCancellationSource; diff --git a/src/UiPath.CoreIpc/NestedStream.cs b/src/UiPath.CoreIpc/NestedStream.cs index 3dfaa718..2e69166e 100644 --- a/src/UiPath.CoreIpc/NestedStream.cs +++ b/src/UiPath.CoreIpc/NestedStream.cs @@ -4,7 +4,7 @@ /// A stream that allows for reading from another stream up to a given number of bytes. /// https://github.com/AArnott/Nerdbank.Streams/blob/3303c541c29b979f61c86c3c2ed5c0e7372d7a55/src/Nerdbank.Streams/NestedStream.cs#L18 /// -public class NestedStream : Stream +internal class NestedStream : Stream { /// /// The stream to read from.