Exemplo n.º 1
0
        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);
        }
Exemplo n.º 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;
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 4
0
 public static CallCredentialsSafeHandle CreateComposite(CallCredentialsSafeHandle creds1, CallCredentialsSafeHandle creds2)
 {
     return pinvoke.grpcsharp_composite_call_credentials_create(creds1, creds2);
 }
Exemplo n.º 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);
Exemplo n.º 7
0
 GRPCCallError IPlatformInvocation.grpcsharp_call_set_credentials(CallSafeHandle call,
     CallCredentialsSafeHandle credentials)
 {
     return grpcsharp_call_set_credentials(call, credentials);
 }
Exemplo n.º 8
0
 CallCredentialsSafeHandle IPlatformInvocation.grpcsharp_composite_call_credentials_create(CallCredentialsSafeHandle creds1, CallCredentialsSafeHandle creds2)
 {
     return grpcsharp_composite_call_credentials_create(creds1, creds2);
 }
Exemplo n.º 9
0
 internal static extern CallCredentialsSafeHandle grpcsharp_composite_call_credentials_create(CallCredentialsSafeHandle creds1, CallCredentialsSafeHandle creds2);
Exemplo n.º 10
0
 internal static extern ChannelCredentialsSafeHandle grpcsharp_composite_channel_credentials_create(ChannelCredentialsSafeHandle channelCreds, CallCredentialsSafeHandle callCreds);
Exemplo n.º 11
0
 internal static extern CallError grpcsharp_call_set_credentials(CallSafeHandle call, CallCredentialsSafeHandle credentials);
Exemplo n.º 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);
        }
Exemplo n.º 13
0
 ChannelCredentialsSafeHandle IPlatformInvocation.grpcsharp_composite_channel_credentials_create(
     ChannelCredentialsSafeHandle channelCreds, CallCredentialsSafeHandle callCreds)
 {
     return(grpcsharp_composite_channel_credentials_create(channelCreds, callCreds));
 }
Exemplo n.º 14
0
 GRPCCallError IPlatformInvocation.grpcsharp_call_set_credentials(CallSafeHandle call,
                                                                  CallCredentialsSafeHandle credentials)
 {
     return(grpcsharp_call_set_credentials(call, credentials));
 }
Exemplo n.º 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();
 }
Exemplo n.º 17
0
 static extern CallCredentialsSafeHandle grpcsharp_composite_call_credentials_create(CallCredentialsSafeHandle creds1, CallCredentialsSafeHandle creds2);
Exemplo n.º 18
0
 public static ChannelCredentialsSafeHandle CreateComposite(ChannelCredentialsSafeHandle channelCreds, CallCredentialsSafeHandle callCreds)
 {
     return(Native.grpcsharp_composite_channel_credentials_create(channelCreds, callCreds));
 }
Exemplo n.º 19
0
 static extern GRPCCallError grpcsharp_call_set_credentials(CallSafeHandle call, CallCredentialsSafeHandle credentials);
Exemplo n.º 20
0
 public void SetCredentials(CallCredentialsSafeHandle credentials)
 {
     Native.grpcsharp_call_set_credentials(this, credentials).CheckOk();
 }
Exemplo n.º 21
0
 ChannelCredentialsSafeHandle IPlatformInvocation.grpcsharp_composite_channel_credentials_create(
     ChannelCredentialsSafeHandle channelCreds, CallCredentialsSafeHandle callCreds)
 {
     return grpcsharp_composite_channel_credentials_create(channelCreds, callCreds);
 }
Exemplo n.º 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);
 }