Refactor Connection credential and auth wiring

Đang mở
#290 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@jlrobins đang làm issue này rồi.

Từ ngày 17/11/2026.

  • #327 của @jlrobins — đang mở

Đá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
48/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

Start by reading Connection.__init__ and the listed auth members and helpers in connection.py; trace the credential branch to see how API key, BYOIDC, and OAuth are resolved. Extract the auth responsibilities into a collaborator and update Connection to use it. Then consider the listed transport builders, service clients, user-agent and timeout properties, and endpoints; done when the behavior is preserved and the responsibilities are grouped as described.

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

Mô tả

Connection.init is too large mostly due to figuring out credential-based logic.

  • the auth-mode members: _byoidc, _oauth, _oauth_provider, _reauth_policy, _global_credentials, _flink_auth, _surface_auth;
  • _auth_for, _send_with_reauth_policy and oauth_metrics;
  • ControlPlaneSurface, _SurfaceSpec and _basic_auth;
  • the module-level _resolve_flink_auth and _resolve_service_credentials;
  • the credential branch of init, roughly 150 of its 330 lines.

A small collaborator, say ConnectionAuth, would resolve the mode (API key, BYOIDC or oauth) once and expose flink_auth, auth_for(surface), send_policy and oauth_metrics. Connection would hold one attribute instead of seven, and the enum and spec dataclass would leave connection.py.

After doing the main work, then also consider the transport functionality to also spin out of class Connection: _build_dataplane_client, _build_controlplane_client, _service_clients, the user-agent and timeout properties, and both endpoints are a coherent group. It would fold naturally into the auth collaborator.

Ngôn ngữ chính
Python
Star
6
Fork
1
Merge trung bình
21 giờ 16 phút
Pull request đã merge (30 ngày)
29

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của confluentinc/confluent-sql

Tất cả issue của confluentinc/confluent-sql

Issue tương tự

Thêm issue về Python

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.