microsoft / kiota-abstractions-ruby

Abstractions library for the Kiota generated SDKs in Ruby
https://aka.ms/kiota/docs
MIT License
2 stars 4 forks source link

AnonymousAuthenticationProvider causes HTTP layer to throw error #7

Open jasonjoh opened 1 year ago

jasonjoh commented 1 year ago
auth_provider = MicrosoftKiotaAbstractions::AnonymousAuthenticationProvider.new()
request_adapter = MicrosoftKiotaFaraday::FaradayRequestAdapter.new(auth_provider)
client = Client::PostsClient.new(request_adapter)

all_posts = client.posts_by_id("5").get.resume

This results in the following error:

/home/jasonjoh/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/microsoft_kiota_faraday-0.11.0/lib/microsoft_kiota_faraday/faraday_request_adapter.rb:52:in `block in send_async': undefined method `resume' for nil:NilClass (NoMethodError)

        @authentication_provider.authenticate_request(request_info).resume

As a test, I modified anonymous_authentication_provider.rb, changing the authenticate_request to:

def authenticate_request(request)
  Fiber.new do
  end
end

And that resolved the error.