diff --git a/.gitignore b/.gitignore index 3dc8864..cdd5516 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,10 @@ go-auth.h # dependencies vendor +# ides and editors +.idea/ .vscode/ -Gopkg.lock + +# todo +TODO diff --git a/README.md b/README.md index 82b0297..c8eff4a 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,6 @@ Please open an issue with the `feature` or `enhancement` tag to request new back - [gRPC](#grpc) - [Service](#service) - [Testing gRPC](#testing-grpc) -- [Benchmarks](#benchmarks) - [Using with LoRa Server](#using-with-lora-server) - [Docker](#docker) - [License](#license) @@ -826,7 +825,8 @@ When params mode is set to `json`, the backend will send a json encoded string w { "username": "user", - "password": "pass" + "password": "pass", + "clientid": "clientid" } When set to `form`, it will send params like a regular html form post. @@ -970,7 +970,7 @@ func Init(authOpts map[string]string, logLevel log.Level) error { return nil } -func GetUser(username, password string) bool { +func GetUser(username, password, clientid string) bool { return false } @@ -1060,6 +1060,8 @@ message GetUserRequest { string username = 1; // Plain text password. string password = 2; + // The client connection's id. + string clientid = 3; } message GetSuperuserRequest { @@ -1093,42 +1095,6 @@ message NameResponse { This backend has no special requirements as a gRPC server is mocked to test different scenarios. -### Benchmarks - -Running benchmarks on the plugin doesn't make much sense, as there are a number of factors to be considered, like mosquitto's own performance. Also, they are highly tied to other applications and specific infrastructure, such as local postgres instance versus a remote with enabled tls one, network latency for http and jwt, etc. Anyway, there are a couple of benchmarks written for the Files, Postgres and Redis backends. They were ran on an Asus laptop with normal work load (a bunch of Chrome tabs and programs running) with the following specs: - - OS: Linux Mint 18 Cinnamon 3.07 64-bit - Kernel: 4.11.0-14 - Processor: Intel Core i5-6200U CPU @ 2.30GHz x 2 - Memory: 5.7 GiB - -As said, take these benchmarks with a grain of salt and consider them just as a reference. A much better benchmark would be running mosquitto with this plugin and an alternative one (such as [jpmens'](https://github.com/jpmens)) and compare how they do against similarly configured backends. I'd expect that one to be faster, as it's written in C, but hopefully the difference isn't so big. I'd gladly include something like this if anyone is willing to do such benchmark. - -You could check files_benchmark_test.go and redis_benchmark_test.go to see the benchmarks details, but the titles should be self explanatory. - -Benchmarks can be ran with: - -`make benchmarks` - -Finally, here are the results: - -``` -BenchmarkFilesUser-4 10 151611011 ns/op -BenchmarkFilesSuperuser-4 1000000000 2.94 ns/op -BenchmarkFilesAcl-4 10000000 167 ns/op -BenchmarkPostgresUser-4 10 167902778 ns/op -BenchmarkPostgresSuperser-4 10000 164956 ns/op -BenchmarkPostgresStrictAcl-4 10000 202321 ns/op -BenchmarkPostgresSingleLevelAcl-4 10000 202027 ns/op -BenchmarkPostgresHierarchyAcl-4 10000 201217 ns/op -BenchmarkRedisUser-4 10 152723368 ns/op -BenchmarkRedisSuperuser-4 100000 21330 ns/op -BenchmarkRedisStrictAcl-4 20000 84570 ns/op -BenchmarkRedisUserPatternAcl-4 20000 83076 ns/op -BenchmarkRedisClientPatternAcl-4 20000 84883 ns/op -BenchmarkRedisSingleLevelAcl-4 20000 84241 ns/op -BenchmarkRedisHierarchyAcl-4 20000 83835 ns/op -``` ### Using with LoRa Server diff --git a/auth-plugin.c b/auth-plugin.c index 90d50fb..c926994 100644 --- a/auth-plugin.c +++ b/auth-plugin.c @@ -64,6 +64,11 @@ int mosquitto_auth_unpwd_check(void *userdata, const struct mosquitto *client, c int mosquitto_auth_unpwd_check(void *userdata, const char *username, const char *password) #endif { + #if MOSQ_AUTH_PLUGIN_VERSION >= 3 + const char* clientid = mosquitto_client_id(client); + #else + const char* clientid = ""; + #endif if (username == NULL || password == NULL) { printf("error: received null username or password for unpwd check\n"); fflush(stdout); @@ -72,8 +77,9 @@ int mosquitto_auth_unpwd_check(void *userdata, const char *username, const char GoString go_username = {username, strlen(username)}; GoString go_password = {password, strlen(password)}; + GoString go_clientid = {clientid, strlen(clientid)}; - if(AuthUnpwdCheck(go_username, go_password)){ + if(AuthUnpwdCheck(go_username, go_password, go_clientid)){ return MOSQ_ERR_SUCCESS; } diff --git a/backends/files.go b/backends/files.go index 69efdca..f2aa470 100644 --- a/backends/files.go +++ b/backends/files.go @@ -283,7 +283,7 @@ func checkCommentOrEmpty(line string) bool { } //GetUser checks that user exists and password is correct. -func (o Files) GetUser(username, password string) bool { +func (o Files) GetUser(username, password, clientid string) bool { fileUser, ok := o.Users[username] if !ok { diff --git a/backends/files_benchmark_test.go b/backends/files_benchmark_test.go deleted file mode 100644 index 3ff891f..0000000 --- a/backends/files_benchmark_test.go +++ /dev/null @@ -1,44 +0,0 @@ -package backends - -import ( - "path/filepath" - "testing" - - log "github.com/sirupsen/logrus" -) - -var files Files -var fbUser1 = "test1" - -var fbClientID = "test_client" -var fbTestTopic1 = `test/topic/1` - -func init() { - var pwPath, _ = filepath.Abs("../test-files/passwords") - var aclPath, _ = filepath.Abs("../test-files/acls") - - var authOpts = map[string]string{ - "password_path": pwPath, - "acl_path": aclPath, - } - - files, _ = NewFiles(authOpts, log.ErrorLevel) -} - -func BenchmarkFilesUser(b *testing.B) { - for n := 0; n < b.N; n++ { - files.GetUser(fbUser1, fbUser1) - } -} - -func BenchmarkFilesSuperuser(b *testing.B) { - for n := 0; n < b.N; n++ { - files.GetSuperuser(fbUser1) - } -} - -func BenchmarkFilesAcl(b *testing.B) { - for n := 0; n < b.N; n++ { - files.CheckAcl(fbUser1, fbTestTopic1, fbClientID, 2) - } -} diff --git a/backends/files_test.go b/backends/files_test.go index 31bda6c..b1d5897 100644 --- a/backends/files_test.go +++ b/backends/files_test.go @@ -22,6 +22,7 @@ func TestFiles(t *testing.T) { aclPath, _ := filepath.Abs("../test-files/acls") authOpts["password_path"] = pwPath authOpts["acl_path"] = aclPath + clientID := "test_client" Convey("Given valid params NewFiles should return a new files backend instance", t, func() { files, err := NewFiles(authOpts, log.DebugLevel) @@ -52,14 +53,14 @@ func TestFiles(t *testing.T) { Convey("Given a username and a correct password, it should correctly authenticate it", func() { - authenticated := files.GetUser(user1, user1) + authenticated := files.GetUser(user1, user1, clientID) So(authenticated, ShouldBeTrue) }) Convey("Given a username and an incorrect password, it should not authenticate it", func() { - authenticated := files.GetUser(user1, user2) + authenticated := files.GetUser(user1, user2, clientID) So(authenticated, ShouldBeFalse) }) @@ -70,7 +71,6 @@ func TestFiles(t *testing.T) { So(superuser, ShouldBeFalse) }) - clientID := "test_client" testTopic1 := `test/topic/1` testTopic2 := `test/topic/2` testTopic3 := `test/other/1` diff --git a/backends/grpc.go b/backends/grpc.go index 4246853..024175d 100644 --- a/backends/grpc.go +++ b/backends/grpc.go @@ -7,12 +7,12 @@ import ( "fmt" "time" + "github.com/golang/protobuf/ptypes/empty" grpc_logrus "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" "github.com/pkg/errors" log "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/credentials" - "github.com/golang/protobuf/ptypes/empty" gs "github.com/iegomez/mosquitto-go-auth/grpc" ) @@ -48,11 +48,12 @@ func NewGRPC(authOpts map[string]string, logLevel log.Level) (GRPC, error) { } // GetUser checks that the username exists and the given password hashes to the same password. -func (o GRPC) GetUser(username, password string) bool { +func (o GRPC) GetUser(username, password, clientid string) bool { req := gs.GetUserRequest{ Username: username, Password: password, + Clientid: clientid, } resp, err := o.client.GetUser(context.Background(), &req) diff --git a/backends/grpc_test.go b/backends/grpc_test.go index fe8693c..1846e29 100644 --- a/backends/grpc_test.go +++ b/backends/grpc_test.go @@ -14,7 +14,7 @@ import ( . "github.com/smartystreets/goconvey/convey" ) -var ( +const ( grpcUsername string = "test_user" grpcSuperuser string = "superuser" grpcPassword string = "test_password" @@ -94,11 +94,11 @@ func TestGRPC(t *testing.T) { Convey("given incorrect credentials user should not be authenticated", func(c C) { - auth := g.GetUser(grpcUsername, "wrong") + auth := g.GetUser(grpcUsername, "wrong", grpcClientId) c.So(auth, ShouldBeFalse) Convey("given correct credential user should be authenticated", func(c C) { - auth := g.GetUser(grpcUsername, grpcPassword) + auth := g.GetUser(grpcUsername, grpcPassword, grpcClientId) c.So(auth, ShouldBeTrue) Convey("given a non superuser user the service should respond false", func(c C) { diff --git a/backends/http.go b/backends/http.go index 8512ae1..05413a0 100644 --- a/backends/http.go +++ b/backends/http.go @@ -112,16 +112,18 @@ func NewHTTP(authOpts map[string]string, logLevel log.Level) (HTTP, error) { return http, nil } -func (o HTTP) GetUser(username, password string) bool { +func (o HTTP) GetUser(username, password, clientid string) bool { var dataMap = map[string]interface{}{ "username": username, "password": password, + "clientid": clientid, } var urlValues = url.Values{ "username": []string{username}, "password": []string{password}, + "clientid": []string{clientid}, } return httpRequest(o.Host, o.UserUri, username, o.WithTLS, o.VerifyPeer, dataMap, o.Port, o.ParamsMode, o.ResponseMode, urlValues) diff --git a/backends/http_test.go b/backends/http_test.go index 9206492..6d5988e 100644 --- a/backends/http_test.go +++ b/backends/http_test.go @@ -104,14 +104,14 @@ func TestHTTPAllJsonServer(t *testing.T) { Convey("Given correct password/username, get user should return true", func() { - authenticated := hb.GetUser(username, password) + authenticated := hb.GetUser(username, password, clientId) So(authenticated, ShouldBeTrue) }) Convey("Given incorrect password/username, get user should return false", func() { - authenticated := hb.GetUser(username, "wrong_password") + authenticated := hb.GetUser(username, "wrong_password", clientId) So(authenticated, ShouldBeFalse) }) @@ -232,14 +232,14 @@ func TestHTTPJsonStatusOnlyServer(t *testing.T) { Convey("Given correct password/username, get user should return true", func() { - authenticated := hb.GetUser(username, password) + authenticated := hb.GetUser(username, password, clientId) So(authenticated, ShouldBeTrue) }) Convey("Given incorrect password/username, get user should return false", func() { - authenticated := hb.GetUser(username, "wrong_password") + authenticated := hb.GetUser(username, "wrong_password", clientId) So(authenticated, ShouldBeFalse) }) @@ -364,14 +364,14 @@ func TestHTTPJsonTextResponseServer(t *testing.T) { Convey("Given correct password/username, get user should return true", func() { - authenticated := hb.GetUser(username, password) + authenticated := hb.GetUser(username, password, clientId) So(authenticated, ShouldBeTrue) }) Convey("Given incorrect password/username, get user should return false", func() { - authenticated := hb.GetUser(username, "wrong_password") + authenticated := hb.GetUser(username, "wrong_password", clientId) So(authenticated, ShouldBeFalse) }) @@ -506,14 +506,14 @@ func TestHTTPFormJsonResponseServer(t *testing.T) { Convey("Given correct password/username, get user should return true", func() { - authenticated := hb.GetUser(username, password) + authenticated := hb.GetUser(username, password, clientId) So(authenticated, ShouldBeTrue) }) Convey("Given incorrect password/username, get user should return false", func() { - authenticated := hb.GetUser(username, "wrong_password") + authenticated := hb.GetUser(username, "wrong_password", clientId) So(authenticated, ShouldBeFalse) }) @@ -625,14 +625,14 @@ func TestHTTPFormStatusOnlyServer(t *testing.T) { Convey("Given correct password/username, get user should return true", func() { - authenticated := hb.GetUser(username, password) + authenticated := hb.GetUser(username, password, clientId) So(authenticated, ShouldBeTrue) }) Convey("Given incorrect password/username, get user should return false", func() { - authenticated := hb.GetUser(username, "wrong_password") + authenticated := hb.GetUser(username, "wrong_password", clientId) So(authenticated, ShouldBeFalse) }) @@ -749,14 +749,14 @@ func TestHTTPFormTextResponseServer(t *testing.T) { Convey("Given correct password/username, get user should return true", func() { - authenticated := hb.GetUser(username, password) + authenticated := hb.GetUser(username, password, clientId) So(authenticated, ShouldBeTrue) }) Convey("Given incorrect password/username, get user should return false", func() { - authenticated := hb.GetUser(username, "wrong_password") + authenticated := hb.GetUser(username, "wrong_password", clientId) So(authenticated, ShouldBeFalse) }) diff --git a/backends/jwt.go b/backends/jwt.go index 0390020..b2128bf 100644 --- a/backends/jwt.go +++ b/backends/jwt.go @@ -211,7 +211,7 @@ func NewJWT(authOpts map[string]string, logLevel log.Level) (JWT, error) { } //GetUser authenticates a given user. -func (o JWT) GetUser(token, password string) bool { +func (o JWT) GetUser(token, password, clientid string) bool { if o.Remote { var dataMap map[string]interface{} diff --git a/backends/jwt_test.go b/backends/jwt_test.go index e669c64..2b734b1 100644 --- a/backends/jwt_test.go +++ b/backends/jwt_test.go @@ -93,7 +93,7 @@ func TestLocalPostgresJWT(t *testing.T) { Convey("Given a correct token, it should correctly authenticate it", func() { - authenticated := jwt.GetUser(token, "") + authenticated := jwt.GetUser(token, "", "") So(authenticated, ShouldBeTrue) }) @@ -103,7 +103,7 @@ func TestLocalPostgresJWT(t *testing.T) { wrongToken, err := wrongJwtToken.SignedString([]byte(jwtSecret)) So(err, ShouldBeNil) - authenticated := jwt.GetUser(wrongToken, "") + authenticated := jwt.GetUser(wrongToken, "", "") So(authenticated, ShouldBeFalse) }) @@ -240,7 +240,7 @@ func TestLocalMysqlJWT(t *testing.T) { Convey("Given a correct token, it should correctly authenticate it", func() { - authenticated := jwt.GetUser(token, "") + authenticated := jwt.GetUser(token, "", "") So(authenticated, ShouldBeTrue) }) @@ -250,7 +250,7 @@ func TestLocalMysqlJWT(t *testing.T) { wrongToken, err := wrongJwtToken.SignedString([]byte(jwtSecret)) So(err, ShouldBeNil) - authenticated := jwt.GetUser(wrongToken, "") + authenticated := jwt.GetUser(wrongToken, "", "") So(authenticated, ShouldBeFalse) }) @@ -449,14 +449,14 @@ func TestJWTAllJsonServer(t *testing.T) { Convey("Given correct password/username, get user should return true", func() { - authenticated := hb.GetUser(token, "") + authenticated := hb.GetUser(token, "", "") So(authenticated, ShouldBeTrue) }) Convey("Given incorrect password/username, get user should return false", func() { - authenticated := hb.GetUser(wrongToken, "") + authenticated := hb.GetUser(wrongToken, "", "") So(authenticated, ShouldBeFalse) }) @@ -571,14 +571,14 @@ func TestJWTJsonStatusOnlyServer(t *testing.T) { Convey("Given correct password/username, get user should return true", func() { - authenticated := hb.GetUser(token, "") + authenticated := hb.GetUser(token, "", "") So(authenticated, ShouldBeTrue) }) Convey("Given incorrect password/username, get user should return false", func() { - authenticated := hb.GetUser(wrongToken, "") + authenticated := hb.GetUser(wrongToken, "", "") So(authenticated, ShouldBeFalse) }) @@ -697,14 +697,14 @@ func TestJWTJsonTextResponseServer(t *testing.T) { Convey("Given correct password/username, get user should return true", func() { - authenticated := hb.GetUser(token, "") + authenticated := hb.GetUser(token, "", "") So(authenticated, ShouldBeTrue) }) Convey("Given incorrect password/username, get user should return false", func() { - authenticated := hb.GetUser(wrongToken, "") + authenticated := hb.GetUser(wrongToken, "", "") So(authenticated, ShouldBeFalse) }) @@ -835,14 +835,14 @@ func TestJWTFormJsonResponseServer(t *testing.T) { Convey("Given correct password/username, get user should return true", func() { - authenticated := hb.GetUser(token, "") + authenticated := hb.GetUser(token, "", "") So(authenticated, ShouldBeTrue) }) Convey("Given incorrect password/username, get user should return false", func() { - authenticated := hb.GetUser(wrongToken, "") + authenticated := hb.GetUser(wrongToken, "", "") So(authenticated, ShouldBeFalse) }) @@ -951,14 +951,14 @@ func TestJWTFormStatusOnlyServer(t *testing.T) { Convey("Given correct password/username, get user should return true", func() { - authenticated := hb.GetUser(token, "") + authenticated := hb.GetUser(token, "", "") So(authenticated, ShouldBeTrue) }) Convey("Given incorrect password/username, get user should return false", func() { - authenticated := hb.GetUser(wrongToken, "") + authenticated := hb.GetUser(wrongToken, "", "") So(authenticated, ShouldBeFalse) }) @@ -1072,14 +1072,14 @@ func TestJWTFormTextResponseServer(t *testing.T) { Convey("Given correct password/username, get user should return true", func() { - authenticated := hb.GetUser(token, "") + authenticated := hb.GetUser(token, "", "") So(authenticated, ShouldBeTrue) }) Convey("Given incorrect password/username, get user should return false", func() { - authenticated := hb.GetUser(wrongToken, "") + authenticated := hb.GetUser(wrongToken, "", "") So(authenticated, ShouldBeFalse) }) diff --git a/backends/mongo.go b/backends/mongo.go index 2c47cb0..d447ff0 100644 --- a/backends/mongo.go +++ b/backends/mongo.go @@ -112,7 +112,7 @@ func NewMongo(authOpts map[string]string, logLevel log.Level) (Mongo, error) { } //GetUser checks that the username exists and the given password hashes to the same password. -func (o Mongo) GetUser(username, password string) bool { +func (o Mongo) GetUser(username, password, clientid string) bool { uc := o.Conn.Database(o.DBName).Collection(o.UsersCollection) diff --git a/backends/mongo_test.go b/backends/mongo_test.go index 6d3ecbb..a84f066 100644 --- a/backends/mongo_test.go +++ b/backends/mongo_test.go @@ -64,14 +64,14 @@ func TestMongo(t *testing.T) { Convey("Given a username and a correct password, it should correctly authenticate it", func() { - authenticated := mongo.GetUser(username, userPass) + authenticated := mongo.GetUser(username, userPass, "") So(authenticated, ShouldBeTrue) }) Convey("Given a username and an incorrect password, it should not authenticate it", func() { - authenticated := mongo.GetUser(username, "wrong_password") + authenticated := mongo.GetUser(username, "wrong_password", "") So(authenticated, ShouldBeFalse) }) diff --git a/backends/mysql.go b/backends/mysql.go index 7f3e061..3891d53 100644 --- a/backends/mysql.go +++ b/backends/mysql.go @@ -200,7 +200,7 @@ func NewMysql(authOpts map[string]string, logLevel log.Level) (Mysql, error) { } //GetUser checks that the username exists and the given password hashes to the same password. -func (o Mysql) GetUser(username, password string) bool { +func (o Mysql) GetUser(username, password, clientid string) bool { var pwHash sql.NullString err := o.DB.Get(&pwHash, o.UserQuery, username) diff --git a/backends/mysql_test.go b/backends/mysql_test.go index f901e9a..677af62 100644 --- a/backends/mysql_test.go +++ b/backends/mysql_test.go @@ -57,14 +57,14 @@ func TestMysql(t *testing.T) { Convey("Given a username and a correct password, it should correctly authenticate it", func() { - authenticated := mysql.GetUser(username, userPass) + authenticated := mysql.GetUser(username, userPass, "") So(authenticated, ShouldBeTrue) }) Convey("Given a username and an incorrect password, it should not authenticate it", func() { - authenticated := mysql.GetUser(username, "wrong_password") + authenticated := mysql.GetUser(username, "wrong_password", "") So(authenticated, ShouldBeFalse) }) diff --git a/backends/postgres.go b/backends/postgres.go index 37a5b4d..7c2d350 100644 --- a/backends/postgres.go +++ b/backends/postgres.go @@ -146,7 +146,7 @@ func NewPostgres(authOpts map[string]string, logLevel log.Level) (Postgres, erro } //GetUser checks that the username exists and the given password hashes to the same password. -func (o Postgres) GetUser(username, password string) bool { +func (o Postgres) GetUser(username, password, clientid string) bool { var pwHash sql.NullString err := o.DB.Get(&pwHash, o.UserQuery, username) diff --git a/backends/postgres_benchmark_test.go b/backends/postgres_benchmark_test.go deleted file mode 100644 index 8950f00..0000000 --- a/backends/postgres_benchmark_test.go +++ /dev/null @@ -1,81 +0,0 @@ -package backends - -import ( - "testing" - - log "github.com/sirupsen/logrus" -) - -var postgres Postgres - -var pgStrictAcl = "test/topic/1" - -//Insert a user to test auth -var pgUsername = "test" -var pgUserPass = "testpw" - -//Hash generated by the pw utility -var pgUserPassHash = "PBKDF2$sha512$100000$os24lcPr9cJt2QDVWssblQ==$BK1BQ2wbwU1zNxv3Ml3wLuu5//hPop3/LvaPYjjCwdBvnpwusnukJPpcXQzyyjOlZdieXTx6sXAcX4WnZRZZnw==" - -func init() { - //Initialize Postgres. - authOpts := make(map[string]string) - authOpts["pg_host"] = "localhost" - authOpts["pg_port"] = "5432" - authOpts["pg_dbname"] = "go_auth_test" - authOpts["pg_user"] = "go_auth_test" - authOpts["pg_password"] = "go_auth_test" - authOpts["pg_userquery"] = "SELECT password_hash FROM test_user WHERE username = $1 limit 1" - authOpts["pg_superquery"] = "select count(*) from test_user where username = $1 and is_admin = true" - authOpts["pg_aclquery"] = "SELECT test_acl.topic FROM test_acl, test_user WHERE test_user.username = $1 AND test_acl.test_user_id = test_user.id AND (rw = $2 or rw = 3)" - var err error - postgres, err = NewPostgres(authOpts, log.DebugLevel) - if err != nil { - log.Fatalf("Postgres error: %s", err) - } - //Empty db - postgres.DB.MustExec("delete from test_user where 1 = 1") - postgres.DB.MustExec("delete from test_acl where 1 = 1") - - userID := 0 - - insertQuery := "INSERT INTO test_user(username, password_hash, is_admin) values($1, $2, $3) returning id" - postgres.DB.Get(&userID, insertQuery, pgUsername, pgUserPassHash, true) - - aclID := 0 - //Insert acls - aclQuery := "INSERT INTO test_acl(test_user_id, topic, rw) values($1, $2, $3) returning id" - postgres.DB.Get(&aclID, aclQuery, userID, strictAcl, MOSQ_ACL_READ) - -} - -func BenchmarkPostgresUser(b *testing.B) { - log.Printf("postgres: %v", postgres) - for n := 0; n < b.N; n++ { - postgres.GetUser(pgUsername, pgUserPass) - } -} - -func BenchmarkPostgresSuperser(b *testing.B) { - for n := 0; n < b.N; n++ { - postgres.GetSuperuser(pgUsername) - } -} - -func BenchmarkPostgresStrictAcl(b *testing.B) { - for n := 0; n < b.N; n++ { - postgres.CheckAcl(pgUsername, "test/topic/1", "test_id", MOSQ_ACL_READ) - } -} - -func BenchmarkPostgresSingleLevelAcl(b *testing.B) { - for n := 0; n < b.N; n++ { - postgres.CheckAcl(pgUsername, "test/topic/+", "test_id", MOSQ_ACL_READ) - } -} - -func BenchmarkPostgresHierarchyAcl(b *testing.B) { - for n := 0; n < b.N; n++ { - postgres.CheckAcl(pgUsername, "test/#", "test_id", MOSQ_ACL_READ) - } -} diff --git a/backends/postgres_test.go b/backends/postgres_test.go index ba71335..2a95b30 100644 --- a/backends/postgres_test.go +++ b/backends/postgres_test.go @@ -52,14 +52,14 @@ func TestPostgres(t *testing.T) { Convey("Given a username and a correct password, it should correctly authenticate it", func() { - authenticated := postgres.GetUser(username, userPass) + authenticated := postgres.GetUser(username, userPass, "") So(authenticated, ShouldBeTrue) }) Convey("Given a username and an incorrect password, it should not authenticate it", func() { - authenticated := postgres.GetUser(username, "wrong_password") + authenticated := postgres.GetUser(username, "wrong_password", "") So(authenticated, ShouldBeFalse) }) diff --git a/backends/redis.go b/backends/redis.go index a41a7f6..e820bcf 100644 --- a/backends/redis.go +++ b/backends/redis.go @@ -75,7 +75,7 @@ func NewRedis(authOpts map[string]string, logLevel log.Level) (Redis, error) { } //GetUser checks that the username exists and the given password hashes to the same password. -func (o Redis) GetUser(username, password string) bool { +func (o Redis) GetUser(username, password, clientid string) bool { pwHash, err := o.Conn.Get(username).Result() diff --git a/backends/redis_benchmark_test.go b/backends/redis_benchmark_test.go deleted file mode 100644 index 93d3187..0000000 --- a/backends/redis_benchmark_test.go +++ /dev/null @@ -1,96 +0,0 @@ -package backends - -import ( - "testing" - - log "github.com/sirupsen/logrus" -) - -var rbUsername = "test" -var rbUserPass = "testpw" -var rbUserPassHash = "PBKDF2$sha512$100000$os24lcPr9cJt2QDVWssblQ==$BK1BQ2wbwU1zNxv3Ml3wLuu5//hPop3/LvaPYjjCwdBvnpwusnukJPpcXQzyyjOlZdieXTx6sXAcX4WnZRZZnw==" - -var strictAcl = "test/topic/1" -var singleLevelAcl = "test/topic/+" -var hierarchyAcl = "test/#" - -var userPattern = "test/%u" -var clientPattern = "test/%c" - -var rbClientID = "test_client" - -var rbTestTopic1 = `test/topic/1` - -var redis Redis - -func init() { - var authOpts = map[string]string{ - "redis_host": "localhost", - "redis_port": "6379", - "redis_db": "2", - "redis_password": "", - } - var err error - redis, err = NewRedis(authOpts, log.ErrorLevel) - if err != nil { - log.Fatalf("Redis error: %s", err) - } - redis.Conn.FlushDB() -} - -func BenchmarkRedisUser(b *testing.B) { - redis.Conn.Set(rbUsername, rbUserPassHash, 0) - for n := 0; n < b.N; n++ { - redis.GetUser(rbUsername, rbUserPass) - } - redis.Conn.FlushDB() -} - -func BenchmarkRedisSuperuser(b *testing.B) { - redis.Conn.Set(rbUsername, rbUserPassHash, 0) - redis.Conn.Set(rbUsername+":su", "true", 0) - for n := 0; n < b.N; n++ { - redis.GetSuperuser(rbUsername) - } - redis.Conn.FlushDB() -} - -func BenchmarkRedisStrictAcl(b *testing.B) { - redis.Conn.SAdd(rbUsername+":acls", strictAcl) - for n := 0; n < b.N; n++ { - redis.CheckAcl(rbUsername, rbTestTopic1, rbClientID, MOSQ_ACL_READ) - } - redis.Conn.FlushDB() -} - -func BenchmarkRedisUserPatternAcl(b *testing.B) { - redis.Conn.SAdd(rbUsername+":acls", userPattern) - for n := 0; n < b.N; n++ { - redis.CheckAcl(rbUsername, "test/test", rbClientID, MOSQ_ACL_READ) - } - redis.Conn.FlushDB() -} - -func BenchmarkRedisClientPatternAcl(b *testing.B) { - redis.Conn.SAdd(rbUsername+":acls", clientPattern) - for n := 0; n < b.N; n++ { - redis.CheckAcl(rbUsername, "test/test_client", rbClientID, MOSQ_ACL_READ) - } - redis.Conn.FlushDB() -} - -func BenchmarkRedisSingleLevelAcl(b *testing.B) { - redis.Conn.SAdd(rbUsername+":acls", singleLevelAcl) - for n := 0; n < b.N; n++ { - redis.CheckAcl(rbUsername, "test/topic/whatever", rbClientID, MOSQ_ACL_READ) - } - redis.Conn.FlushDB() -} - -func BenchmarkRedisHierarchyAcl(b *testing.B) { - redis.Conn.SAdd(rbUsername+":acls", hierarchyAcl) - for n := 0; n < b.N; n++ { - redis.CheckAcl(rbUsername, "test/what/ever", rbClientID, MOSQ_ACL_READ) - } - redis.Conn.FlushDB() -} diff --git a/backends/redis_test.go b/backends/redis_test.go index b8b9b00..02589bf 100644 --- a/backends/redis_test.go +++ b/backends/redis_test.go @@ -33,14 +33,14 @@ func TestRedis(t *testing.T) { Convey("Given a username and a correct password, it should correctly authenticate it", func() { - authenticated := redis.GetUser(username, userPass) + authenticated := redis.GetUser(username, userPass, "") So(authenticated, ShouldBeTrue) }) Convey("Given a username and an incorrect password, it should not authenticate it", func() { - authenticated := redis.GetUser(username, "wrong_password") + authenticated := redis.GetUser(username, "wrong_password", "") So(authenticated, ShouldBeFalse) }) diff --git a/backends/sqlite.go b/backends/sqlite.go index 584cfd8..601e6d4 100644 --- a/backends/sqlite.go +++ b/backends/sqlite.go @@ -81,7 +81,7 @@ func NewSqlite(authOpts map[string]string, logLevel log.Level) (Sqlite, error) { } //GetUser checks that the username exists and the given password hashes to the same password. -func (o Sqlite) GetUser(username, password string) bool { +func (o Sqlite) GetUser(username, password, clientid string) bool { var pwHash sql.NullString err := o.DB.Get(&pwHash, o.UserQuery, username) diff --git a/backends/sqlite_test.go b/backends/sqlite_test.go index 07c042b..ce25c01 100644 --- a/backends/sqlite_test.go +++ b/backends/sqlite_test.go @@ -87,14 +87,14 @@ func TestFileSqlite(t *testing.T) { Convey("Given a username and a correct password, it should correctly authenticate it", func() { - authenticated := sqlite.GetUser(username, userPass) + authenticated := sqlite.GetUser(username, userPass, "") So(authenticated, ShouldBeTrue) }) Convey("Given a username and an incorrect password, it should not authenticate it", func() { - authenticated := sqlite.GetUser(username, "wrong_password") + authenticated := sqlite.GetUser(username, "wrong_password", "") So(authenticated, ShouldBeFalse) }) @@ -256,14 +256,14 @@ func TestMemorySqlite(t *testing.T) { Convey("Given a username and a correct password, it should correctly authenticate it", func() { - authenticated := sqlite.GetUser(username, userPass) + authenticated := sqlite.GetUser(username, userPass, "") So(authenticated, ShouldBeTrue) }) Convey("Given a username and an incorrect password, it should not authenticate it", func() { - authenticated := sqlite.GetUser(username, "wrong_password") + authenticated := sqlite.GetUser(username, "wrong_password", "") So(authenticated, ShouldBeFalse) }) diff --git a/go-auth.go b/go-auth.go index a3c48be..11c43b4 100644 --- a/go-auth.go +++ b/go-auth.go @@ -20,7 +20,7 @@ import ( ) type Backend interface { - GetUser(username, password string) bool + GetUser(username, password, clientid string) bool GetSuperuser(username string) bool CheckAcl(username, topic, clientId string, acc int32) bool GetName() string @@ -450,7 +450,7 @@ func AuthPluginInit(keys []string, values []string, authOptsNum int) { } //export AuthUnpwdCheck -func AuthUnpwdCheck(username, password string) bool { +func AuthUnpwdCheck(username, password, clientid string) bool { authenticated := false var cached = false @@ -470,12 +470,12 @@ func AuthUnpwdCheck(username, password string) bool { if validPrefix { if bename == "plugin" { - authenticated = CheckPluginAuth(username, password) + authenticated = CheckPluginAuth(username, password, clientid) } else { var backend = commonData.Backends[bename] - if backend.GetUser(username, password) { + if backend.GetUser(username, password, clientid) { authenticated = true log.Debugf("user %s authenticated with backend %s", username, backend.GetName()) } @@ -484,17 +484,17 @@ func AuthUnpwdCheck(username, password string) bool { } else { //If there's no valid prefix, check all backends. - authenticated = CheckBackendsAuth(username, password) + authenticated = CheckBackendsAuth(username, password, clientid) //If not authenticated, check for a present plugin if !authenticated { - authenticated = CheckPluginAuth(username, password) + authenticated = CheckPluginAuth(username, password, clientid) } } } else { - authenticated = CheckBackendsAuth(username, password) + authenticated = CheckBackendsAuth(username, password, clientid) //If not authenticated, check for a present plugin if !authenticated { - authenticated = CheckPluginAuth(username, password) + authenticated = CheckPluginAuth(username, password, clientid) } } @@ -655,7 +655,7 @@ func CheckPrefix(username string) (bool, string) { } //CheckBackendsAuth checks for all backends if a username is authenticated and sets the authenticated param. -func CheckBackendsAuth(username, password string) bool { +func CheckBackendsAuth(username, password, clientid string) bool { authenticated := false @@ -669,7 +669,7 @@ func CheckBackendsAuth(username, password string) bool { log.Debugf("checking user %s with backend %s", username, backend.GetName()) - if backend.GetUser(username, password) { + if backend.GetUser(username, password, clientid) { authenticated = true log.Debugf("user %s authenticated with backend %s", username, backend.GetName()) break @@ -725,7 +725,7 @@ func CheckBackendsAcl(username, topic, clientid string, acc int) bool { } //CheckPluginAuth checks that the plugin is not nil and returns the plugins auth response. -func CheckPluginAuth(username, password string) bool { +func CheckPluginAuth(username, password, clientid string) bool { if commonData.Plugin == nil { return false } diff --git a/go.mod b/go.mod index 2c5861a..f8d5006 100644 --- a/go.mod +++ b/go.mod @@ -8,29 +8,31 @@ require ( github.com/brocaar/lorawan v0.0.0-20190523144945-4c051b1fa597 // indirect github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/eclipse/paho.mqtt.golang v1.2.0 // indirect - github.com/go-redis/redis v6.14.1+incompatible - github.com/go-sql-driver/mysql v1.4.0 - github.com/go-stack/stack v1.8.0 // indirect - github.com/golang/protobuf v1.3.1 - github.com/golang/snappy v0.0.1 // indirect + github.com/go-redis/redis v6.15.7+incompatible + github.com/go-sql-driver/mysql v1.5.0 + github.com/golang/protobuf v1.3.3 github.com/gomodule/redigo v2.0.0+incompatible // indirect github.com/googleapis/gax-go v2.0.2+incompatible // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 + github.com/grpc-ecosystem/go-grpc-middleware v1.2.0 github.com/grpc-ecosystem/grpc-gateway v1.9.0 // indirect - github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0 - github.com/lib/pq v1.0.0 - github.com/mattn/go-sqlite3 v1.9.0 + github.com/jmoiron/sqlx v1.2.0 + github.com/klauspost/compress v1.10.1 // indirect + github.com/lib/pq v1.3.0 + github.com/mattn/go-sqlite3 v2.0.3+incompatible github.com/onsi/ginkgo v1.8.0 // indirect github.com/onsi/gomega v1.5.0 // indirect - github.com/pkg/errors v0.8.1 - github.com/sirupsen/logrus v1.3.0 + github.com/pkg/errors v0.9.1 + github.com/sirupsen/logrus v1.4.2 github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a - github.com/tidwall/pretty v0.0.0-20190325153808-1166b9ac2b65 // indirect - github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c // indirect github.com/xdg/stringprep v1.0.0 // indirect - go.mongodb.org/mongo-driver v1.0.0 + go.mongodb.org/mongo-driver v1.3.0 go.opencensus.io v0.22.0 // indirect - golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c + golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d + golang.org/x/net v0.0.0-20200219183655-46282727080f // indirect + golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect + golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c // indirect google.golang.org/api v0.6.0 // indirect - google.golang.org/grpc v1.21.1 + google.golang.org/appengine v1.6.5 // indirect + google.golang.org/genproto v0.0.0-20200218151345-dad8c97a84f5 // indirect + google.golang.org/grpc v1.27.1 ) diff --git a/go.sum b/go.sum index 9ef5550..8de5cc4 100644 --- a/go.sum +++ b/go.sum @@ -11,6 +11,7 @@ github.com/brocaar/loraserver v2.5.0+incompatible h1:Fna4CF0jW2Vl4UpjLIhR5ifW4g+ github.com/brocaar/loraserver v2.5.0+incompatible/go.mod h1:VBTim0YtfWAKehjJ6k17jCnG44DzXVdL4iu+hwxg2ik= github.com/brocaar/lorawan v0.0.0-20190523144945-4c051b1fa597 h1:bYzV3+MYStooVxZwloCHvOUDsFjTKS8vdRJ9jZkEd/s= github.com/brocaar/lorawan v0.0.0-20190523144945-4c051b1fa597/go.mod h1:Fm+51pxK6mZoAQjIaWJqPmnRuXecozsM5Mf9c+kr/ko= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -19,16 +20,49 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumC github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/eclipse/paho.mqtt.golang v1.2.0 h1:1F8mhG9+aO5/xpdtFkW4SxOJB67ukuDC3t2y2qayIX0= github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-redis/redis v6.14.1+incompatible h1:kSJohAREGMr344uMa8PzuIg5OU6ylCbyDkWkkNOfEik= github.com/go-redis/redis v6.14.1+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U= +github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.4.0 h1:7LxgVwFb2hIQtMm87NdgAVfXjnt4OePseqT1tKx+opk= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -37,6 +71,9 @@ github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= @@ -57,6 +94,8 @@ github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORR github.com/gopherjs/gopherjs v0.0.0-20190328170749-bb2674552d8f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.0 h1:0IKlLyQ3Hs9nDaiK5cSHAGmcQEIC8l2Ts1u6x5Dfrqg= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s= github.com/grpc-ecosystem/grpc-gateway v1.9.0 h1:bM6ZAFZmc/wPFaRDi0d5L7hGEZEx/2u+Tmr2evNHDiI= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -64,6 +103,7 @@ github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jacobsa/crypto v0.0.0-20180924003735-d95898ceee07 h1:/PaS1RNKtbBEndIvzCqIgYh6GAH9ZFc8Mj4tVRVyfOA= github.com/jacobsa/crypto v0.0.0-20180924003735-d95898ceee07/go.mod h1:LadVJg0XuawGk+8L1rYnIED8451UyNxEMdTWCEt5kmU= github.com/jacobsa/oglematchers v0.0.0-20150720000706-141901ea67cd/go.mod h1:TlmyIZDpGmwRoTWiakdr+HA1Tukze6C6XbRVidYq02M= @@ -72,35 +112,70 @@ github.com/jacobsa/ogletest v0.0.0-20170503003838-80d50a735a11/go.mod h1:+DBdDyf github.com/jacobsa/reqtrace v0.0.0-20150505043853-245c9e0234cb/go.mod h1:ivcmUvxXWjb27NsPEaiYK7AidlZXS7oQ5PowUS9z3I4= github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0 h1:5B0uxl2lzNRVkJVg+uGHxWtRt4C0Wjc6kJKo5XYx8xE= github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0/go.mod h1:IiEW3SEiiErVyFdH8NTuWjSifiEQKUoyK3LNqr2kCHU= +github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA= +github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.9.5 h1:U+CaK85mrNNb4k8BNOfgJtJ/gr6kswUCFj6miSzVC6M= +github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.10.1 h1:a/QY0o9S6wCi0XhxaMX/QmusicNUqCqFugR6WKPOSoQ= +github.com/klauspost/compress v1.10.1/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe h1:CHRGQ8V7OlCYtwaKPJi3iA7J+YdNKdo8j7nG5IgDhjs= github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= +github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-sqlite3 v1.9.0 h1:pDRiWfl+++eC2FEFRy6jXmQlvp4Yh3z1MJKg4UeYM/4= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= +github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sirupsen/logrus v1.1.0 h1:65VZabgUiV9ktjGM5nTq0+YurgTyX+YI2lSSfDjI+qU= github.com/sirupsen/logrus v1.1.0/go.mod h1:zrgwTnHtNr00buQ1vSptGe8m1f/BbgsPukg8qsT7A+A= github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME= github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20190215210624-980c5ac6f3ac h1:wbW+Bybf9pXxnCFAOWZTqkRjAc7rAIwo2e1ArUhiHxg= github.com/smartystreets/assertions v0.0.0-20190215210624-980c5ac6f3ac/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -110,23 +185,33 @@ github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff h1:86HlEv0y github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff/go.mod h1:KSQcGKpxUMHk3nbYzs/tIBAM2iDooCn0BmttHOJEbLs= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/tidwall/pretty v0.0.0-20190325153808-1166b9ac2b65 h1:rQ229MBgvW68s1/g6f1/63TgYwYxfF4E+bi/KC19P8g= github.com/tidwall/pretty v0.0.0-20190325153808-1166b9ac2b65/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xdg/stringprep v1.0.0 h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0= github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= go.mongodb.org/mongo-driver v1.0.0 h1:KxPRDyfB2xXnDE2My8acoOWBQkfv3tz0SaWTRZjJR0c= go.mongodb.org/mongo-driver v1.0.0/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.3.0 h1:ew6uUIeJOo+qdUUv7LxFCUhtWmVv7ZV/Xuy4FAUsw2E= +go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4 h1:Vk3wNqEZwyGyei9yq5ekj7frek2u7HUfffJ1/opblzc= golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -134,6 +219,10 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90Pveol golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d h1:1ZiEyfaQIg3Qh0EoqpwAakHVhecoE5wlSg5GjnafJGw= +golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -150,9 +239,13 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190328230028-74de082e2cca/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c h1:uOCk1iQW6Vc18bnC13MfzScl+wdKBmM9Y9kU7Z83/lw= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20200219183655-46282727080f h1:dB42wwhNuwPvh8f+5zZWNcU+F2Xs/B9wXXwvUCOH7r8= +golang.org/x/net v0.0.0-20200219183655-46282727080f/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= @@ -162,8 +255,11 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -173,22 +269,36 @@ golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190402054613-e4093980e83e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c h1:jceGD5YNJGgGMkJz79agzOln1K9TaZUjv5ird16qniQ= +golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.6.0 h1:2tJEkRfnZL5g1GeBUlITh/rqT5HG3sFcoVCUUxmgJ2g= google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= @@ -196,7 +306,9 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.2.0 h1:S0iUepdCWODXRvtE+gcRDd15L+k+k1AiHlMiMjefH24= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -204,13 +316,21 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 h1:nfPFGzJkUDX6uBmpN/pSw7MbOAWegH5QDQuoXFHedLg= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200218151345-dad8c97a84f5 h1:jB9+PJSvu5tBfmJHy/OVapFdjDF3WvpkqRhxqrmzoEU= +google.golang.org/genproto v0.0.0-20200218151345-dad8c97a84f5/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= @@ -219,6 +339,8 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/grpc/auth.pb.go b/grpc/auth.pb.go index 2811643..97591e2 100644 --- a/grpc/auth.pb.go +++ b/grpc/auth.pb.go @@ -9,6 +9,8 @@ import ( proto "github.com/golang/protobuf/proto" empty "github.com/golang/protobuf/ptypes/empty" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" math "math" ) @@ -27,7 +29,9 @@ type GetUserRequest struct { // Username. Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // Plain text password. - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + // The client connection's id. + Clientid string `protobuf:"bytes,3,opt,name=clientid,proto3" json:"clientid,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -72,6 +76,13 @@ func (m *GetUserRequest) GetPassword() string { return "" } +func (m *GetUserRequest) GetClientid() string { + if m != nil { + return m.Clientid + } + return "" +} + type GetSuperuserRequest struct { // Username. Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` @@ -270,37 +281,37 @@ func init() { func init() { proto.RegisterFile("auth.proto", fileDescriptor_8bbd6f3875b0e874) } var fileDescriptor_8bbd6f3875b0e874 = []byte{ - // 331 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xdf, 0x4e, 0xc2, 0x30, - 0x14, 0xc6, 0x61, 0x0c, 0xc5, 0x23, 0x41, 0x53, 0xd1, 0x4c, 0x4c, 0x0c, 0xe9, 0x15, 0x57, 0x23, - 0x6a, 0x8c, 0xde, 0x19, 0x62, 0x0c, 0x5c, 0x79, 0x31, 0xe2, 0x03, 0x8c, 0x72, 0x84, 0x85, 0x41, - 0x4b, 0xff, 0x68, 0x7c, 0x2c, 0xdf, 0xd0, 0x74, 0x65, 0xcb, 0x24, 0x59, 0xc2, 0x5d, 0xcf, 0x77, - 0xfa, 0x9d, 0xaf, 0xfd, 0xe5, 0x00, 0xc4, 0x46, 0x2f, 0x43, 0x21, 0xb9, 0xe6, 0xc4, 0x5f, 0x48, - 0xc1, 0x7a, 0x37, 0x0b, 0xce, 0x17, 0x29, 0x0e, 0x33, 0x6d, 0x66, 0x3e, 0x87, 0xb8, 0x16, 0xfa, - 0xc7, 0x5d, 0xa1, 0x13, 0xe8, 0x8c, 0x51, 0x7f, 0x28, 0x94, 0x11, 0x6e, 0x0d, 0x2a, 0x4d, 0x7a, - 0xd0, 0x32, 0x0a, 0xe5, 0x26, 0x5e, 0x63, 0x50, 0xef, 0xd7, 0x07, 0x27, 0x51, 0x51, 0xdb, 0x9e, - 0x88, 0x95, 0xfa, 0xe6, 0x72, 0x1e, 0x78, 0xae, 0x97, 0xd7, 0xf4, 0x0e, 0x2e, 0xc6, 0xa8, 0xa7, - 0x46, 0xa0, 0x34, 0x87, 0x8d, 0xa3, 0x5b, 0x38, 0x7b, 0x5d, 0x22, 0x5b, 0x8d, 0x58, 0x7a, 0x48, - 0x7a, 0x17, 0x9a, 0x9a, 0x8b, 0x84, 0xed, 0xa2, 0x5d, 0x61, 0x1d, 0x2c, 0x4d, 0x70, 0xa3, 0x93, - 0x79, 0xd0, 0x70, 0x8e, 0xbc, 0x26, 0xe7, 0xd0, 0x88, 0x19, 0x0b, 0xfc, 0x7e, 0x7d, 0xd0, 0x8c, - 0xec, 0x91, 0xde, 0x42, 0x7b, 0x64, 0xf4, 0x32, 0x42, 0x25, 0xf8, 0x46, 0x21, 0xe9, 0x80, 0xc7, - 0x57, 0x59, 0x52, 0x2b, 0xf2, 0xf8, 0x8a, 0x52, 0x68, 0xbf, 0xc7, 0x6b, 0x2c, 0xfa, 0x04, 0xfc, - 0xd2, 0x5b, 0xb2, 0xf3, 0xfd, 0xaf, 0x07, 0xa7, 0x76, 0xc8, 0x14, 0xe5, 0x57, 0xc2, 0x90, 0x3c, - 0xc2, 0xf1, 0x8e, 0x21, 0xe9, 0x86, 0x16, 0x79, 0xf8, 0x1f, 0x69, 0x8f, 0x38, 0xb5, 0x1c, 0x4c, - 0x6b, 0xe4, 0x05, 0xda, 0x65, 0x60, 0xe4, 0xba, 0xf0, 0xee, 0x43, 0xac, 0x18, 0xf0, 0x04, 0xad, - 0x1c, 0x1f, 0xb9, 0x74, 0x37, 0xf6, 0x70, 0x56, 0x1a, 0xed, 0x83, 0xed, 0x3f, 0xc9, 0x55, 0xe8, - 0xb6, 0x23, 0xcc, 0xb7, 0x23, 0x7c, 0xb3, 0xdb, 0x91, 0x1b, 0xcb, 0x2c, 0x68, 0x8d, 0x3c, 0x83, - 0x3f, 0x89, 0x53, 0x5d, 0xe9, 0xaa, 0xd0, 0x69, 0x6d, 0x76, 0x94, 0x29, 0x0f, 0x7f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0xc9, 0x8a, 0xd9, 0x7b, 0x9f, 0x02, 0x00, 0x00, + // 333 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x4d, 0x4f, 0xc2, 0x40, + 0x14, 0x84, 0x52, 0x14, 0x9f, 0x04, 0xcd, 0x8a, 0xa6, 0x62, 0x62, 0xc8, 0x9e, 0x38, 0x95, 0xa8, + 0x31, 0x7a, 0x33, 0xc4, 0x18, 0x3c, 0x79, 0x28, 0xf1, 0x07, 0x94, 0xe5, 0x09, 0x0d, 0x85, 0x5d, + 0xf6, 0x43, 0xe3, 0xcf, 0xf2, 0x1f, 0x9a, 0xed, 0xd2, 0xa6, 0x92, 0xd4, 0x70, 0xdb, 0x99, 0xd9, + 0xd9, 0x37, 0x9d, 0x3e, 0x80, 0xd8, 0xe8, 0x45, 0x28, 0x24, 0xd7, 0x9c, 0xf8, 0x73, 0x29, 0x58, + 0xef, 0x6a, 0xce, 0xf9, 0x3c, 0xc5, 0x61, 0xc6, 0x4d, 0xcd, 0xc7, 0x10, 0x57, 0x42, 0x7f, 0xbb, + 0x2b, 0x74, 0x06, 0x9d, 0x31, 0xea, 0x77, 0x85, 0x32, 0xc2, 0x8d, 0x41, 0xa5, 0x49, 0x0f, 0x5a, + 0x46, 0xa1, 0x5c, 0xc7, 0x2b, 0x0c, 0xea, 0xfd, 0xfa, 0xe0, 0x28, 0x2a, 0xb0, 0xd5, 0x44, 0xac, + 0xd4, 0x17, 0x97, 0xb3, 0xc0, 0x73, 0x5a, 0x8e, 0xad, 0xc6, 0xd2, 0x04, 0xd7, 0x3a, 0x99, 0x05, + 0x0d, 0xa7, 0xe5, 0x98, 0xde, 0xc0, 0xd9, 0x18, 0xf5, 0xc4, 0x08, 0x94, 0x66, 0xbf, 0x51, 0x74, + 0x03, 0x27, 0xcf, 0x0b, 0x64, 0xcb, 0x11, 0x4b, 0xf7, 0x49, 0xd6, 0x85, 0xa6, 0xe6, 0x22, 0x61, + 0xdb, 0x58, 0x0e, 0xfc, 0x97, 0x89, 0x9c, 0x42, 0x23, 0x66, 0x2c, 0xf0, 0xfb, 0xf5, 0x41, 0x33, + 0xb2, 0x47, 0x7a, 0x0d, 0xed, 0x91, 0xd1, 0x8b, 0x08, 0x95, 0xe0, 0x6b, 0x85, 0xa4, 0x03, 0x1e, + 0x5f, 0x66, 0x93, 0x5a, 0x91, 0xc7, 0x97, 0x94, 0x42, 0xfb, 0x2d, 0x5e, 0x61, 0xa1, 0x13, 0xf0, + 0x4b, 0x59, 0xb2, 0xf3, 0xed, 0x8f, 0x07, 0xc7, 0xf6, 0x91, 0x09, 0xca, 0xcf, 0x84, 0x21, 0xb9, + 0x87, 0xc3, 0x6d, 0xbf, 0xa4, 0x1b, 0xda, 0xdf, 0x11, 0xfe, 0xad, 0xbb, 0x47, 0x1c, 0x5b, 0x1e, + 0x4c, 0x6b, 0xe4, 0x09, 0xda, 0xe5, 0xc2, 0xc8, 0x65, 0xe1, 0xdd, 0x2d, 0xb1, 0xe2, 0x81, 0x07, + 0x68, 0xe5, 0xf5, 0x91, 0x73, 0x77, 0x63, 0xa7, 0xce, 0x4a, 0xa3, 0x0d, 0x6c, 0xbf, 0x93, 0x5c, + 0x84, 0x6e, 0x73, 0xc2, 0x7c, 0x73, 0xc2, 0x17, 0xbb, 0x39, 0xb9, 0xb1, 0xdc, 0x05, 0xad, 0x91, + 0x47, 0xf0, 0x5f, 0xe3, 0x54, 0x57, 0xba, 0x2a, 0x78, 0x5a, 0x9b, 0x1e, 0x64, 0xcc, 0xdd, 0x6f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x83, 0x08, 0xf7, 0xf9, 0xbb, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConn +var _ grpc.ClientConnInterface // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +const _ = grpc.SupportPackageIsVersion6 // AuthServiceClient is the client API for AuthService service. // @@ -319,10 +330,10 @@ type AuthServiceClient interface { } type authServiceClient struct { - cc *grpc.ClientConn + cc grpc.ClientConnInterface } -func NewAuthServiceClient(cc *grpc.ClientConn) AuthServiceClient { +func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient { return &authServiceClient{cc} } @@ -385,6 +396,26 @@ type AuthServiceServer interface { Halt(context.Context, *empty.Empty) (*empty.Empty, error) } +// UnimplementedAuthServiceServer can be embedded to have forward compatible implementations. +type UnimplementedAuthServiceServer struct { +} + +func (*UnimplementedAuthServiceServer) GetUser(ctx context.Context, req *GetUserRequest) (*AuthResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") +} +func (*UnimplementedAuthServiceServer) GetSuperuser(ctx context.Context, req *GetSuperuserRequest) (*AuthResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSuperuser not implemented") +} +func (*UnimplementedAuthServiceServer) CheckAcl(ctx context.Context, req *CheckAclRequest) (*AuthResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckAcl not implemented") +} +func (*UnimplementedAuthServiceServer) GetName(ctx context.Context, req *empty.Empty) (*NameResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetName not implemented") +} +func (*UnimplementedAuthServiceServer) Halt(ctx context.Context, req *empty.Empty) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Halt not implemented") +} + func RegisterAuthServiceServer(s *grpc.Server, srv AuthServiceServer) { s.RegisterService(&_AuthService_serviceDesc, srv) } diff --git a/grpc/auth.proto b/grpc/auth.proto index 0cc4408..e5d3428 100644 --- a/grpc/auth.proto +++ b/grpc/auth.proto @@ -30,6 +30,8 @@ message GetUserRequest { string username = 1; // Plain text password. string password = 2; + // The client connection's id. + string clientid = 3; } message GetSuperuserRequest {