diff --git a/cmd/registry/main.go b/cmd/registry/main.go index 8c591bad4..53c91a0af 100644 --- a/cmd/registry/main.go +++ b/cmd/registry/main.go @@ -18,7 +18,7 @@ import ( "github.com/docker/distribution/configuration" "github.com/docker/distribution/context" _ "github.com/docker/distribution/health" - _ "github.com/docker/distribution/registry/auth/basic" + _ "github.com/docker/distribution/registry/auth/htpasswd" _ "github.com/docker/distribution/registry/auth/silly" _ "github.com/docker/distribution/registry/auth/token" "github.com/docker/distribution/registry/handlers" diff --git a/registry/auth/basic/access.go b/registry/auth/htpasswd/access.go similarity index 88% rename from registry/auth/basic/access.go rename to registry/auth/htpasswd/access.go index f7d5e79b7..5425b1dab 100644 --- a/registry/auth/basic/access.go +++ b/registry/auth/htpasswd/access.go @@ -1,9 +1,9 @@ -// Package basic provides a simple authentication scheme that checks for the +// Package htpasswd provides a simple authentication scheme that checks for the // user credential hash in an htpasswd formatted file in a configuration-determined // location. // // This authentication method MUST be used under TLS, as simple token-replay attack is possible. -package basic +package htpasswd import ( "errors" @@ -34,12 +34,12 @@ var _ auth.AccessController = &accessController{} func newAccessController(options map[string]interface{}) (auth.AccessController, error) { realm, present := options["realm"] if _, ok := realm.(string); !present || !ok { - return nil, fmt.Errorf(`"realm" must be set for basic access controller`) + return nil, fmt.Errorf(`"realm" must be set for htpasswd access controller`) } path, present := options["path"] if _, ok := path.(string); !present || !ok { - return nil, fmt.Errorf(`"path" must be set for basic access controller`) + return nil, fmt.Errorf(`"path" must be set for htpasswd access controller`) } f, err := os.Open(path.(string)) @@ -98,5 +98,5 @@ func (ch *challenge) Error() string { } func init() { - auth.Register("basic", auth.InitFunc(newAccessController)) + auth.Register("htpasswd", auth.InitFunc(newAccessController)) } diff --git a/registry/auth/basic/access_test.go b/registry/auth/htpasswd/access_test.go similarity index 99% rename from registry/auth/basic/access_test.go rename to registry/auth/htpasswd/access_test.go index 1976b32e2..5cb2d7c92 100644 --- a/registry/auth/basic/access_test.go +++ b/registry/auth/htpasswd/access_test.go @@ -1,4 +1,4 @@ -package basic +package htpasswd import ( "io/ioutil" diff --git a/registry/auth/basic/htpasswd.go b/registry/auth/htpasswd/htpasswd.go similarity index 99% rename from registry/auth/basic/htpasswd.go rename to registry/auth/htpasswd/htpasswd.go index dd9bb1acf..494ad0a76 100644 --- a/registry/auth/basic/htpasswd.go +++ b/registry/auth/htpasswd/htpasswd.go @@ -1,4 +1,4 @@ -package basic +package htpasswd import ( "bufio" diff --git a/registry/auth/basic/htpasswd_test.go b/registry/auth/htpasswd/htpasswd_test.go similarity index 99% rename from registry/auth/basic/htpasswd_test.go rename to registry/auth/htpasswd/htpasswd_test.go index 5cc861264..309c359ad 100644 --- a/registry/auth/basic/htpasswd_test.go +++ b/registry/auth/htpasswd/htpasswd_test.go @@ -1,4 +1,4 @@ -package basic +package htpasswd import ( "fmt"