-
Couldn't load subscription status.
- Fork 3
[feature] site configuration #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
adjust this message to say |
|
add auth_domain_override to client init |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great. I left a few comments about some design and naming issues, but overall we are very close.
7ecefa8 to
4b20fe5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're ready! Just one small comment about a preferred function rename but other than that let's
Currently it is possible to use the
[plugin.auth]table in~/.anaconda/config.tomlto change details of auth and API requests for domain, ssl_verify, and other settings.~/.anaconda/config.tomlconfigurationHere, two top-level keys are added to support multiple site configuration, retrieval, and setting a default site. The
[sites]table is used to store key-value pairs for the name of the site and configuration options. The goal is to provide site-based look-ups for configuration of BaseClient and login details.The keys in
[site.<site-name>]tables are the same as[plugin.auth]Here's an example
The site information is read using
AnacondaAuthSitesConfig. For the above config.toml:Or using the
sitesdictionaryFinally, the site "anaconda.com" is a special site and you cannot have a custom site called 'anaconda.com'. To make changes to this site use
[plugin.auth].CLI
The four
anaconda authsubcommands now accept--atto control the site. It will accept a site name or domain name for a configured site.Load site config in BaseClient
anaconda_auth.client.BaseClientnow supportssite=kwarg. This kwarg allows two types eitherstr(site name or domain name) oranaconda_auth.config.AnacondaAuthSite. Note thatAnacondaAuthConfig(which reads from config.toml) is derived fromAnacondaAuthSite. Any further kwargs override the supplied site. Whensite=Nonethe default site config.TODO
--at <site>for auth CLI commands (login, logout, api-key, whoami)anaconda --site <site> ...and env varANACONDA_SITE=<site>(may have to make changes to cli-base)Note: tests will pass when anaconda-cli-base is released with this PR: anaconda/anaconda-cli-base#75