Skip to content

Commit daaa911

Browse files
reduce public api 1st round
1 parent ab26f0c commit daaa911

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/UiPath.CoreIpc.Tests/NestedStreamTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ public async Task ReadAsync_ValidatesArguments()
358358
await Assert.ThrowsAsync<ArgumentException>(() => this.stream.ReadAsync(buffer, 1, buffer.Length));
359359
}
360360
}
361-
public static class StreamExtensions
361+
internal static class StreamExtensions
362362
{
363363
/// <summary>
364364
/// Creates a <see cref="Stream"/> that can read no more than a given number of bytes from an underlying stream.

src/UiPath.CoreIpc/Helpers.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using System.Security.Principal;
99
namespace UiPath.Ipc;
1010
using static CancellationTokenSourcePool;
11-
public static class Helpers
11+
internal static class Helpers
1212
{
1313
public const BindingFlags InstanceFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly;
1414
#if NET461
@@ -92,27 +92,27 @@ internal static NamedPipeServerStream NewNamedPipeServerStream(string pipeName,
9292
#endif
9393
}
9494

95-
public static PipeSecurity LocalOnly(this PipeSecurity pipeSecurity) => pipeSecurity.Deny(WellKnownSidType.NetworkSid, PipeAccessRights.FullControl);
95+
internal static PipeSecurity LocalOnly(this PipeSecurity pipeSecurity) => pipeSecurity.Deny(WellKnownSidType.NetworkSid, PipeAccessRights.FullControl);
9696

97-
public static PipeSecurity Deny(this PipeSecurity pipeSecurity, WellKnownSidType sid, PipeAccessRights pipeAccessRights) =>
97+
internal static PipeSecurity Deny(this PipeSecurity pipeSecurity, WellKnownSidType sid, PipeAccessRights pipeAccessRights) =>
9898
pipeSecurity.Deny(new SecurityIdentifier(sid, null), pipeAccessRights);
9999

100-
public static PipeSecurity Deny(this PipeSecurity pipeSecurity, IdentityReference sid, PipeAccessRights pipeAccessRights)
100+
internal static PipeSecurity Deny(this PipeSecurity pipeSecurity, IdentityReference sid, PipeAccessRights pipeAccessRights)
101101
{
102102
pipeSecurity.SetAccessRule(new(sid, pipeAccessRights, AccessControlType.Deny));
103103
return pipeSecurity;
104104
}
105105

106-
public static PipeSecurity Allow(this PipeSecurity pipeSecurity, WellKnownSidType sid, PipeAccessRights pipeAccessRights) =>
106+
internal static PipeSecurity Allow(this PipeSecurity pipeSecurity, WellKnownSidType sid, PipeAccessRights pipeAccessRights) =>
107107
pipeSecurity.Allow(new SecurityIdentifier(sid, null), pipeAccessRights);
108108

109-
public static PipeSecurity Allow(this PipeSecurity pipeSecurity, IdentityReference sid, PipeAccessRights pipeAccessRights)
109+
internal static PipeSecurity Allow(this PipeSecurity pipeSecurity, IdentityReference sid, PipeAccessRights pipeAccessRights)
110110
{
111111
pipeSecurity.SetAccessRule(new(sid, pipeAccessRights, AccessControlType.Allow));
112112
return pipeSecurity;
113113
}
114114

115-
public static PipeSecurity AllowCurrentUser(this PipeSecurity pipeSecurity, bool onlyNonAdmin = false)
115+
internal static PipeSecurity AllowCurrentUser(this PipeSecurity pipeSecurity, bool onlyNonAdmin = false)
116116
{
117117
using (var currentIdentity = WindowsIdentity.GetCurrent())
118118
{
@@ -167,7 +167,7 @@ private static async ValueTask WriteMessageCore(this Stream stream, RecyclableMe
167167
internal static Task WriteBuffer(this Stream stream, byte[] buffer, CancellationToken cancellationToken) =>
168168
stream.WriteAsync(buffer, 0, buffer.Length, cancellationToken);
169169
}
170-
public static class Validator
170+
internal static class Validator
171171
{
172172
public static void Validate(ServiceHostBuilder serviceHostBuilder)
173173
{
@@ -267,7 +267,7 @@ private static void CheckDerivedStream(MethodInfo method, Type type)
267267
}
268268
}
269269
}
270-
public readonly struct TimeoutHelper : IDisposable
270+
internal readonly struct TimeoutHelper : IDisposable
271271
{
272272
private static readonly Action<object> LinkedTokenCancelDelegate = static s => ((CancellationTokenSource)s).Cancel();
273273
private readonly PooledCancellationTokenSource _timeoutCancellationSource;

src/UiPath.CoreIpc/NestedStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/// A stream that allows for reading from another stream up to a given number of bytes.
55
/// https://github.com/AArnott/Nerdbank.Streams/blob/3303c541c29b979f61c86c3c2ed5c0e7372d7a55/src/Nerdbank.Streams/NestedStream.cs#L18
66
/// </summary>
7-
public class NestedStream : Stream
7+
internal class NestedStream : Stream
88
{
99
/// <summary>
1010
/// The stream to read from.

0 commit comments

Comments
 (0)