diff options
author | 2015-09-23 20:14:56 -0700 | |
---|---|---|
committer | 2015-10-06 14:07:40 -0700 | |
commit | 74f39e185eaddfb07e9b024b0d8aec547cd83821 (patch) | |
tree | d56e5393b18f1b8e49877aad640e3b15690515ee /src/csharp/Grpc.Core/CallOptions.cs | |
parent | 5bd75d789c77891b6dfee3dd619a67ec5be444d3 (diff) |
Migrate C# to the new auth API
Diffstat (limited to 'src/csharp/Grpc.Core/CallOptions.cs')
-rw-r--r-- | src/csharp/Grpc.Core/CallOptions.cs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/csharp/Grpc.Core/CallOptions.cs b/src/csharp/Grpc.Core/CallOptions.cs index c3bc9c3156..c708fcdfc4 100644 --- a/src/csharp/Grpc.Core/CallOptions.cs +++ b/src/csharp/Grpc.Core/CallOptions.cs @@ -49,6 +49,7 @@ namespace Grpc.Core CancellationToken cancellationToken; WriteOptions writeOptions; ContextPropagationToken propagationToken; + Credentials credentials; /// <summary> /// Creates a new instance of <c>CallOptions</c> struct. @@ -58,14 +59,16 @@ namespace Grpc.Core /// <param name="cancellationToken">Can be used to request cancellation of the call.</param> /// <param name="writeOptions">Write options that will be used for this call.</param> /// <param name="propagationToken">Context propagation token obtained from <see cref="ServerCallContext"/>.</param> + /// <param name="credentials">Credentials to use for this call.</param> public CallOptions(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken), - WriteOptions writeOptions = null, ContextPropagationToken propagationToken = null) + WriteOptions writeOptions = null, ContextPropagationToken propagationToken = null, Credentials credentials = null) { this.headers = headers; this.deadline = deadline; this.cancellationToken = cancellationToken; this.writeOptions = writeOptions; this.propagationToken = propagationToken; + this.credentials = credentials; } /// <summary> @@ -115,6 +118,17 @@ namespace Grpc.Core } /// <summary> + /// Credentials to use for this call. + /// </summary> + public Credentials Credentials + { + get + { + return this.credentials; + } + } + + /// <summary> /// Returns new instance of <see cref="CallOptions"/> with /// <c>Headers</c> set to the value provided. Values of all other fields are preserved. /// </summary> |