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