fix: Allow extra args and -h for help in anaconda auth callback to support anaconda-client migration #150
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.
Summary
CLI-84
The
anaconda authsubcommand fromanaconda-clientis structured as a command, vs. an entrypoint with its own subcommands. When listinganaconda-authas a dependency ofanaconda-clientfor migration of the login flows to unified auth, some of the edge case regression tests were broken.This change enhances the
anaconda authmain callback function such that we can handle any additional arguments that might be passed in, such asanaconda auth --remove token1 token2. Before this change thetoken2string would be treated as a (missing) subcommand and raise an error.To resolve this, we accept all extra arguments and then manually handle delegation either to the legacy function in
anaconda-clientor to the subcommands mounted to theauthapp inanaconda-auth.Over time, as auth is further unified we can migrate the implementation(s) over and remove this duplication.