Bug : When SSO login is started twice within the same running process, the CLI crashes with a panic
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 72/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- go
- Bereich
- authentication, cli
Rechercherichtung
Start at the oauth2login entry point and inspect how it registers /auth/callback on Go’s global HTTP router. Reproduce the failure with the provided TestReproduceSSODuplicateCallbackPanic case, then verify that invoking SSO login twice returns normally without a duplicate-route panic and that the existing login flow still works.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Describe the bug
When SSO login is started twice within the same running process, the CLI crashes with a panic:
This happens because oauth2login registers /auth/callback on Go’s global HTTP router every time it runs. The second registration causes Go to panic.
Steps to reproduce:
- Start SSO login once.
- Start SSO login again in the same process.
- Observe the panic.
here is the Panic: `panic: pattern "/auth/callback" conflicts with pattern "/auth/callback"
The issue can be reproduced with:
package cmd
import (
"context"
"testing"
"time"
"golang.org/x/oauth2"
)
func TestReproduceSSODuplicateCallbackPanic(t *testing.T) {
config := &oauth2.Config{
Endpoint: oauth2.Endpoint{
AuthURL: "http://127.0.0.1",
TokenURL: "http://127.0.0.1",
},
}
go func() {
_, _, _ = oauth2login(context.Background(), 0, config, false)
}()
time.Sleep(2 * time.Second)
// The second invocation registers /auth/callback again and panics.
_, _, _ = oauth2login(context.Background(), 0, config, false)
}
Expected behavior:
- The second login should return a normal error or create its own temporary callback server.
Actual behavior:
- The process crashes with a panic and stack trace.
Impact:
- Applications, tests, or services that reuse the CLI cannot safely perform multiple SSO logins.
Suggested fix:
- Use a private http.ServeMux for each login instead of the global http.DefaultServeMux..
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
No response
Microcks version or git rev
No response
Install method (docker-compose, helm chart, operator, docker-desktop extension,...)
No response
Additional information
@Harsh4902
Please review and assign if valid
- Vorherrschende Sprache
- Go
- Sterne
- 58
- Forks
- 72
- Ø Merge
- 1 T. 7 Std.
- Gemergte PRs (30 T.)
- 22
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microcks/microcks-cli
-
Wrong link to test resultsEvtl. wieder frei @SajanBisht hat das vor 8 Tagen übernommen, und es ist kein Pull Request offen. Offencomponent/cli keep-open kind/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
microcks/microcks-cli#589 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Default configuration path falls back to the current directory when the home directory cannot be determinedEvtl. vergeben @Sarthak-Shreshtha01 hat das vor 11 Tagen übernommen. Offencomponent/cli kind/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
microcks/microcks-cli#583 · 5 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
microcks test exits with code 1 (contract failure) instead of code 11 (connection) when polling loop times outEvtl. vergeben @ish-g09 hat das vor 10 Tagen übernommen. Offencomponent/cli kind/bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
microcks/microcks-cli#573 · 5 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug: YAML parse error in config is silently swallowed, login overwrites all other contextsEvtl. vergeben @Sarthak-Shreshtha01 hat das vor 17 Tagen übernommen. Offencomponent/cli kind/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
microcks/microcks-cli#572 · 6 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
import-dir uploads secondary artifacts before their primary API definitionEvtl. vergeben @doraem-on hat das vor 24 Tagen übernommen. Offencomponent/cli kind/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
microcks/microcks-cli#561 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in microcks/microcks-cli
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
prime-radiant-inc/evener#5028 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
-
[BUG] v4.2.9 PostgreSQL 启动迁移失败:DROP INDEX CURRENT_SCHEMA() 语法错误Evtl. vergeben @renovate hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
OpenListTeam/OpenList#3267 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
openpubkey/opkssh#670 ·
Maintainer antworten meist innerhalb von 1 Tag