Module: GRPC::Core::CompositeCredentialsHandler Private

Defined in:
src/ruby/lib/grpc/core/credentials_helper.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Prepended into ClientStub when the pure Ruby credentials path is active. Handles CompositeChannelCredentials splitting and applies credentials via metadata injection instead of the C extension set_credentials! path.

Instance Method Summary collapse

Instance Method Details

#initialize(host, creds, channel_override: nil, timeout: nil, propagate_mask: nil, channel_args: {}, interceptors: []) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'src/ruby/lib/grpc/core/credentials_helper.rb', line 86

def initialize(host, creds,
               channel_override: nil,
               timeout: nil,
               propagate_mask: nil,
               channel_args: {},
               interceptors: [])
  if creds.is_a?(Core::CompositeChannelCredentials)
    pure_call_creds = creds.call_credentials
    creds = creds.channel_credentials
    super(host, creds,
          channel_override: channel_override,
          timeout: timeout,
          propagate_mask: propagate_mask,
          channel_args: channel_args,
          interceptors: interceptors)
    @call_creds = pure_call_creds
  else
    super
  end
end

#new_active_call(method, marshal, unmarshal, deadline: nil, parent: nil, credentials: nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

credentials is intentionally overridden to nil in super to skip set_credentials!



108
109
110
111
112
113
114
115
116
# File 'src/ruby/lib/grpc/core/credentials_helper.rb', line 108

def new_active_call(method, marshal, unmarshal,
                    deadline: nil,
                    parent: nil,
                    credentials: nil) # rubocop:disable Lint/UnusedMethodArgument
  super(method, marshal, unmarshal,
        deadline: deadline,
        parent: parent,
        credentials: nil)
end