Switching to HTTP/2 makes calendarList.list() complain about invalid authentication
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, nodejs
- Lĩnh vực
- api, authentication, networking
Hướng nghiên cứu
Bắt đầu bằng cách chạy bản tái hiện OAuth2 độc lập với google.options({ http2: true }) và calendarApi.calendarList.list(), sau đó kiểm tra đường dẫn yêu cầu HTTP/2 được client Node.js sử dụng để xử lý Authorization. So sánh với đường dẫn không dùng HTTP/2; được xem là hoàn tất khi các yêu cầu calendar-list đã xác thực không còn trả về 401 khi HTTP/2 được bật.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I have an application that uses an access token to request a list of calendars and then deletes and creates batches of events in a specific calendar.
Everything works, but when I switch on HTTP/2 support:
google.options({
http2: true
})
I get this exception when making the await calendarApi.calendarList.list() call:
Request failed with status code 401.
'{
error: {
code: 401,
message: 'Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.',
errors: [
{
message: 'Invalid Credentials',
domain: 'global',
reason: 'authError',
location: 'Authorization',
locationType: 'header'
}
],
status: 'UNAUTHENTICATED'
}
}
Here's my code (using dotenv and extracted from my project as a standalone test case):
#!/usr/bin/env node
import 'dotenv/config'
import { google } from 'googleapis'
// When this is turned on, requesting the calendar list fails
google.options({ http2: true })
const authClient = new google.auth.OAuth2(
process.env.GOOGLE_CLIENT_ID,
process.env.GOOGLE_CLIENT_SECRET,
'http://localhost:2024',
)
authClient.setCredentials({
access_token: process.env.GOOGLE_ACCESS_TOKEN,
refresh_token: process.env.GOOGLE_REFRESH_TOKEN,
})
const calendarApi = google.calendar({
version: 'v3',
auth: authClient,
})
let response
try {
console.log('Requesting list of calendars...')
response = await calendarApi.calendarList.list()
} catch(e) {
console.error(e.message)
process.exit(1)
}
console.log(response.data.items)
I'm using googleapis 144.0.0 and I tried multiple older versions and the result is the same.
My motivation for switching to HTTP/2 was hitting the "rate limit exceeded" error while performing too many simultaneous operations.
@jrmdayn's drop-in batch request add-on seems to work perfectly for batching the operations and not hitting the rate limit albeit without using HTTP/2, as per https://github.com/googleapis/google-api-nodejs-client/issues/2375#issuecomment-1377330182.
However, I'm still interested in switching to HTTP/2 for its performance benefits and due to it being the new standard.
@JustinBeckwith, I see that you've done a lot of work on the HTTP/2 implementation (#1130). I don't know if you can tell right away what is going on here.
- Ngôn ngữ chính
- TypeScript
- Star
- 12.3k
- Fork
- 2k
- Merge trung bình
- 1 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 21
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của googleapis/google-api-nodejs-client
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 32/100
googleapis/google-api-nodejs-client#3932 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Discovery Engine] streamAnswer is typed as one AnswerQueryResponse, but REST returns frame arraysĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
googleapis/google-api-nodejs-client#3930 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
googleapis/google-api-nodejs-client#3927 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
size: l type: feature request
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
googleapis/google-api-nodejs-client#3926 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
type: feature request
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
googleapis/google-api-nodejs-client#3903 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của googleapis/google-api-nodejs-client
Issue tương tự
-
needs:triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-discovered
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
jessepollak/home#1627 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent-canvas bug llm priority:low ready-for-dev
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
OpenHands/OpenHands#17806 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
radius-project/ai-extensions#923 ·
Maintainer thường phản hồi trong vòng 1 ngày