Repository navigation
feat: resolve the profile by name, current profile or endpoint, and run without a stored one - #111
Merged
Merged
Conversation
|
Coverage of the acceptance run against the meshStack backend, on
Uncovered functions
|
…un without a stored one A command takes the profile that --profile or MESHSTACK_PROFILE names, and an unknown name is an error. Without a name it takes the current profile when no endpoint is given or the profile has that endpoint, else the only stored profile with that endpoint. With no such profile it runs with the endpoint and the credential from the settings alone: it stores nothing and caches no token. Only 'meshstack login' creates a profile. An endpoint is a scheme and a host, and one with a path is refused. 'meshstack api <URL>' takes the origin of the URL as the endpoint, and warns where MESHSTACK_ENDPOINT names another one. Where profiles exist and none has the endpoint, the login hint adds --profile, because login refuses the endpoint alone then. 'meshstack logout' without any stored profile only warns. A profile stores an API token with its other credentials. A token that an earlier version cached is gone, so log in with --apitoken again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
grubmeshi
force-pushed
the
profile-resolution
branch
from
November 25, 2026 12:22
d929310 to
351d632
Compare
|
j0g3sc
approved these changes
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What it does
--profileorMESHSTACK_PROFILEnames. An unknown name is an error.meshstack logincreates a profile.meshstack api <URL>takes the origin of the URL as the endpoint. The URL wins overMESHSTACK_ENDPOINT, and the command logs one warning whenMESHSTACK_ENDPOINTnames another endpoint.--endpointwith a URL on another host is an error.--profile <new-profile-name>, because login refuses--endpoint Xalone in that case.meshstack logoutwith no stored profile warns "Nothing to log out of" and exits 0.--profile <unknown>is an error.--apitokenagain.Review carefully
internal/profile/resolve.goandselect.go: the order in which the name, the current profile and the endpoint decide.internal/setting/resolve.go: the new warning when a source of the command, such as the URL ofmeshstack api, overrides another value in the environment.cmd/auth/logout.go.Mechanical
The removal of
cmd/api/profile.goand the test updates.Place in the stack
2 of 6. Base:
public-client-http. Next:http-do-request.🤖 Generated with Claude Code