Store a per-profile API URL for multi-environment auth
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Tranquilo
- Stack tecnológico
- rust
- Área
- api, authentication, cli
Línea de trabajo
Start with the TokenStore schema and migration paths, then trace read_token, Authentication::new, fetch_profile_info, and fetch_profiles_with_info. Resolve the open URL-capture decision before implementing. Done means profile URLs round-trip, legacy profiles fall back to the global default, and auth list uses each profile's host in tests.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Background
The multi-profile auth work in #293 stores only a token per profile, and every command resolves the API host from the single API_BASE_URL (defaulting to prod). Since multi-profile usually means multi-environment (for example a prod profile and a stage profile), this means:
auth listsends every stored token to the one host, so a stage token gets transmitted to the prod host and then shows blank because it 401s.- There is no way to keep a profile pinned to the environment its token belongs to.
Raised by @sergey-borovkov in review: it is much cheaper to decide the storage format now, while it is new, than to migrate it a second time later.
Proposal
Store an optional API URL per profile and use it wherever a profile's token is used (read_token/Authentication::new, fetch_profile_info, fetch_profiles_with_info). Profiles without a URL (including migrated legacy ones) fall back to the current global default, so this stays backward compatible.
Open decision — how is the URL captured?
This is the reason it was deferred from #293 rather than guessed at. Options:
screenly login --url <url>— explicit, but one more flag to pass.- Capture the resolved
API_BASE_URL(env or default) at login time and store it — zero new flags, but implicit and easy to get wrong if the env var isn't set. - Both:
--urloverrides, otherwise capture the resolved base URL.
Option 3 is probably the most forgiving. Worth agreeing on before implementing.
Scope / touch points
TokenStoreschema: each entry becomes token + optional url (migration-safe, since serdeOptiondefaults toNone).- Migration: legacy plain-text and existing single-token stores get
url: None→ global default. read_token/Authentication::new: resolve the active profile's url alongside its token.fetch_profile_info/fetch_profiles_with_info: use the per-profile url.- Tests: per-profile url round-trips, fallback to default when absent,
auth listhits each profile's own host.
Notes
- Not a blocker for #293; that PR intentionally leaves this out.
- Backward compatible if the url field is optional with a default.
- Lenguaje dominante
- Rust
- Estrellas
- 29
- Forks
- 7
- Merge medio
- 2 d 11 h
- PR fusionados (30 d)
- 9
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Screenly/cli
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
Improve error messages when not logged inQuizá libre de nuevo @sergey-borovkov la tomó hace 295 días y no hay ningún pull request abierto. Abierto
Screenly/cli#270 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
Todos los issues de Screenly/cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
linebender/parley#849 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
boxlite-ai/boxlite#1729 ·
Los mantenedores suelen responder en 1 día
-
external
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
langchain-ai/docs#6255 ·
Los mantenedores suelen responder en 1 día
-
P2 testing
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día