github / github/copilot-sdk

[Task] Add org installation S2S credential renewal to the Copilot SDK

Đang mở
#2,540 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Java
Star
10.5k
Fork
1.5k
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
128

Mô tả

## Outcome

Long-running SDK sessions can refresh GitHub App credentials without restarting the session or forcing repeated OAuth flows.

## Scope

- Add a supported credential-provider mechanism for lazy or proactive refresh
- Support S2S installation token re-minting before or after the one-hour expiry
- Support U2S refresh tokens and discoverable token lifetime policies
- Retry safely when a token expires during a turn
- Replace reliance on the experimental `session.auth.setCredentials` workaround
- Preserve existing static token behavior

## Acceptance criteria

- [ ] A session running longer than one S2S token lifetime continues without manual token injection
- [ ] A request encountering token expiry can obtain a fresh credential and retry without duplicating unsafe work
- [ ] U2S refresh does not force a new interactive OAuth flow on normal expiry
- [ ] Refresh failures surface clearly and never silently fall back to another identity
- [ ] Node, Go, .NET, and Java SDK behavior is consistent or explicitly staged
- [ ] Public SDK documentation includes secure private-key and refresh guidance

## Dependencies

Coordinate runtime credential update behavior with the bundled CLI. The basic `gitHubToken` acceptance fix remains tracked in github/copilot#30423.

## References

- Parent epic https://github.com/github/copilot/issues/30409
- ADR https://github.com/github/copilot/pull/30449
- Existing prior art github/copilot-sdk#1748

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với ADR github/copilot#30449, công việc trước đó github/copilot-sdk#1748 và epic cha github/copilot#30409. Xem xét các entry point credential-provider và session-auth của SDK, sau đó phối hợp việc cập nhật credential trong thời gian chạy với CLI đi kèm. Hoàn tất có nghĩa là có refresh S2S và U2S an toàn, hành vi retry khi hết hạn, giữ nguyên các token tĩnh, hành vi SDK nhất quán hoặc được triển khai theo từng giai đoạn, cùng tài liệu công khai an toàn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
github, go, java, node.js
Lĩnh vực
api, authentication, backend-api-design, security
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.