Skip to content

Commit

Permalink
refactor: gRPC Web Adjustments (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
lemaitre-aneo authored May 27, 2024
2 parents cdc5e11 + d529433 commit 7a79308
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,8 @@ private static HttpMessageHandler CreateHttpMessageHandler(bool htt

if (https)
{
winHandler.SslProtocols = GetSslProtocols();
winHandler.ServerCertificateValidationCallback = GetServerCertificateValidationCallback(insecure,
caCert);
winHandler.SslProtocols = sslProtocols;
winHandler.ServerCertificateValidationCallback = validationCallback;

if (clientCert is not null)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of the ArmoniK project
//
// Copyright (C) ANEO, 2021-2022. All rights reserved.
// Copyright (C) ANEO, 2021-2024. All rights reserved.
// W. Kirschenmann <[email protected]>
// J. Gurhem <[email protected]>
// D. Dubuc <[email protected]>
Expand Down Expand Up @@ -54,6 +54,7 @@ public static class SubmitterClientExt
/// <returns>
/// The reply to task creation
/// </returns>
[Obsolete]
public static async Task<CreateTaskReply> CreateTasksAsync(this gRPC.V1.Submitter.Submitter.SubmitterClient client,
string sessionId,
TaskOptions? taskOptions,
Expand All @@ -77,6 +78,7 @@ public static async Task<CreateTaskReply> CreateTasksAsync(this gRPC.V1.Submitte
/// <returns>
/// The reply to task creation
/// </returns>
[Obsolete]
public static async Task<CreateTaskReply> CreateTasksAsync(this gRPC.V1.Submitter.Submitter.SubmitterClient client,
string sessionId,
TaskOptions? taskOptions,
Expand Down Expand Up @@ -249,6 +251,7 @@ private static async IAsyncEnumerable<CreateLargeTaskRequest> ToRequestStream(th
/// </returns>
/// <exception cref="Exception">a result reply chunk is not data, rending it impossible to reconstitute the data</exception>
/// <exception cref="ArgumentOutOfRangeException">result reply type is unknown</exception>
[Obsolete]
public static async Task<byte[]> GetResultAsync(this gRPC.V1.Submitter.Submitter.SubmitterClient client,
ResultRequest resultRequest,
CancellationToken cancellationToken = default)
Expand Down
14 changes: 14 additions & 0 deletions packages/csharp/ArmoniK.Api.Mock/Services/Submitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace ArmoniK.Api.Mock.Services;
public class Submitter : gRPC.V1.Submitter.Submitter.SubmitterBase
{
/// <inheritdoc />
[Obsolete]
[Count]
public override Task<Configuration> GetServiceConfiguration(Empty request,
ServerCallContext context)
Expand All @@ -37,18 +38,21 @@ public override Task<Configuration> GetServiceConfiguration(Empty re
});

/// <inheritdoc />
[Obsolete]
[Count]
public override Task<Empty> CancelSession(Session request,
ServerCallContext context)
=> Task.FromResult(new Empty());

/// <inheritdoc />
[Obsolete]
[Count]
public override Task<Empty> CancelTasks(TaskFilter request,
ServerCallContext context)
=> Task.FromResult(new Empty());

/// <inheritdoc />
[Obsolete]
[Count]
public override Task<CreateSessionReply> CreateSession(CreateSessionRequest request,
ServerCallContext context)
Expand All @@ -58,6 +62,7 @@ public override Task<CreateSessionReply> CreateSession(CreateSessionRequest requ
});

/// <inheritdoc />
[Obsolete]
[Count]
public override Task<CreateTaskReply> CreateSmallTasks(CreateSmallTaskRequest request,
ServerCallContext context)
Expand All @@ -69,6 +74,7 @@ public override Task<CreateTaskReply> CreateSmallTasks(CreateSmallTaskRequest re


/// <inheritdoc />
[Obsolete]
[Count]
public override async Task<CreateTaskReply> CreateLargeTasks(IAsyncStreamReader<CreateLargeTaskRequest> requestStream,
ServerCallContext context)
Expand All @@ -85,12 +91,14 @@ public override async Task<CreateTaskReply> CreateLargeTasks(IAsyncStreamReader<
}

/// <inheritdoc />
[Obsolete]
[Count]
public override Task<Count> CountTasks(TaskFilter request,
ServerCallContext context)
=> Task.FromResult(new Count());

/// <inheritdoc />
[Obsolete]
[Count]
public override async Task TryGetResultStream(ResultRequest request,
IServerStreamWriter<ResultReply> responseStream,
Expand All @@ -105,12 +113,14 @@ public override async Task TryGetResultStream(ResultRequest r
.ConfigureAwait(false);

/// <inheritdoc />
[Obsolete]
[Count]
public override Task<Count> WaitForCompletion(WaitRequest request,
ServerCallContext context)
=> Task.FromResult(new Count());

/// <inheritdoc />
[Obsolete]
[Count]
public override Task<Output> TryGetTaskOutput(TaskOutputRequest request,
ServerCallContext context)
Expand All @@ -130,6 +140,7 @@ public override Task<AvailabilityReply> WaitForAvailability(ResultRequest re
});

/// <inheritdoc />
[Obsolete]
[Count]
public override Task<GetTaskStatusReply> GetTaskStatus(GetTaskStatusRequest request,
ServerCallContext context)
Expand All @@ -143,18 +154,21 @@ public override Task<GetResultStatusReply> GetResultStatus(GetResultStatusReques
=> Task.FromResult(new GetResultStatusReply());

/// <inheritdoc />
[Obsolete]
[Count]
public override Task<TaskIdList> ListTasks(TaskFilter request,
ServerCallContext context)
=> Task.FromResult(new TaskIdList());

/// <inheritdoc />
[Obsolete]
[Count]
public override Task<SessionIdList> ListSessions(SessionFilter request,
ServerCallContext context)
=> Task.FromResult(new SessionIdList());

/// <inheritdoc />
[Obsolete]
[Count]
public override async Task WatchResults(IAsyncStreamReader<WatchResultRequest> requestStream,
IServerStreamWriter<WatchResultStream> responseStream,
Expand Down

0 comments on commit 7a79308

Please sign in to comment.