Refactor Connection credential and auth wiring

Abierto
#290 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@jlrobins ya está trabajando en esto.

Desde el 17/11/2026.

  • #327 de @jlrobins — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
6
Forks
1
Merge medio
21 h 16 min
PR fusionados (30 d)
29

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de confluentinc/confluent-sql

Todos los issues de confluentinc/confluent-sql

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.