`flagsmith login` fails on a self-hosted instance that isn't served at `http://localhost:8000`
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- docker-compose, go
- Área
- cli, documentation
Línea de trabajo
Comienza por internal/cmd/login.go, donde se devuelve el error de discrepancia del emisor, y internal/auth/oauth.go, donde se detecta la discrepancia. Amplía la sugerencia de la CLI para mencionar FLAGSMITH_API_URL, FLAGSMITH_FRONTEND_URL y la variable de clave de API específica del host. Después, actualiza la documentación de las variables de entorno para enumerar ambos ajustes del servidor en su sección de API.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Self-hosted 2.294.0 (docker.flagsmith.com/flagsmith/flagsmith:2.294.0, Docker Compose) with the API published on localhost:18101, and @flagsmith/cli 2.0.0.
$ flagsmith login --api-url http://localhost:18101 --no-browser
Error: authorization server metadata is for http://localhost:8000, not http://localhost:18101 — use the instance's canonical API URL
The instance's discovery document still describes the default URLs:
$ curl -s http://localhost:18101/.well-known/oauth-authorization-server
{"issuer": "http://localhost:8000", "authorization_endpoint": "http://localhost:8080/oauth/authorize/", "token_endpoint": "http://localhost:8000/o/token/", ...}
The server builds it from FLAGSMITH_API_URL and FLAGSMITH_FRONTEND_URL, which default to http://localhost:8000 and http://localhost:8080 (common.py L982-L985, oauth2_metadata/views.py L46-L47). The CLI is right to refuse the mismatch (oauth.go L69-L71), but the error gives no hint: browserLogin only adds one for ErrNoDiscovery (login.go L85-L90). "Canonical API URL" points at the CLI flag, when the fix is a server setting.
The docs don't help either. The environment variables page lists FLAGSMITH_API_URL only as a frontend variable (with an /api/v1/ example) and doesn't mention FLAGSMITH_FRONTEND_URL.
The default docker-compose.yml sets neither, so on port 8000 the issuer matches but authorization_endpoint points at 8080, while the dashboard is on 8000. I haven't tried login on port 8000 itself. The run locally with a coding agent guide already says to use an organisation API key, not flagsmith login.
Workaround:
export FLAGSMITH_API_URL=http://localhost:18101
export FLAGSMITH_API_KEY_localhost_18101=<organisation API key>
Suggestions:
- When the issuer doesn't match, add a hint that names the server settings (
FLAGSMITH_API_URL,FLAGSMITH_FRONTEND_URL) and the host-scoped key variable, astooOldForOAuthHintdoes for older servers (#76). - Document both settings in the API section of the environment variables page.
- Lenguaje dominante
- Go
- Estrellas
- 14
- Forks
- 4
- Merge medio
- 3 d 7 h
- PR fusionados (30 d)
- 4
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
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 Flagsmith/flagsmith-cli
-
`feature create --variants` ignores each variant's `key`Posiblemente ocupada @Anuragkumar-687 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Flagsmith/flagsmith-cli#126 ·
Los mantenedores suelen responder en 2 días
-
`feature variant update` fails with a 500: the API needs `feature` and `default_percentage_allocation` in the PATCHPosiblemente ocupada @Anuragkumar-687 la tomó hoy. Abierto
Dificultad 3/5 Medio día Aptitud para principiantes 45/100
Flagsmith/flagsmith-cli#125 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Flagsmith/flagsmith-cli#107 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Flagsmith/flagsmith-cli#93 ·
Los mantenedores suelen responder en 2 días
-
Dependency DashboardAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
Flagsmith/flagsmith-cli#90 ·
Los mantenedores suelen responder en 2 días
Todos los issues de Flagsmith/flagsmith-cli
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
expr-lang/expr#1037 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Provider Key: Sauberr/neckrezAbiertoprovider-key submission
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
opentofu/registry#6740 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
nightgauge/nightgauge#3713 ·
Los mantenedores suelen responder en 1 día
-
fix: restore GitHub issue templates and check their license headersPosiblemente ocupada @slievrly la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días