microcks-cli icon indicating copy to clipboard operation
microcks-cli copied to clipboard

fix: logout resolves named contexts

Open gyanranjanpanda opened this issue 6 months ago • 0 comments

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.

gyanranjanpanda avatar May 23 '26 16:05 gyanranjanpanda