Bug : When SSO login is started twice within the same running process, the CLI crashes with a panic
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
- #571 de @Sarthak-Shreshtha01 — fechado sem integrar
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 72/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- go
- Domínio
- authentication, cli
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Go
- Estrelas
- 59
- Forks
- 74
- Merge médio
- 4d 5h
- PRs com merge (30d)
- 15
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microcks/microcks-cli
-
Malformed local configuration is silently accepted and can be overwrittenTalvez já em andamento @aniket866 assumiu há 2 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
microcks/microcks-cli#615 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
microcks/microcks-cli#610 ·
Mantenedores costumam responder em até 1 dia
-
bug: microcks test get swallows test failure details and operation results in text output modeAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
microcks/microcks-cli#608 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
microcks/microcks-cli#606 ·
Mantenedores costumam responder em até 1 dia
-
Windows test failures in MockFileSystem.Walk due to path separatorTalvez já em andamento @dipak0000812 assumiu há 2 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
microcks/microcks-cli#601 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de microcks/microcks-cli
Issues semelhantes
-
agent-butler-finding chore
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
jordansmall/spindrift#6318 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Eyevinn/moqlivemock#166 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
JakeChampion/lang#14091 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
hyperledger/fabric-x-orderer#1409 ·
Mantenedores costumam responder em até 3 dias
-
get actions doesn't show the approval flag, and describe action shows it unformattedTalvez já em andamento @kenokech assumiu hoje. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia