Grpc.Core.Api nullable fixes (#28616)

pull/28610/head
James Newton-King 3 years ago committed by GitHub
parent 402981be8e
commit 257183f5ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/csharp/Grpc.Core.Api/AuthContext.cs
  2. 6
      src/csharp/Grpc.Core.Api/CallCredentials.cs
  3. 4
      src/csharp/Grpc.Core.Api/CallCredentialsConfiguratorBase.cs
  4. 2
      src/csharp/Grpc.Core.Api/IAsyncStreamWriter.cs
  5. 4
      src/csharp/Grpc.Core.Api/ServerCallContext.cs

@ -31,7 +31,7 @@ namespace Grpc.Core
/// </summary>
public class AuthContext
{
string peerIdentityPropertyName;
string? peerIdentityPropertyName;
Dictionary<string, List<AuthProperty>> properties;
/// <summary>
@ -39,7 +39,7 @@ namespace Grpc.Core
/// </summary>
/// <param name="peerIdentityPropertyName">Peer identity property name.</param>
/// <param name="properties">Multimap of auth properties by name.</param>
public AuthContext(string peerIdentityPropertyName, Dictionary<string, List<AuthProperty>> properties)
public AuthContext(string? peerIdentityPropertyName, Dictionary<string, List<AuthProperty>> properties)
{
this.peerIdentityPropertyName = peerIdentityPropertyName;
this.properties = GrpcPreconditions.CheckNotNull(properties);
@ -60,7 +60,7 @@ namespace Grpc.Core
/// Gets the name of the property that indicates the peer identity. Returns <c>null</c>
/// if the peer is not authenticated.
/// </summary>
public string PeerIdentityPropertyName
public string? PeerIdentityPropertyName
{
get
{

@ -54,7 +54,7 @@ namespace Grpc.Core
/// Populates call credentials configurator with this instance's configuration.
/// End users never need to invoke this method as it is part of internal implementation.
/// </summary>
public abstract void InternalPopulateConfiguration(CallCredentialsConfiguratorBase configurator, object state);
public abstract void InternalPopulateConfiguration(CallCredentialsConfiguratorBase configurator, object? state);
private class CompositeCallCredentials : CallCredentials
{
@ -66,7 +66,7 @@ namespace Grpc.Core
this.credentials = new List<CallCredentials>(credentials).AsReadOnly();
}
public override void InternalPopulateConfiguration(CallCredentialsConfiguratorBase configurator, object state)
public override void InternalPopulateConfiguration(CallCredentialsConfiguratorBase configurator, object? state)
{
configurator.SetCompositeCredentials(state, credentials);
}
@ -81,7 +81,7 @@ namespace Grpc.Core
this.interceptor = GrpcPreconditions.CheckNotNull(interceptor);
}
public override void InternalPopulateConfiguration(CallCredentialsConfiguratorBase configurator, object state)
public override void InternalPopulateConfiguration(CallCredentialsConfiguratorBase configurator, object? state)
{
configurator.SetAsyncAuthInterceptorCredentials(state, interceptor);
}

@ -29,11 +29,11 @@ namespace Grpc.Core
/// <summary>
/// Consumes configuration for composite call credentials.
/// </summary>
public abstract void SetCompositeCredentials(object state, IReadOnlyList<CallCredentials> credentials);
public abstract void SetCompositeCredentials(object? state, IReadOnlyList<CallCredentials> credentials);
/// <summary>
/// Consumes configuration for call credentials created from <c>AsyncAuthInterceptor</c>
/// </summary>
public abstract void SetAsyncAuthInterceptorCredentials(object state, AsyncAuthInterceptor interceptor);
public abstract void SetAsyncAuthInterceptorCredentials(object? state, AsyncAuthInterceptor interceptor);
}
}

@ -42,6 +42,6 @@ namespace Grpc.Core
/// Once set, this property maintains its value across subsequent
/// writes.
/// </summary>
WriteOptions WriteOptions { get; set; }
WriteOptions? WriteOptions { get; set; }
}
}

@ -97,7 +97,7 @@ namespace Grpc.Core
/// For streaming response calls, this property is also exposed as on IServerStreamWriter for convenience.
/// Both properties are backed by the same underlying value.
/// </summary>
public WriteOptions WriteOptions
public WriteOptions? WriteOptions
{
get
{
@ -143,7 +143,7 @@ namespace Grpc.Core
/// <summary>Provides implementation of a non-virtual public member.</summary>
protected abstract Status StatusCore { get; set; }
/// <summary>Provides implementation of a non-virtual public member.</summary>
protected abstract WriteOptions WriteOptionsCore { get; set; }
protected abstract WriteOptions? WriteOptionsCore { get; set; }
/// <summary>Provides implementation of a non-virtual public member.</summary>
protected abstract AuthContext AuthContextCore { get; }
/// <summary>Provides implementation of a non-virtual public member.</summary>

Loading…
Cancel
Save