From bb95d190c1ec481011004c3a581e2fea062de5d9 Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Mon, 26 Feb 2018 10:38:30 -0800 Subject: [PATCH] *: revert "internal/auth" change Signed-off-by: Gyuho Lee --- {internal/auth => auth}/authpb/auth.pb.go | 0 {internal/auth => auth}/authpb/auth.proto | 0 {internal/auth => auth}/doc.go | 0 {internal/auth => auth}/jwt.go | 0 {internal/auth => auth}/jwt_test.go | 4 ++-- {internal/auth => auth}/range_perm_cache.go | 2 +- {internal/auth => auth}/range_perm_cache_test.go | 2 +- {internal/auth => auth}/simple_token.go | 0 {internal/auth => auth}/simple_token_test.go | 0 {internal/auth => auth}/store.go | 2 +- {internal/auth => auth}/store_test.go | 2 +- clientv3/auth.go | 2 +- clientv3/main_test.go | 3 ++- embed/serve_test.go | 2 +- etcdserver/api/v3rpc/maintenance.go | 2 +- etcdserver/api/v3rpc/util.go | 2 +- etcdserver/api/v3rpc/watch.go | 2 +- etcdserver/apply.go | 2 +- etcdserver/apply_auth.go | 2 +- etcdserver/server.go | 2 +- etcdserver/v3_server.go | 2 +- integration/v3_auth_test.go | 2 +- 22 files changed, 18 insertions(+), 17 deletions(-) rename {internal/auth => auth}/authpb/auth.pb.go (100%) rename {internal/auth => auth}/authpb/auth.proto (100%) rename {internal/auth => auth}/doc.go (100%) rename {internal/auth => auth}/jwt.go (100%) rename {internal/auth => auth}/jwt_test.go (95%) rename {internal/auth => auth}/range_perm_cache.go (98%) rename {internal/auth => auth}/range_perm_cache_test.go (97%) rename {internal/auth => auth}/simple_token.go (100%) rename {internal/auth => auth}/simple_token_test.go (100%) rename {internal/auth => auth}/store.go (99%) rename {internal/auth => auth}/store_test.go (99%) diff --git a/internal/auth/authpb/auth.pb.go b/auth/authpb/auth.pb.go similarity index 100% rename from internal/auth/authpb/auth.pb.go rename to auth/authpb/auth.pb.go diff --git a/internal/auth/authpb/auth.proto b/auth/authpb/auth.proto similarity index 100% rename from internal/auth/authpb/auth.proto rename to auth/authpb/auth.proto diff --git a/internal/auth/doc.go b/auth/doc.go similarity index 100% rename from internal/auth/doc.go rename to auth/doc.go diff --git a/internal/auth/jwt.go b/auth/jwt.go similarity index 100% rename from internal/auth/jwt.go rename to auth/jwt.go diff --git a/internal/auth/jwt_test.go b/auth/jwt_test.go similarity index 95% rename from internal/auth/jwt_test.go rename to auth/jwt_test.go index 36b50f9ad..35e11dee2 100644 --- a/internal/auth/jwt_test.go +++ b/auth/jwt_test.go @@ -20,8 +20,8 @@ import ( ) const ( - jwtPubKey = "../../integration/fixtures/server.crt" - jwtPrivKey = "../../integration/fixtures/server.key.insecure" + jwtPubKey = "../integration/fixtures/server.crt" + jwtPrivKey = "../integration/fixtures/server.key.insecure" ) func TestJWTInfo(t *testing.T) { diff --git a/internal/auth/range_perm_cache.go b/auth/range_perm_cache.go similarity index 98% rename from internal/auth/range_perm_cache.go rename to auth/range_perm_cache.go index 241239358..62acdf26d 100644 --- a/internal/auth/range_perm_cache.go +++ b/auth/range_perm_cache.go @@ -15,7 +15,7 @@ package auth import ( - "github.com/coreos/etcd/internal/auth/authpb" + "github.com/coreos/etcd/auth/authpb" "github.com/coreos/etcd/internal/mvcc/backend" "github.com/coreos/etcd/pkg/adt" ) diff --git a/internal/auth/range_perm_cache_test.go b/auth/range_perm_cache_test.go similarity index 97% rename from internal/auth/range_perm_cache_test.go rename to auth/range_perm_cache_test.go index c0a0ae6bc..fd8df6a9e 100644 --- a/internal/auth/range_perm_cache_test.go +++ b/auth/range_perm_cache_test.go @@ -17,7 +17,7 @@ package auth import ( "testing" - "github.com/coreos/etcd/internal/auth/authpb" + "github.com/coreos/etcd/auth/authpb" "github.com/coreos/etcd/pkg/adt" ) diff --git a/internal/auth/simple_token.go b/auth/simple_token.go similarity index 100% rename from internal/auth/simple_token.go rename to auth/simple_token.go diff --git a/internal/auth/simple_token_test.go b/auth/simple_token_test.go similarity index 100% rename from internal/auth/simple_token_test.go rename to auth/simple_token_test.go diff --git a/internal/auth/store.go b/auth/store.go similarity index 99% rename from internal/auth/store.go rename to auth/store.go index 7796c5d8a..e93560896 100644 --- a/internal/auth/store.go +++ b/auth/store.go @@ -24,8 +24,8 @@ import ( "sync" "sync/atomic" + "github.com/coreos/etcd/auth/authpb" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - "github.com/coreos/etcd/internal/auth/authpb" "github.com/coreos/etcd/internal/mvcc/backend" "github.com/coreos/pkg/capnslog" diff --git a/internal/auth/store_test.go b/auth/store_test.go similarity index 99% rename from internal/auth/store_test.go rename to auth/store_test.go index 2aa7d51a8..739d8fcde 100644 --- a/internal/auth/store_test.go +++ b/auth/store_test.go @@ -24,8 +24,8 @@ import ( "testing" "time" + "github.com/coreos/etcd/auth/authpb" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - "github.com/coreos/etcd/internal/auth/authpb" "github.com/coreos/etcd/internal/mvcc/backend" "golang.org/x/crypto/bcrypt" diff --git a/clientv3/auth.go b/clientv3/auth.go index 6ffe48b0c..7545bb6ca 100644 --- a/clientv3/auth.go +++ b/clientv3/auth.go @@ -19,8 +19,8 @@ import ( "fmt" "strings" + "github.com/coreos/etcd/auth/authpb" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - "github.com/coreos/etcd/internal/auth/authpb" "google.golang.org/grpc" ) diff --git a/clientv3/main_test.go b/clientv3/main_test.go index cf5e6d697..3c525241d 100644 --- a/clientv3/main_test.go +++ b/clientv3/main_test.go @@ -22,9 +22,10 @@ import ( "testing" "time" + "github.com/coreos/etcd/auth" "github.com/coreos/etcd/integration" - "github.com/coreos/etcd/internal/auth" "github.com/coreos/etcd/pkg/testutil" + "golang.org/x/crypto/bcrypt" ) diff --git a/embed/serve_test.go b/embed/serve_test.go index 55274d988..d46631fcf 100644 --- a/embed/serve_test.go +++ b/embed/serve_test.go @@ -19,7 +19,7 @@ import ( "os" "testing" - "github.com/coreos/etcd/internal/auth" + "github.com/coreos/etcd/auth" ) // TestStartEtcdWrongToken ensures that StartEtcd with wrong configs returns with error. diff --git a/etcdserver/api/v3rpc/maintenance.go b/etcdserver/api/v3rpc/maintenance.go index 5d724c3f6..dc40bedca 100644 --- a/etcdserver/api/v3rpc/maintenance.go +++ b/etcdserver/api/v3rpc/maintenance.go @@ -19,10 +19,10 @@ import ( "crypto/sha256" "io" + "github.com/coreos/etcd/auth" "github.com/coreos/etcd/etcdserver" "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - "github.com/coreos/etcd/internal/auth" "github.com/coreos/etcd/internal/mvcc" "github.com/coreos/etcd/internal/mvcc/backend" "github.com/coreos/etcd/pkg/types" diff --git a/etcdserver/api/v3rpc/util.go b/etcdserver/api/v3rpc/util.go index 5ad962a6a..bd092b3a1 100644 --- a/etcdserver/api/v3rpc/util.go +++ b/etcdserver/api/v3rpc/util.go @@ -18,10 +18,10 @@ import ( "context" "strings" + "github.com/coreos/etcd/auth" "github.com/coreos/etcd/etcdserver" "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes" "github.com/coreos/etcd/etcdserver/membership" - "github.com/coreos/etcd/internal/auth" "github.com/coreos/etcd/internal/lease" "github.com/coreos/etcd/internal/mvcc" diff --git a/etcdserver/api/v3rpc/watch.go b/etcdserver/api/v3rpc/watch.go index 646d70f9f..45ce6bff0 100644 --- a/etcdserver/api/v3rpc/watch.go +++ b/etcdserver/api/v3rpc/watch.go @@ -21,10 +21,10 @@ import ( "sync" "time" + "github.com/coreos/etcd/auth" "github.com/coreos/etcd/etcdserver" "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - "github.com/coreos/etcd/internal/auth" "github.com/coreos/etcd/internal/mvcc" "github.com/coreos/etcd/internal/mvcc/mvccpb" ) diff --git a/etcdserver/apply.go b/etcdserver/apply.go index 8b9bbb687..791750d8e 100644 --- a/etcdserver/apply.go +++ b/etcdserver/apply.go @@ -20,8 +20,8 @@ import ( "sort" "time" + "github.com/coreos/etcd/auth" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - "github.com/coreos/etcd/internal/auth" "github.com/coreos/etcd/internal/lease" "github.com/coreos/etcd/internal/mvcc" "github.com/coreos/etcd/internal/mvcc/mvccpb" diff --git a/etcdserver/apply_auth.go b/etcdserver/apply_auth.go index 9f3516ee1..d95385af3 100644 --- a/etcdserver/apply_auth.go +++ b/etcdserver/apply_auth.go @@ -17,8 +17,8 @@ package etcdserver import ( "sync" + "github.com/coreos/etcd/auth" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - "github.com/coreos/etcd/internal/auth" "github.com/coreos/etcd/internal/lease" "github.com/coreos/etcd/internal/mvcc" ) diff --git a/etcdserver/server.go b/etcdserver/server.go index 6a4bcf9ca..4bfcdfd49 100644 --- a/etcdserver/server.go +++ b/etcdserver/server.go @@ -30,6 +30,7 @@ import ( "time" "github.com/coreos/etcd/alarm" + "github.com/coreos/etcd/auth" "github.com/coreos/etcd/compactor" "github.com/coreos/etcd/discovery" "github.com/coreos/etcd/etcdserver/api" @@ -37,7 +38,6 @@ import ( pb "github.com/coreos/etcd/etcdserver/etcdserverpb" "github.com/coreos/etcd/etcdserver/membership" "github.com/coreos/etcd/etcdserver/stats" - "github.com/coreos/etcd/internal/auth" "github.com/coreos/etcd/internal/lease" "github.com/coreos/etcd/internal/lease/leasehttp" "github.com/coreos/etcd/internal/mvcc" diff --git a/etcdserver/v3_server.go b/etcdserver/v3_server.go index dd68eb5e9..eeabb10eb 100644 --- a/etcdserver/v3_server.go +++ b/etcdserver/v3_server.go @@ -20,9 +20,9 @@ import ( "encoding/binary" "time" + "github.com/coreos/etcd/auth" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" "github.com/coreos/etcd/etcdserver/membership" - "github.com/coreos/etcd/internal/auth" "github.com/coreos/etcd/internal/lease" "github.com/coreos/etcd/internal/lease/leasehttp" "github.com/coreos/etcd/internal/mvcc" diff --git a/integration/v3_auth_test.go b/integration/v3_auth_test.go index 2c80c743b..97017a07f 100644 --- a/integration/v3_auth_test.go +++ b/integration/v3_auth_test.go @@ -21,10 +21,10 @@ import ( "testing" "time" + "github.com/coreos/etcd/auth/authpb" "github.com/coreos/etcd/clientv3" "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - "github.com/coreos/etcd/internal/auth/authpb" "github.com/coreos/etcd/pkg/testutil" )