Skip to content

Commit

Permalink
reduce public api 1st round
Browse files Browse the repository at this point in the history
  • Loading branch information
eduard-dumitru committed Jun 27, 2024
1 parent ab26f0c commit daaa911
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/UiPath.CoreIpc.Tests/NestedStreamTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public async Task ReadAsync_ValidatesArguments()
await Assert.ThrowsAsync<ArgumentException>(() => this.stream.ReadAsync(buffer, 1, buffer.Length));
}
}
public static class StreamExtensions
internal static class StreamExtensions
{
/// <summary>
/// Creates a <see cref="Stream"/> that can read no more than a given number of bytes from an underlying stream.
Expand Down
18 changes: 9 additions & 9 deletions src/UiPath.CoreIpc/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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<object> LinkedTokenCancelDelegate = static s => ((CancellationTokenSource)s).Cancel();
private readonly PooledCancellationTokenSource _timeoutCancellationSource;
Expand Down
2 changes: 1 addition & 1 deletion src/UiPath.CoreIpc/NestedStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// </summary>
public class NestedStream : Stream
internal class NestedStream : Stream
{
/// <summary>
/// The stream to read from.
Expand Down

0 comments on commit daaa911

Please sign in to comment.