From 36726a1bfcc10e6c4e6079679a1b57a31fe86746 Mon Sep 17 00:00:00 2001 From: yyellowsun Date: Sun, 13 Dec 2020 17:48:37 +0800 Subject: [PATCH] feat: add batch operations Signed-off-by: yyellowsun --- adapter.go | 42 ++++++++++++- adapter_test.go | 164 +++++++++++++++++++++++++++++++++++++++++++----- go.mod | 4 +- go.sum | 24 +++++++ 4 files changed, 213 insertions(+), 21 deletions(-) diff --git a/adapter.go b/adapter.go index 190a6fa..bba521a 100644 --- a/adapter.go +++ b/adapter.go @@ -60,7 +60,7 @@ func finalizer(a *adapter) { // NewAdapter is the constructor for Adapter. If database name is not provided // in the Mongo URL, 'casbin' will be used as database name. -func NewAdapter(url string, timeout ...interface{}) (persist.Adapter, error) { +func NewAdapter(url string, timeout ...interface{}) (persist.BatchAdapter, error) { if !strings.HasPrefix(url, "mongodb+srv://") && !strings.HasPrefix(url, "mongodb://") { url = fmt.Sprint("mongodb://" + url) } @@ -83,7 +83,7 @@ func NewAdapter(url string, timeout ...interface{}) (persist.Adapter, error) { // NewAdapterWithClientOption is an alternative constructor for Adapter // that does the same as NewAdapter, but uses mongo.ClientOption instead of a Mongo URL -func NewAdapterWithClientOption(clientOption *options.ClientOptions, databaseName string, timeout ...interface{}) (persist.Adapter, error) { +func NewAdapterWithClientOption(clientOption *options.ClientOptions, databaseName string, timeout ...interface{}) (persist.BatchAdapter, error) { a := &adapter{ clientOption: clientOption, } @@ -309,6 +309,44 @@ func (a *adapter) AddPolicy(sec string, ptype string, rule []string) error { return nil } +// AddPolicies adds policy rules to the storage. +func (a *adapter) AddPolicies(sec string, ptype string, rules [][]string) error { + var lines []CasbinRule + for _,rule := range rules{ + line := savePolicyLine(ptype, rule) + lines = append(lines, line) + } + + for _,line := range lines{ + ctx, cancel := context.WithTimeout(context.TODO(), a.timeout) + defer cancel() + if _, err := a.collection.InsertOne(ctx, line); err != nil { + return err + } + } + + return nil +} + +// RemovePolicies removes policy rules from the storage. +func (a *adapter) RemovePolicies(sec string, ptype string, rules [][]string) error { + var lines []CasbinRule + for _,rule := range rules{ + line := savePolicyLine(ptype, rule) + lines = append(lines, line) + } + + for _,line := range lines{ + ctx, cancel := context.WithTimeout(context.TODO(), a.timeout) + defer cancel() + if _, err := a.collection.DeleteOne(ctx, line); err != nil { + return err + } + } + + return nil +} + // RemovePolicy removes a policy rule from the storage. func (a *adapter) RemovePolicy(sec string, ptype string, rule []string) error { line := savePolicyLine(ptype, rule) diff --git a/adapter_test.go b/adapter_test.go index 31118a2..065a6a6 100644 --- a/adapter_test.go +++ b/adapter_test.go @@ -72,7 +72,13 @@ func initPolicy(t *testing.T) { if err != nil { panic(err) } - testGetPolicy(t, e, [][]string{{"alice", "data1", "read"}, {"bob", "data2", "write"}, {"data2_admin", "data2", "read"}, {"data2_admin", "data2", "write"}}) + testGetPolicy(t, e, [][]string{ + {"alice", "data1", "read"}, + {"bob", "data2", "write"}, + {"data2_admin", "data2", "read"}, + {"data2_admin", "data2", "write"}, + }, + ) } func TestAdapter(t *testing.T) { @@ -93,12 +99,16 @@ func TestAdapter(t *testing.T) { if err != nil { panic(err) } - testGetPolicy(t, e, [][]string{{"alice", "data1", "read"}, {"bob", "data2", "write"}, {"data2_admin", "data2", "read"}, {"data2_admin", "data2", "write"}}) - + testGetPolicy(t, e, [][]string{ + {"alice", "data1", "read"}, + {"bob", "data2", "write"}, + {"data2_admin", "data2", "read"}, + {"data2_admin", "data2", "write"}, + }, + ) // AutoSave is enabled by default. // Now we disable it. e.EnableAutoSave(false) - // Because AutoSave is disabled, the policy change only affects the policy in Casbin enforcer, // it doesn't affect the policy in the storage. e.AddPolicy("alice", "data1", "write") @@ -107,7 +117,13 @@ func TestAdapter(t *testing.T) { t.Errorf("Expected LoadPolicy() to be successful; got %v", err) } // This is still the original policy. - testGetPolicy(t, e, [][]string{{"alice", "data1", "read"}, {"bob", "data2", "write"}, {"data2_admin", "data2", "read"}, {"data2_admin", "data2", "write"}}) + testGetPolicy(t, e, [][]string{ + {"alice", "data1", "read"}, + {"bob", "data2", "write"}, + {"data2_admin", "data2", "read"}, + {"data2_admin", "data2", "write"}, + }, + ) // Now we enable the AutoSave. e.EnableAutoSave(true) @@ -120,7 +136,14 @@ func TestAdapter(t *testing.T) { t.Errorf("Expected LoadPolicy() to be successful; got %v", err) } // The policy has a new rule: {"alice", "data1", "write"}. - testGetPolicy(t, e, [][]string{{"alice", "data1", "read"}, {"bob", "data2", "write"}, {"data2_admin", "data2", "read"}, {"data2_admin", "data2", "write"}, {"alice", "data1", "write"}}) + testGetPolicy(t, e, [][]string{ + {"alice", "data1", "read"}, + {"bob", "data2", "write"}, + {"data2_admin", "data2", "read"}, + {"data2_admin", "data2", "write"}, + {"alice", "data1", "write"}, + }, + ) // Remove the added rule. e.RemovePolicy("alice", "data1", "write") @@ -130,7 +153,13 @@ func TestAdapter(t *testing.T) { if err := e.LoadPolicy(); err != nil { t.Errorf("Expected LoadPolicy() to be successful; got %v", err) } - testGetPolicy(t, e, [][]string{{"alice", "data1", "read"}, {"bob", "data2", "write"}, {"data2_admin", "data2", "read"}, {"data2_admin", "data2", "write"}}) + testGetPolicy(t, e, [][]string{ + {"alice", "data1", "read"}, + {"bob", "data2", "write"}, + {"data2_admin", "data2", "read"}, + {"data2_admin", "data2", "write"}, + }, + ) // Remove "data2_admin" related policy rules via a filter. // Two rules: {"data2_admin", "data2", "read"}, {"data2_admin", "data2", "write"} are deleted. @@ -138,7 +167,11 @@ func TestAdapter(t *testing.T) { if err := e.LoadPolicy(); err != nil { t.Errorf("Expected LoadPolicy() to be successful; got %v", err) } - testGetPolicy(t, e, [][]string{{"alice", "data1", "read"}, {"bob", "data2", "write"}}) + testGetPolicy(t, e, [][]string{ + {"alice", "data1", "read"}, + {"bob", "data2", "write"}, + }, + ) e.RemoveFilteredPolicy(1, "data1") if err := e.LoadPolicy(); err != nil { @@ -152,12 +185,81 @@ func TestAdapter(t *testing.T) { } testGetPolicy(t, e, [][]string{}) } -func TestDeleteFilteredAdapter(t *testing.T) { + +func TestAddPolicies(t *testing.T) { + initPolicy(t) + a, err := NewAdapter(getDbURL()) if err != nil { panic(err) } + e, err := casbin.NewEnforcer("examples/rbac_model.conf", a) + if err != nil { + panic(err) + } + + testGetPolicy(t, e, [][]string{ + {"alice", "data1", "read"}, + {"bob", "data2", "write"}, + {"data2_admin", "data2", "read"}, + {"data2_admin", "data2", "write"}, + }, + ) + a.AddPolicies("p","p",[][]string{ + {"bob", "data2", "read"}, + {"alice", "data2", "write"}, + {"alice", "data2", "read"}, + {"bob", "data1", "write"}, + {"bob", "data1", "read"}, + }, + ) + + if err := e.LoadPolicy(); err != nil { + t.Errorf("Expected LoadPolicy() to be successful; got %v", err) + } + + testGetPolicy(t, e, [][]string{ + {"alice", "data1", "read"}, + {"bob", "data2", "write"}, + {"data2_admin", "data2", "read"}, + {"data2_admin", "data2", "write"}, + {"bob", "data2", "read"}, + {"alice", "data2", "write"}, + {"alice", "data2", "read"}, + {"bob", "data1", "write"}, + {"bob", "data1", "read"}, + }, + ) + + // Remove the added rule. + if err := a.RemovePolicies("p", "p", [][]string{ + {"bob", "data2", "read"}, + {"alice", "data2", "write"}, + {"alice", "data2", "read"}, + {"bob", "data1", "write"}, + {"bob", "data1", "read"}, + }); err != nil { + t.Errorf("Expected RemovePolicies() to be successful; got %v", err) + } + if err := e.LoadPolicy(); err != nil { + t.Errorf("Expected LoadPolicy() to be successful; got %v", err) + } + testGetPolicy(t, e, [][]string{ + {"alice", "data1", "read"}, + {"bob", "data2", "write"}, + {"data2_admin", "data2", "read"}, + {"data2_admin", "data2", "write"}, + }, + ) +} + +func TestDeleteFilteredAdapter(t *testing.T) { + a, err := NewFilteredAdapter(getDbURL()) + if err != nil { + panic(err) + } + e, err := casbin.NewEnforcer("examples/rbac_tenant_service.conf", a) if err != nil { panic(err) @@ -171,27 +273,47 @@ func TestDeleteFilteredAdapter(t *testing.T) { t.Errorf("Expected LoadPolicy() to be successful; got %v", err) } // The policy has a new rule: {"alice", "data1", "write"}. - testGetPolicy(t, e, [][]string{{"domain1", "alice", "data3", "read", "accept", "service1"}, - {"domain1", "alice", "data3", "write", "accept", "service2"}}) + testGetPolicy(t, e, [][]string{ + {"alice", "data1", "read"}, + {"bob", "data2", "write"}, + {"data2_admin", "data2", "read"}, + {"data2_admin", "data2", "write"}, + {"domain1", "alice", "data3", "read", "accept", "service1"}, + {"domain1", "alice", "data3", "write", "accept", "service2"}, + }, + ) // test RemoveFiltered Policy with "" fileds e.RemoveFilteredPolicy(0, "domain1", "", "", "read") if err := e.LoadPolicy(); err != nil { t.Errorf("Expected LoadPolicy() to be successful; got %v", err) } - testGetPolicy(t, e, [][]string{{"domain1", "alice", "data3", "write", "accept", "service2"}}) + testGetPolicy(t, e, [][]string{ + {"alice", "data1", "read"}, + {"bob", "data2", "write"}, + {"data2_admin", "data2", "read"}, + {"data2_admin", "data2", "write"}, + {"domain1", "alice", "data3", "write", "accept", "service2"}, + }, + ) e.RemoveFilteredPolicy(0, "domain1", "", "", "", "", "service2") if err := e.LoadPolicy(); err != nil { t.Errorf("Expected LoadPolicy() to be successful; got %v", err) } - testGetPolicy(t, e, [][]string{}) + testGetPolicy(t, e, [][]string{ + {"alice", "data1", "read"}, + {"bob", "data2", "write"}, + {"data2_admin", "data2", "read"}, + {"data2_admin", "data2", "write"}, + }, + ) } func TestFilteredAdapter(t *testing.T) { // Now the DB has policy, so we can provide a normal use case. // Create an adapter and an enforcer. // NewEnforcer() will load the policy automatically. - a, err := NewAdapter(getDbURL()) + a, err := NewFilteredAdapter(getDbURL()) if err != nil { panic(err) } @@ -200,7 +322,7 @@ func TestFilteredAdapter(t *testing.T) { if err != nil { panic(err) } - + // Load filtered policies from the database. e.AddPolicy("alice", "data1", "write") e.AddPolicy("bob", "data2", "write") @@ -218,7 +340,11 @@ func TestFilteredAdapter(t *testing.T) { t.Errorf("Expected LoadFilteredPolicy() to be successful; got %v", err) } // Only alice's policy should have been loaded, - testGetPolicy(t, e, [][]string{{"alice", "data1", "write"}}) + testGetPolicy(t, e, [][]string{ + {"alice", "data1", "read"}, + {"alice", "data1", "write"}, + }, + ) // Test safe handling of SavePolicy when using filtered policies. if err := e.SavePolicy(); err == nil { @@ -235,7 +361,11 @@ func TestFilteredAdapter(t *testing.T) { if err := e.LoadPolicy(); err != nil { t.Errorf("Expected LoadPolicy() to be successful; got %v", err) } - testGetPolicy(t, e, [][]string{}) + testGetPolicy(t, e, [][]string{ + {"alice", "data1", "read"}, + {"data2_admin", "data2", "read"}, + }, + ) } func TestNewAdapterWithInvalidURL(t *testing.T) { diff --git a/go.mod b/go.mod index fcf9e55..e15c644 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module github.com/casbin/mongodb-adapter/v3 go 1.13 require ( - github.com/casbin/casbin/v2 v2.12.0 - go.mongodb.org/mongo-driver v1.4.1 + github.com/casbin/casbin/v2 v2.19.4 + go.mongodb.org/mongo-driver v1.4.4 ) diff --git a/go.sum b/go.sum index de95048..f56545a 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,12 @@ github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1 github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/aws/aws-sdk-go v1.29.15 h1:0ms/213murpsujhsnxnNKNeVouW60aJqSd992Ks3mxs= github.com/aws/aws-sdk-go v1.29.15/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= +github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPIk= +github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/casbin/casbin/v2 v2.12.0 h1:sJSt0n9dNTrs8mfEq4JBaPDA8ybG9J3DOsfw7YL81FM= github.com/casbin/casbin/v2 v2.12.0/go.mod h1:XXtYGrs/0zlOsJMeRteEdVi/FsB0ph7KgNfjoCoJUD8= +github.com/casbin/casbin/v2 v2.19.4 h1:35C4BsSGnPBsFh+OkWcXQmw4ZR7+p4IwJrkWmg4iNXM= +github.com/casbin/casbin/v2 v2.19.4/go.mod h1:wUgota0cQbTXE6Vd+KWpg41726jFRi7upxio0sR+Xd0= 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= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -35,13 +39,18 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe 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/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= @@ -58,6 +67,7 @@ github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsI github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= 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= @@ -80,6 +90,7 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= 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= @@ -88,6 +99,8 @@ github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc h1:n+nNi93yXLkJvKwX github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= go.mongodb.org/mongo-driver v1.4.1 h1:38NSAyDPagwnFpUA/D5SFgbugUYR3NzYRNa4Qk9UxKs= go.mongodb.org/mongo-driver v1.4.1/go.mod h1:llVBH2pkj9HywK0Dtdt6lDikOjFLbceHVu/Rc0iMKLs= +go.mongodb.org/mongo-driver v1.4.4 h1:bsPHfODES+/yx2PCWzUYMH8xj6PVniPI8DQrsJuSXSs= +go.mongodb.org/mongo-driver v1.4.4/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= @@ -103,6 +116,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEha 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/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -110,17 +125,26 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w 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-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 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-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= 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/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=