mirror of
https://github.com/mayflower/docker-ls.git
synced 2025-11-26 12:03:12 +03:00
Support authentification via basic auth.
This commit is contained in:
@@ -33,6 +33,7 @@ type Config struct {
|
||||
credentials RegistryCredentials
|
||||
pageSize uint
|
||||
maxConcurrentRequests uint
|
||||
basicAuth bool
|
||||
}
|
||||
|
||||
func (u *urlValue) String() string {
|
||||
@@ -45,6 +46,7 @@ func (c *Config) BindToFlags(flags *flag.FlagSet) {
|
||||
flags.Var((*urlValue)(&c.registryUrl), "registry", "registry URL")
|
||||
flags.UintVar(&c.pageSize, "page-size", c.pageSize, "page size for paginated requests")
|
||||
flags.UintVar(&c.maxConcurrentRequests, "max-requests", c.maxConcurrentRequests, "concurrent API request limit")
|
||||
flags.BoolVar(&c.basicAuth, "basic-auth", c.basicAuth, "use basic auth instead of token auth")
|
||||
|
||||
c.credentials.BindToFlags(flags)
|
||||
}
|
||||
@@ -62,5 +64,6 @@ func NewConfig() Config {
|
||||
registryUrl: DEFAULT_REGISTRY_URL,
|
||||
pageSize: 100,
|
||||
maxConcurrentRequests: 5,
|
||||
basicAuth: false,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user