Skip to content

fix: logout resolves named contexts#420

Open
gyanranjanpanda wants to merge 1 commit into
microcks:masterfrom
gyanranjanpanda:codex/fix-logout-named-context
Open

fix: logout resolves named contexts#420
gyanranjanpanda wants to merge 1 commit into
microcks:masterfrom
gyanranjanpanda:codex/fix-logout-named-context

Conversation

@gyanranjanpanda
Copy link
Copy Markdown
Contributor

Summary

Fixes #419.

microcks logout now resolves the provided argument as a Microcks context before clearing tokens. That makes the documented named-context flow work for logins created with microcks login ... --name <context>, while still preserving the old behavior of accepting the stored user/server name directly.

Root cause

login --name staging stores the user under the server URL and stores staging only as the context name. logout passed the argument directly to RemoveToken, which searches users by name, so microcks logout staging could not find the token entry.

Validation

  • go test ./cmd -run TestLogoutContext -count=1
  • go test ./pkg/config ./pkg/connectors
  • go vet ./cmd

Note: go test ./... is still blocked by the existing TestDeleteContext fixture issue where cmd/context_test.go writes ./testdata/local.config before creating cmd/testdata.

Signed-off-by: gyanranjanpanda <sanupanda141@gmail.com>
@gyanranjanpanda gyanranjanpanda force-pushed the codex/fix-logout-named-context branch from 79ca6ec to 5446909 Compare May 23, 2026 16:36
@gyanranjanpanda gyanranjanpanda marked this pull request as ready for review May 23, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: logout cannot handle named contexts despite documented usage

1 participant