public NativeMetadataCredentialsPlugin(AsyncAuthInterceptor interceptor)
        {
            this.interceptor = GrpcPreconditions.CheckNotNull(interceptor, "interceptor");
            this.nativeInterceptor = NativeMetadataInterceptorHandler;

            // Make sure the callback doesn't get garbage collected until it is destroyed.
            this.gcHandle = GCHandle.Alloc(this.nativeInterceptor, GCHandleType.Normal);
            this.credentials = Native.grpcsharp_metadata_credentials_create_from_plugin(nativeInterceptor);
        }
示例#2
0
 public CallSafeHandle CreateCall(CallSafeHandle parentCall, ContextPropagationFlags propagationMask, CompletionQueueSafeHandle cq, string method, string host, Timespec deadline, CallCredentialsSafeHandle credentials)
 {
     var result = Native.grpcsharp_channel_create_call(this, parentCall, propagationMask, cq, method, host, deadline);
     if (credentials != null)
     {
         result.SetCredentials(credentials);
     }
     result.Initialize(cq);
     return result;
 }
示例#3
0
 public CallSafeHandle CreateCall(CompletionRegistry registry, CallSafeHandle parentCall, ContextPropagationFlags propagationMask, CompletionQueueSafeHandle cq, string method, string host, Timespec deadline, CallCredentialsSafeHandle credentials)
 {
     using (Profilers.ForCurrentThread().NewScope("ChannelSafeHandle.CreateCall"))
     {
         var result = Native.grpcsharp_channel_create_call(this, parentCall, propagationMask, cq, method, host, deadline);
         if (credentials != null)
         {
             result.SetCredentials(credentials);
         }
         result.Initialize(registry, cq);
         return result;
     }
 }
示例#4
0
 public static CallCredentialsSafeHandle CreateComposite(CallCredentialsSafeHandle creds1, CallCredentialsSafeHandle creds2)
 {
     return pinvoke.grpcsharp_composite_call_credentials_create(creds1, creds2);
 }
示例#5
0
 public CallSafeHandle CreateCall(CompletionRegistry registry, CallSafeHandle parentCall, ContextPropagationFlags propagationMask, CompletionQueueSafeHandle cq, string method, string host, Timespec deadline, CallCredentialsSafeHandle credentials)
 {
     using (Profilers.ForCurrentThread().NewScope("ChannelSafeHandle.CreateCall"))
     {
         var result = grpcsharp_channel_create_call(this, parentCall, propagationMask, cq, method, host, deadline);
         if (credentials != null)
         {
             result.SetCredentials(credentials);
         }
         result.SetCompletionRegistry(registry);
         return(result);
     }
 }
 static extern ChannelCredentialsSafeHandle grpcsharp_composite_channel_credentials_create(ChannelCredentialsSafeHandle channelCreds, CallCredentialsSafeHandle callCreds);
示例#7
0
 GRPCCallError IPlatformInvocation.grpcsharp_call_set_credentials(CallSafeHandle call,
     CallCredentialsSafeHandle credentials)
 {
     return grpcsharp_call_set_credentials(call, credentials);
 }
示例#8
0
 CallCredentialsSafeHandle IPlatformInvocation.grpcsharp_composite_call_credentials_create(CallCredentialsSafeHandle creds1, CallCredentialsSafeHandle creds2)
 {
     return grpcsharp_composite_call_credentials_create(creds1, creds2);
 }
 internal static extern CallCredentialsSafeHandle grpcsharp_composite_call_credentials_create(CallCredentialsSafeHandle creds1, CallCredentialsSafeHandle creds2);
示例#10
0
 internal static extern ChannelCredentialsSafeHandle grpcsharp_composite_channel_credentials_create(ChannelCredentialsSafeHandle channelCreds, CallCredentialsSafeHandle callCreds);
示例#11
0
 internal static extern CallError grpcsharp_call_set_credentials(CallSafeHandle call, CallCredentialsSafeHandle credentials);
示例#12
0
        public CallSafeHandle CreateCall(CallSafeHandle parentCall, ContextPropagationFlags propagationMask, CompletionQueueSafeHandle cq, string method, string host, Timespec deadline, CallCredentialsSafeHandle credentials)
        {
            var result = Native.grpcsharp_channel_create_call(this, parentCall, propagationMask, cq, method, host, deadline);

            if (credentials != null)
            {
                result.SetCredentials(credentials);
            }
            result.Initialize(cq);
            return(result);
        }
示例#13
0
 ChannelCredentialsSafeHandle IPlatformInvocation.grpcsharp_composite_channel_credentials_create(
     ChannelCredentialsSafeHandle channelCreds, CallCredentialsSafeHandle callCreds)
 {
     return(grpcsharp_composite_channel_credentials_create(channelCreds, callCreds));
 }
示例#14
0
 GRPCCallError IPlatformInvocation.grpcsharp_call_set_credentials(CallSafeHandle call,
                                                                  CallCredentialsSafeHandle credentials)
 {
     return(grpcsharp_call_set_credentials(call, credentials));
 }
示例#15
0
 CallCredentialsSafeHandle IPlatformInvocation.grpcsharp_composite_call_credentials_create(CallCredentialsSafeHandle creds1, CallCredentialsSafeHandle creds2)
 {
     return(grpcsharp_composite_call_credentials_create(creds1, creds2));
 }
 public void SetCredentials(CallCredentialsSafeHandle credentials)
 {
     Native.grpcsharp_call_set_credentials(this, credentials).CheckOk();
 }
示例#17
0
 static extern CallCredentialsSafeHandle grpcsharp_composite_call_credentials_create(CallCredentialsSafeHandle creds1, CallCredentialsSafeHandle creds2);
示例#18
0
 public static ChannelCredentialsSafeHandle CreateComposite(ChannelCredentialsSafeHandle channelCreds, CallCredentialsSafeHandle callCreds)
 {
     return(Native.grpcsharp_composite_channel_credentials_create(channelCreds, callCreds));
 }
示例#19
0
 static extern GRPCCallError grpcsharp_call_set_credentials(CallSafeHandle call, CallCredentialsSafeHandle credentials);
示例#20
0
 public void SetCredentials(CallCredentialsSafeHandle credentials)
 {
     Native.grpcsharp_call_set_credentials(this, credentials).CheckOk();
 }
示例#21
0
 ChannelCredentialsSafeHandle IPlatformInvocation.grpcsharp_composite_channel_credentials_create(
     ChannelCredentialsSafeHandle channelCreds, CallCredentialsSafeHandle callCreds)
 {
     return grpcsharp_composite_channel_credentials_create(channelCreds, callCreds);
 }
示例#22
0
 public static CallCredentialsSafeHandle CreateComposite(CallCredentialsSafeHandle creds1, CallCredentialsSafeHandle creds2)
 {
     return(Native.grpcsharp_composite_call_credentials_create(creds1, creds2));
 }
 public static ChannelCredentialsSafeHandle CreateComposite(ChannelCredentialsSafeHandle channelCreds, CallCredentialsSafeHandle callCreds)
 {
     return grpcsharp_composite_channel_credentials_create(channelCreds, callCreds);
 }
 public NativeMetadataCredentialsPlugin(AsyncAuthInterceptor interceptor)
 {
     this.interceptor          = GrpcPreconditions.CheckNotNull(interceptor, "interceptor");
     this.callbackRegistration = NativeCallbackDispatcher.RegisterCallback(HandleUniversalCallback);
     this.credentials          = Native.grpcsharp_metadata_credentials_create_from_plugin(this.callbackRegistration.Tag);
 }