google-api-ruby-client: Batch per-request authentication is ignored
Environment details
- OS: Ubuntu, linux last
- Ruby version: ruby 2.4.5
- Gem name and version: google-api-client ~> .030
Steps to reproduce
1. events = []
page_token = nil
access_tokens = []
calendar = Calendar::CalendarService.new
GoogleIdentity.last(2).each do |e|
access_tokens << e.fresh_token
end
calendar.batch do |calendar|
access_tokens.each do |token|
calendar.list_events('primary', options: { authorization: GoogleAccessToken.new(token) }, page_token: page_token, q: query, max_results: 2500, time_min: min_date, show_deleted: show_deleted) do |response, error|
p 'i=' * 10
p token
p 'response=' * 10
p response
p 'error=' * 10
p error
end
end
end
The response is
Error - #<Google::Apis::ClientError: dailyLimitExceededUnreg: Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.>
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (15 by maintainers)
Commits related to this issue
- fix: Add Auth header to individual batch requests * Fixes an issue where the authorization HTTP header wasn't being applied to individual batch requests. [pr #822, refs #817] — committed to googleapis/google-api-ruby-client by deleted user 5 years ago
- fix: Use apply_request_options for batch auth header Use HttpCommand#apply_request_options to add the Authorization header for individual batch requests, as it supports both OAuth token strings and ... — committed to googleapis/google-api-ruby-client by blowmage 5 years ago
The Sending Batch Requests does say each batched call can have its own Authorization header.