From 228b04e01d67d91a6568209c4fd75fbb7ad6d20b Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:07:19 +0400 Subject: [PATCH 01/35] MSP-623 add domain structs --- domain/access_list.go | 22 +++++++++++++++++++ domain/application.go | 36 ++++++++++++++++++++++++++++++ domain/common.go | 11 ++++++++++ domain/domain.go | 27 +++++++++++++++++++++++ domain/error.go | 18 +++++++++++++++ domain/request.go | 17 --------------- domain/response.go | 51 ------------------------------------------- domain/service.go | 28 ++++++++++++++++++++++++ domain/system.go | 5 +++++ domain/token.go | 22 +++++++++++++++++++ 10 files changed, 169 insertions(+), 68 deletions(-) create mode 100644 domain/access_list.go create mode 100644 domain/application.go create mode 100644 domain/common.go create mode 100644 domain/domain.go create mode 100644 domain/error.go delete mode 100644 domain/request.go delete mode 100644 domain/response.go create mode 100644 domain/service.go create mode 100644 domain/system.go create mode 100644 domain/token.go diff --git a/domain/access_list.go b/domain/access_list.go new file mode 100644 index 0000000..4d142d4 --- /dev/null +++ b/domain/access_list.go @@ -0,0 +1,22 @@ +package domain + +type AccessListSetOneRequest struct { + AppId int `valid:"required~Required"` + Method string `valid:"required~Required"` + Value bool +} + +type AccessListSetOneResponse struct { + Count int +} + +type AccessListSetListRequest struct { + AppId int `valid:"required~Required"` + RemoveOld bool + Methods []MethodInfo +} + +type MethodInfo struct { + Method string + Value bool +} diff --git a/domain/application.go b/domain/application.go new file mode 100644 index 0000000..2929ac5 --- /dev/null +++ b/domain/application.go @@ -0,0 +1,36 @@ +package domain + +import ( + "time" +) + +type Application struct { + Id int + Name string + Description string + ServiceId int + Type string + CreatedAt time.Time + UpdatedAt time.Time +} + +type ApplicationCreateUpdateRequest struct { + Id int + Name string `valid:"required~Required"` + Description string + ServiceId int `valid:"required~Required"` + Type string `valid:"required~Required,in(SYSTEM|MOBILE)"` +} + +type ApplicationWithTokens struct { + App Application + Tokens []Token +} + +type ApplicationSimple struct { + Id int + Name string + Description string + Type string + Tokens []Token +} diff --git a/domain/common.go b/domain/common.go new file mode 100644 index 0000000..4d068ed --- /dev/null +++ b/domain/common.go @@ -0,0 +1,11 @@ +package domain + +type ( + Identity struct { + Id int `valid:"required~Required"` + } + + DeleteResponse struct { + Deleted int + } +) diff --git a/domain/domain.go b/domain/domain.go new file mode 100644 index 0000000..06bd8e1 --- /dev/null +++ b/domain/domain.go @@ -0,0 +1,27 @@ +package domain + +import ( + "time" +) + +type DomainCreateUpdateRequest struct { + Id int + Name string `valid:"required~Required"` + Description string +} + +type Domain struct { + Id int + Name string + Description string + SystemId int + CreatedAt time.Time + UpdatedAt time.Time +} + +type DomainWithService struct { + Id int + Name string + Description string + Services []*ServiceWithApps +} diff --git a/domain/error.go b/domain/error.go new file mode 100644 index 0000000..f925295 --- /dev/null +++ b/domain/error.go @@ -0,0 +1,18 @@ +package domain + +import ( + "github.com/pkg/errors" +) + +var ( + ErrDomainNotFound = errors.New("domain not found") + ErrDomainDuplicateName = errors.New("domain name already exist") + + ErrServiceNotFound = errors.New("service not found") + ErrServiceDuplicateName = errors.New("service name already exist") + + ErrSystemNotFound = errors.New("system not found") + + ErrApplicationNotFound = errors.New("application not found") + ErrApplicationDuplicateName = errors.New("application name already exist") +) diff --git a/domain/request.go b/domain/request.go deleted file mode 100644 index 43ed38e..0000000 --- a/domain/request.go +++ /dev/null @@ -1,17 +0,0 @@ -package domain - -type ( - Identity struct { - Id int32 `json:"id" valid:"required~Required"` - } - - RevokeTokensRequest struct { - AppId int32 `valid:"required~Required"` - Tokens []string - } - - CreateTokenRequest struct { - AppId int32 `valid:"required~Required"` - ExpireTimeMs int64 - } -) diff --git a/domain/response.go b/domain/response.go deleted file mode 100644 index 6f55d41..0000000 --- a/domain/response.go +++ /dev/null @@ -1,51 +0,0 @@ -package domain - -import "isp-system-service/entity" - -type ( - DeleteResponse struct { - Deleted int - } - - CountResponse struct { - Count int - } - - AppWithToken struct { - App entity.Application - Tokens []entity.Token - } - - DomainWithServices struct { - Id int32 - Name string - Description string - Services []*ServiceWithApps - } - - ServiceWithApps struct { - Id int32 - Name string - Description string - Apps []*SimpleApp - } - - SimpleApp struct { - Id int32 - Name string - Description string - Type string - Tokens []entity.Token - } - - MethodInfo struct { - Method string - Value bool - } - - SetListRequest struct { - AppId int32 - RemoveOld bool - Methods []MethodInfo - } -) diff --git a/domain/service.go b/domain/service.go new file mode 100644 index 0000000..5884c50 --- /dev/null +++ b/domain/service.go @@ -0,0 +1,28 @@ +package domain + +import ( + "time" +) + +type Service struct { + Id int + Name string + Description string + DomainId int + CreatedAt time.Time + UpdatedAt time.Time +} + +type ServiceCreateUpdateRequest struct { + Id int + Name string `valid:"required~Required"` + Description string + DomainId int `valid:"required~Required"` +} + +type ServiceWithApps struct { + Id int + Name string + Description string + Apps []*ApplicationSimple +} diff --git a/domain/system.go b/domain/system.go new file mode 100644 index 0000000..7fa0aea --- /dev/null +++ b/domain/system.go @@ -0,0 +1,5 @@ +package domain + +const ( + DefaultSystemId = 1 +) diff --git a/domain/token.go b/domain/token.go new file mode 100644 index 0000000..f6bf6f1 --- /dev/null +++ b/domain/token.go @@ -0,0 +1,22 @@ +package domain + +import ( + "time" +) + +type Token struct { + Token string + AppId int + ExpireTime int + CreatedAt time.Time +} + +type TokenRevokeRequest struct { + AppId int `valid:"required~Required"` + Tokens []string +} + +type TokenCreateRequest struct { + AppId int `valid:"required~Required"` + ExpireTimeMs int +} From 8c4393b861c081b6e28e6f912a2099ae9a7081c6 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 16:59:11 +0400 Subject: [PATCH 02/35] MSP-623 remove system repository --- model/system.go | 76 ------------------------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 model/system.go diff --git a/model/system.go b/model/system.go deleted file mode 100644 index 278de53..0000000 --- a/model/system.go +++ /dev/null @@ -1,76 +0,0 @@ -package model - -import ( - "isp-system-service/entity" - - "github.com/go-pg/pg/v9" - "github.com/go-pg/pg/v9/orm" - "github.com/integration-system/isp-lib/v2/database" -) - -var emptySystem = (*entity.System)(nil) - -type SystemRepository struct { - DB orm.DB - rxClient *database.RxDbClient -} - -func (r *SystemRepository) GetSystems(list []int32) ([]entity.System, error) { - res := make([]entity.System, 0) - q := r.getDb().Model(&res) - if len(res) > 0 { - q = q.Where("id IN (?)", pg.In(list)) - } - err := q.Order("created_at DESC").Select() - - return res, err -} - -func (r *SystemRepository) CreateSystem(system entity.System) (entity.System, error) { - _, err := r.getDb().Model(&system).Insert() - - return system, err -} - -func (r *SystemRepository) GetSystemByName(name string) (*entity.System, error) { - sys := new(entity.System) - err := r.getDb().Model(sys).Where("name = ?", name).First() - if err == pg.ErrNoRows { - return nil, nil - } - - return sys, err -} - -func (r *SystemRepository) UpdateSystem(system entity.System) (entity.System, error) { - _, err := r.getDb().Model(&system).Column("name", "description").WherePK().Returning("*").Update() - - return system, err -} - -func (r *SystemRepository) GetSystemById(id int32) (*entity.System, error) { - sys := &entity.System{Id: id} - err := r.getDb().Select(sys) - if err == pg.ErrNoRows { - return nil, nil - } - - return sys, err -} - -func (r *SystemRepository) DeleteSystems(list []int32) (int, error) { - res, err := r.getDb().Model(emptySystem).Where("id IN (?)", pg.In(list)).Delete() - if err != nil { - return 0, err - } - - return res.RowsAffected(), nil -} - -func (r *SystemRepository) getDb() orm.DB { - if r.DB != nil { - return r.DB - } - - return r.rxClient.Unsafe() -} From bd7a06f8f0afc103536723058f59d1a09b0019b4 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:00:21 +0400 Subject: [PATCH 03/35] MSP-623 reimplement service repository --- model/service.go | 83 ---------------------- repository/service.go | 156 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 156 insertions(+), 83 deletions(-) delete mode 100644 model/service.go create mode 100644 repository/service.go diff --git a/model/service.go b/model/service.go deleted file mode 100644 index 1926d7d..0000000 --- a/model/service.go +++ /dev/null @@ -1,83 +0,0 @@ -package model - -import ( - "isp-system-service/entity" - - "github.com/go-pg/pg/v9" - "github.com/go-pg/pg/v9/orm" - "github.com/integration-system/isp-lib/v2/database" -) - -var emptyService = (*entity.Service)(nil) - -type ServiceRepository struct { - DB orm.DB - rxClient *database.RxDbClient -} - -func (r *ServiceRepository) GetServices(list []int32) ([]entity.Service, error) { - res := make([]entity.Service, 0) - q := r.getDb().Model(&res) - if len(res) > 0 { - q = q.Where("id IN (?)", pg.In(list)) - } - err := q.Order("created_at DESC").Select() - - return res, err -} - -func (r *ServiceRepository) GetServicesByDomainId(domainId ...int32) ([]entity.Service, error) { - res := make([]entity.Service, 0) - err := r.getDb().Model(&res).Where("domain_id IN (?)", pg.In(domainId)).Order("created_at DESC").Select() - - return res, err -} - -func (r *ServiceRepository) CreateService(service entity.Service) (entity.Service, error) { - _, err := r.getDb().Model(&service).Insert() - - return service, err -} - -func (r *ServiceRepository) GetServiceByNameAndDomainId(name string, domainId int32) (*entity.Service, error) { - service := new(entity.Service) - err := r.getDb().Model(service).Where("name = ? AND domain_id = ?", name, domainId).First() - if err == pg.ErrNoRows { - return nil, nil - } - - return service, err -} - -func (r *ServiceRepository) UpdateService(service entity.Service) (entity.Service, error) { - _, err := r.getDb().Model(&service).Column("name", "description").WherePK().Returning("*").Update() - - return service, err -} - -func (r *ServiceRepository) GetServiceById(id int32) (*entity.Service, error) { - service := &entity.Service{Id: id} - err := r.getDb().Select(service) - if err == pg.ErrNoRows { - return nil, nil - } - - return service, err -} - -func (r *ServiceRepository) DeleteServices(list []int32) (int, error) { - res, err := r.getDb().Model(emptyService).Where("id IN (?)", pg.In(list)).Delete() - if err != nil { - return 0, err - } - - return res.RowsAffected(), nil -} - -func (r *ServiceRepository) getDb() orm.DB { - if r.DB != nil { - return r.DB - } - - return r.rxClient.Unsafe() -} diff --git a/repository/service.go b/repository/service.go new file mode 100644 index 0000000..d87dda1 --- /dev/null +++ b/repository/service.go @@ -0,0 +1,156 @@ +package repository + +import ( + "context" + "database/sql" + + "github.com/Masterminds/squirrel" + "github.com/integration-system/isp-kit/db" + "github.com/integration-system/isp-kit/db/query" + "github.com/pkg/errors" + "isp-system-service/domain" + "isp-system-service/entity" +) + +type Service struct { + db db.DB +} + +func NewService(db db.DB) Service { + return Service{ + db: db, + } +} + +func (r Service) GetServiceById(ctx context.Context, id int) (*entity.Service, error) { + q := ` + SELECT id, name, description, domain_id, created_at, updated_at + FROM service + WHERE id = $1 +` + result := entity.Service{} + err := r.db.SelectRow(ctx, &result, q, id) + if err != nil { + if err == sql.ErrNoRows { + return nil, domain.ErrServiceNotFound + } + return nil, errors.WithMessage(err, "select row db") + } + + return &result, nil +} + +func (r Service) GetServiceByIdList(ctx context.Context, idList []int) ([]entity.Service, error) { + q, arg, err := query.New(). + Select("id", "name", "description", "domain_id", "created_at", "updated_at"). + From("service"). + Where(squirrel.Eq{"id": idList}). + OrderBy("created_at DESC"). + ToSql() + if err != nil { + return nil, errors.WithMessage(err, "build query") + } + + result := make([]entity.Service, 0) + err = r.db.Select(ctx, &result, q, arg...) + if err != nil { + return nil, errors.WithMessagef(err, "select db") + } + + return result, nil +} + +func (r Service) GetServiceByDomainId(ctx context.Context, domainIdList []int) ([]entity.Service, error) { + q, arg, err := query.New(). + Select("id", "name", "description", "domain_id", "created_at", "updated_at"). + From("service"). + Where(squirrel.Eq{"domain_id": domainIdList}). + OrderBy("created_at DESC"). + ToSql() + if err != nil { + return nil, errors.WithMessage(err, "build query") + } + + result := make([]entity.Service, 0) + err = r.db.Select(ctx, &result, q, arg...) + if err != nil { + return nil, errors.WithMessagef(err, "select db") + } + + return result, nil +} + +func (r Service) GetServiceByNameAndDomainId(ctx context.Context, name string, domainId int) (*entity.Service, error) { + q := ` + SELECT id, name, description, domain_id, created_at, updated_at + FROM service + WHERE name = $1 AND domain_id = $2 +` + result := entity.Service{} + err := r.db.SelectRow(ctx, &result, q, name, domainId) + if err != nil { + if err == sql.ErrNoRows { + return nil, domain.ErrServiceNotFound + } + return nil, errors.WithMessage(err, "select db") + } + + return &result, nil +} + +func (r Service) CreateService(ctx context.Context, name string, desc string, domainId int) (*entity.Service, error) { + q := ` + INSERT INTO service + (name, description, domain_id) + VALUES ($1, $2, $3) + RETURNING id, name, description, domain_id, created_at, updated_at +` + result := entity.Service{} + err := r.db.SelectRow(ctx, &result, q, name, desc, domainId) + if err != nil { + return nil, errors.WithMessage(err, "select row db") + } + + return &result, nil +} + +func (r Service) UpdateService(ctx context.Context, id int, name string, description string) (*entity.Service, error) { + q := ` + UPDATE service + SET name = $1, description = $2 + WHERE id = $3 + RETURNING id, name, description, domain_id, created_at, updated_at +` + result := entity.Service{} + err := r.db.SelectRow(ctx, &result, q, name, description, id) + if err != nil { + if err == sql.ErrNoRows { + return nil, domain.ErrServiceNotFound + } + return nil, errors.WithMessage(err, "select row db") + } + + return &result, nil +} + +func (r Service) DeleteService(ctx context.Context, idList []int) (int, error) { + q, args, err := query.New(). + Delete("service"). + Where(squirrel.Eq{"id": idList}). + ToSql() + if err != nil { + return 0, errors.WithMessagef(err, "build query") + } + + result, err := r.db.Exec(ctx, q, args...) + if err != nil { + return 0, errors.WithMessagef(err, "exec db") + } + + rowsAffected, err := result.RowsAffected() + if err != nil { + return 0, errors.WithMessagef(err, "get rows affected") + } + + return int(rowsAffected), nil +} From 0f4c57cb67a7fc18ea0d161b00c39c256a4f8731 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:00:50 +0400 Subject: [PATCH 04/35] MSP-623 reimplement token repository --- model/token.go | 56 --------------------------- repository/token.go | 94 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 56 deletions(-) delete mode 100644 model/token.go create mode 100644 repository/token.go diff --git a/model/token.go b/model/token.go deleted file mode 100644 index 2ecff22..0000000 --- a/model/token.go +++ /dev/null @@ -1,56 +0,0 @@ -package model - -import ( - "isp-system-service/entity" - - "github.com/go-pg/pg/v9" - "github.com/go-pg/pg/v9/orm" - "github.com/integration-system/isp-lib/v2/database" -) - -var emptyToken = (*entity.Token)(nil) - -type TokenRepository struct { - DB orm.DB - rxClient *database.RxDbClient -} - -func (r *TokenRepository) SaveToken(token entity.Token) (entity.Token, error) { - _, err := r.getDb().Model(&token).Insert() - - return token, err -} - -func (r *TokenRepository) GetTokenById(id string) (*entity.Token, error) { - token := &entity.Token{Token: id} - err := r.getDb().Select(token) - if err == pg.ErrNoRows { - return nil, nil - } - - return token, err -} - -func (r *TokenRepository) GetTokensByAppId(appId ...int32) ([]entity.Token, error) { - res := make([]entity.Token, 0) - err := r.getDb().Model(&res).Where("app_id IN (?)", pg.In(appId)).Order("created_at DESC").Select() - - return res, err -} - -func (r *TokenRepository) DeleteTokens(tokens []string) (int, error) { - res, err := r.getDb().Model(emptyToken).Where("token IN (?)", pg.In(tokens)).Delete() - if err != nil { - return 0, err - } - - return res.RowsAffected(), nil -} - -func (r *TokenRepository) getDb() orm.DB { - if r.DB != nil { - return r.DB - } - - return r.rxClient.Unsafe() -} diff --git a/repository/token.go b/repository/token.go new file mode 100644 index 0000000..83165b7 --- /dev/null +++ b/repository/token.go @@ -0,0 +1,94 @@ +package repository + +import ( + "context" + + "github.com/Masterminds/squirrel" + "github.com/integration-system/isp-kit/db" + "github.com/integration-system/isp-kit/db/query" + "github.com/pkg/errors" + "isp-system-service/entity" +) + +type Token struct { + db db.DB +} + +func NewToken(db db.DB) Token { + return Token{ + db: db, + } +} + +func (r Token) SaveToken(ctx context.Context, token string, appId int, expireTime int) (*entity.Token, error) { + q := ` + INSERT INTO token + (token, app_id, expire_time) + VALUES ($1, $2, $3) + RETURNING token, app_id, expire_time, created_at +` + result := entity.Token{} + err := r.db.SelectRow(ctx, &result, q, token, appId, expireTime) + if err != nil { + return nil, errors.WithMessage(err, "select row db") + } + + return &result, nil +} + +func (r Token) GetTokenById(ctx context.Context, token string) (*entity.Token, error) { + q := ` + SELECT token, app_id, expire_time, created_at + FROM system + WHERE token = $1 +` + result := entity.Token{} + err := r.db.SelectRow(ctx, &result, q, token) + if err != nil { + return nil, errors.WithMessage(err, "select row db") + } + + return &result, nil +} + +func (r Token) GetTokenByAppIdList(ctx context.Context, appIdList []int) ([]entity.Token, error) { + q, args, err := query.New(). + Select("token", "app_id", "expire_time", "created_at"). + From("token"). + Where(squirrel.Eq{"app_id": appIdList}). + OrderBy("created_at DESC"). + ToSql() + if err != nil { + return nil, errors.WithMessage(err, "build query") + } + + result := make([]entity.Token, 0) + err = r.db.Select(ctx, &result, q, args...) + if err != nil { + return nil, errors.WithMessagef(err, "select db") + } + + return result, nil +} + +func (r Token) DeleteToken(ctx context.Context, tokens []string) (int, error) { + q, args, err := query.New(). + Delete("token"). + Where(squirrel.Eq{"token": tokens}). + ToSql() + if err != nil { + return 0, errors.WithMessagef(err, "build query") + } + + result, err := r.db.Exec(ctx, q, args...) + if err != nil { + return 0, errors.WithMessagef(err, "exec db") + } + + rowsAffected, err := result.RowsAffected() + if err != nil { + return 0, errors.WithMessagef(err, "get rows affected") + } + + return int(rowsAffected), nil +} From a7c58f86ec0cacd95da4bb10ef6f136f8d5a459d Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:01:30 +0400 Subject: [PATCH 05/35] MSP-623 reimplement application repository --- model/application.go | 83 -------------------- repository/application.go | 155 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+), 83 deletions(-) delete mode 100644 model/application.go create mode 100644 repository/application.go diff --git a/model/application.go b/model/application.go deleted file mode 100644 index 3824d22..0000000 --- a/model/application.go +++ /dev/null @@ -1,83 +0,0 @@ -package model - -import ( - "isp-system-service/entity" - - "github.com/go-pg/pg/v9" - "github.com/go-pg/pg/v9/orm" - "github.com/integration-system/isp-lib/v2/database" -) - -var emptyApplication = (*entity.Application)(nil) - -type AppRepository struct { - DB orm.DB - rxClient *database.RxDbClient -} - -func (r *AppRepository) GetApplications(list []int32) ([]entity.Application, error) { - res := make([]entity.Application, 0) - q := r.getDb().Model(&res) - if len(res) > 0 { - q = q.Where("id IN (?)", pg.In(list)) - } - err := q.Order("created_at DESC").Select() - - return res, err -} - -func (r *AppRepository) GetApplicationsByServiceId(serviceId ...int32) ([]entity.Application, error) { - res := make([]entity.Application, 0) - err := r.getDb().Model(&res).Where("service_id IN (?)", pg.In(serviceId)).Order("created_at DESC").Select() - - return res, err -} - -func (r *AppRepository) CreateApplication(service entity.Application) (entity.Application, error) { - _, err := r.getDb().Model(&service).Insert() - - return service, err -} - -func (r *AppRepository) GetApplicationByNameAndServiceId(name string, serviceId int32) (*entity.Application, error) { - app := new(entity.Application) - err := r.getDb().Model(app).Where("name = ? AND service_id = ?", name, serviceId).First() - if err == pg.ErrNoRows { - return nil, nil - } - - return app, err -} - -func (r *AppRepository) UpdateApplication(app entity.Application) (entity.Application, error) { - _, err := r.getDb().Model(&app).Column("name", "description").WherePK().Returning("*").Update() - - return app, err -} - -func (r *AppRepository) GetApplicationById(id int32) (*entity.Application, error) { - app := &entity.Application{Id: id} - err := r.getDb().Select(app) - if err == pg.ErrNoRows { - return nil, nil - } - - return app, err -} - -func (r *AppRepository) DeleteApplications(list []int32) (int, error) { - res, err := r.getDb().Model(emptyApplication).Where("id IN (?)", pg.In(list)).Delete() - if err != nil { - return 0, err - } - - return res.RowsAffected(), nil -} - -func (r *AppRepository) getDb() orm.DB { - if r.DB != nil { - return r.DB - } - - return r.rxClient.Unsafe() -} diff --git a/repository/application.go b/repository/application.go new file mode 100644 index 0000000..148d299 --- /dev/null +++ b/repository/application.go @@ -0,0 +1,155 @@ +package repository + +import ( + "context" + "database/sql" + + "github.com/Masterminds/squirrel" + "github.com/integration-system/isp-kit/db" + "github.com/integration-system/isp-kit/db/query" + "github.com/pkg/errors" + "isp-system-service/domain" + "isp-system-service/entity" +) + +type Application struct { + db db.DB +} + +func NewApplication(db db.DB) Application { + return Application{ + db: db, + } +} + +func (r Application) GetApplicationById(ctx context.Context, id int) (*entity.Application, error) { + q := ` + SELECT id, name, description, service_id, type, created_at, updated_at + FROM application + WHERE id = $1 +` + result := entity.Application{} + err := r.db.SelectRow(ctx, &result, q, id) + if err != nil { + if err == sql.ErrNoRows { + return nil, domain.ErrApplicationNotFound + } + return nil, errors.WithMessage(err, "select row db") + } + + return &result, nil +} + +func (r Application) GetApplicationByIdList(ctx context.Context, idList []int) ([]entity.Application, error) { + q, args, err := query.New(). + Select("id", "name", "description", "service_id", "type", "created_at", "updated_at"). + From("application"). + Where(squirrel.Eq{"id": idList}). + OrderBy("created_at DESC"). + ToSql() + if err != nil { + return nil, errors.WithMessage(err, "build query") + } + + result := make([]entity.Application, 0) + err = r.db.Select(ctx, &result, q, args...) + if err != nil { + return nil, errors.WithMessagef(err, "select db") + } + + return result, nil +} + +func (r Application) GetApplicationByServiceIdList(ctx context.Context, serviceIdList []int) ([]entity.Application, error) { + q, args, err := query.New(). + Select("id", "name", "description", "service_id", "type", "created_at", "updated_at"). + From("application"). + Where(squirrel.Eq{"service_id": serviceIdList}). + OrderBy("created_at DESC"). + ToSql() + if err != nil { + return nil, errors.WithMessage(err, "build query") + } + + result := make([]entity.Application, 0) + err = r.db.Select(ctx, &result, q, args...) + if err != nil { + return nil, errors.WithMessagef(err, "select db") + } + + return result, nil +} + +func (r Application) GetApplicationByNameAndServiceId(ctx context.Context, name string, serviceId int) (*entity.Application, error) { + q := ` + SELECT id, name, description, service_id, type, created_at, updated_at + FROM application + WHERE name = $1 AND service_id = $2 +` + result := entity.Application{} + err := r.db.SelectRow(ctx, &result, q, name, serviceId) + if err != nil { + if err == sql.ErrNoRows { + return nil, nil + } + return nil, errors.WithMessagef(err, "select row db") + } + + return &result, nil +} + +func (r Application) CreateApplication(ctx context.Context, name string, desc string, serviceId int, appType string) ( + *entity.Application, error) { + q := ` + INSERT INTO application + (name, description, service_id, type) + VALUES ($1, $2, $3, $4) + RETURNING id, name, description, service_id, type, created_at, updated_at +` + result := entity.Application{} + err := r.db.SelectRow(ctx, &result, q, name, desc, serviceId, appType) + if err != nil { + return nil, errors.WithMessagef(err, "select row db") + } + + return &result, nil +} + +func (r Application) UpdateApplication(ctx context.Context, id int, name string, description string) (*entity.Application, error) { + q := ` + UPDATE application + SET name = $2, + description = $3 + WHERE id = $1 + RETURNING id, name, description, service_id, type, created_at, updated_at +` + result := entity.Application{} + err := r.db.SelectRow(ctx, &result, q, id, name, description) + if err != nil { + return nil, errors.WithMessagef(err, "select row db") + } + + return &result, nil +} + +func (r Application) DeleteApplicationByIdList(ctx context.Context, idList []int) (int, error) { + q, args, err := query.New(). + Delete("application"). + Where(squirrel.Eq{"id": idList}). + ToSql() + if err != nil { + return 0, errors.WithMessage(err, "build query") + } + + result, err := r.db.Exec(ctx, q, args...) + if err != nil { + return 0, errors.WithMessage(err, "exec db") + } + + rowsAffected, err := result.RowsAffected() + if err != nil { + return 0, errors.WithMessage(err, "get rows affected") + } + + return int(rowsAffected), nil +} From cc94ca71a4e7e8231174f78ef3de17f3766e5067 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:02:19 +0400 Subject: [PATCH 06/35] MSP-623 reimplement access_list repository --- model/access_list.go | 91 -------------------------- repository/access_list.go | 133 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+), 91 deletions(-) delete mode 100644 model/access_list.go create mode 100644 repository/access_list.go diff --git a/model/access_list.go b/model/access_list.go deleted file mode 100644 index c337aea..0000000 --- a/model/access_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package model - -import ( - "isp-system-service/entity" - - "github.com/go-pg/pg/v9" - "github.com/go-pg/pg/v9/orm" - "github.com/integration-system/isp-lib/v2/database" -) - -type AccessListRepository struct { - DB orm.DB - rxClient *database.RxDbClient -} - -func (r *AccessListRepository) GetByAppId(appId int32) ([]entity.AccessList, error) { - model := make([]entity.AccessList, 0) - if err := r.getDb().Model(&model).Where("app_id = ?", appId).Select(); err != nil { - if err == pg.ErrNoRows { - return nil, nil - } - - return nil, err - } - - return model, nil -} - -func (r *AccessListRepository) GetByAppIdList(list []int32) ([]entity.AccessList, error) { - model := make([]entity.AccessList, 0) - if err := r.getDb().Model(&model).Where("app_id IN (?)", pg.In(list)).Select(); err != nil { - if err == pg.ErrNoRows { - return nil, nil - } - - return nil, err - } - - return model, nil -} - -func (r *AccessListRepository) DeleteById(id int32) ([]entity.AccessList, error) { - model := make([]entity.AccessList, 0) - if _, err := r.getDb().Model(&model).Where("app_id = ?", id).Returning("*").Delete(); err != nil { - if err == pg.ErrNoRows { - return nil, nil - } - - return nil, err - } else { - return model, nil - } -} - -func (r *AccessListRepository) DeleteByIdList(list []int32) ([]entity.AccessList, error) { - model := make([]entity.AccessList, 0) - if _, err := r.getDb().Model(&model).Where("app_id IN (?)", pg.In(list)).Returning("*").Delete(); err != nil { - if err == pg.ErrNoRows { - return nil, nil - } - - return nil, err - } else { - return model, nil - } -} - -func (r *AccessListRepository) UpsertArray(model []entity.AccessList) (int, error) { - _, _ = r.getDb().Model(&model).WherePK().Delete() - if result, err := r.getDb().Model(&model).Insert(); err != nil { - return 0, err - } else { - return result.RowsAffected(), nil - } -} - -func (r *AccessListRepository) Upsert(model entity.AccessList) (int, error) { - if result, err := r.getDb().Model(&model).OnConflict("(app_id, method) DO UPDATE").Insert(); err != nil { - return 0, err - } else { - return result.RowsAffected(), nil - } -} - -func (r *AccessListRepository) getDb() orm.DB { - if r.DB != nil { - return r.DB - } - - return r.rxClient.Unsafe() -} diff --git a/repository/access_list.go b/repository/access_list.go new file mode 100644 index 0000000..3c475c8 --- /dev/null +++ b/repository/access_list.go @@ -0,0 +1,133 @@ +package repository + +import ( + "context" + + "github.com/Masterminds/squirrel" + "github.com/integration-system/isp-kit/db" + "github.com/integration-system/isp-kit/db/query" + "github.com/pkg/errors" + "isp-system-service/entity" +) + +type AccessList struct { + db db.DB +} + +func NewAccessList(db db.DB) AccessList { + return AccessList{ + db: db, + } +} + +func (r AccessList) GetAccessListByAppId(ctx context.Context, appId int) ([]entity.AccessList, error) { + q := ` + SELECT app_id, method, value + FROM access_list + WHERE app_id = $1 +` + result := make([]entity.AccessList, 0) + err := r.db.Select(ctx, &result, q, appId) + if err != nil { + return nil, errors.WithMessagef(err, "select db") + } + + return result, nil +} + +func (r AccessList) GetAccessListByAppIdList(ctx context.Context, appIdList []int) ([]entity.AccessList, error) { + q, args, err := query.New(). + Select("app_id", "method", "value"). + From("access_list"). + Where(squirrel.Eq{"app_id": appIdList}). + ToSql() + if err != nil { + return nil, errors.WithMessage(err, "build query") + } + + result := make([]entity.AccessList, 0) + err = r.db.Select(ctx, &result, q, args...) + if err != nil { + return nil, errors.WithMessagef(err, "select db") + } + + return result, nil +} + +func (r AccessList) InsertArrayAccessList(ctx context.Context, entity []entity.AccessList) error { + qBuilder := query.New(). + Insert("access_list"). + Columns("app_id", "method", "value") + for _, e := range entity { + qBuilder = qBuilder.Values(e.AppId, e.Method, e.Value) + } + q, args, err := qBuilder.ToSql() + if err != nil { + return errors.WithMessage(err, "build query") + } + + _, err = r.db.Exec(ctx, q, args...) + if err != nil { + return errors.WithMessage(err, "exec db") + } + + return nil +} + +func (r AccessList) UpsertAccessList(ctx context.Context, e entity.AccessList) (int, error) { + q := ` + INSERT INTO access_list + (app_id, method, value) + VALUES ($1, $2, $3) + ON CONFLICT (app_id, method) + DO UPDATE + SET (value) = (SELECT EXCLUDED.value) +` + result, err := r.db.Exec(ctx, q, e.AppId, e.Method, e.Value) + if err != nil { + return 0, errors.WithMessage(err, "exec db") + } + + rowsAffected, err := result.RowsAffected() + if err != nil { + return 0, errors.WithMessage(err, "get rows affected") + } + + return int(rowsAffected), nil +} + +func (r AccessList) DeleteAccessList(ctx context.Context, appId int, methods []string) error { + q, args, err := query.New(). + Delete("access_list"). + Where(squirrel.Eq{ + "app_id": appId, + "method": methods, + }). + Suffix("RETURNING app_id, method, value"). + ToSql() + if err != nil { + return errors.WithMessage(err, "build query") + } + + _, err = r.db.Exec(ctx, q, args...) + if err != nil { + return errors.WithMessagef(err, "exec db") + } + + return nil +} + +func (r AccessList) DeleteAccessListByAppId(ctx context.Context, appId int) ([]entity.AccessList, error) { + q := ` + DELETE FROM access_list + WHERE app_id = $1 + RETURNING app_id, method, value +` + result := make([]entity.AccessList, 0) + err := r.db.Select(ctx, &result, q, appId) + if err != nil { + return nil, errors.WithMessagef(err, "select db") + } + + return result, nil +} From 203c8020715220d46bbbff52d03c260f4383a1e1 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:03:06 +0400 Subject: [PATCH 07/35] MSP-623 reimplement domain repository --- model/domain.go | 83 ----------------------- repository/domain.go | 153 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+), 83 deletions(-) delete mode 100644 model/domain.go create mode 100644 repository/domain.go diff --git a/model/domain.go b/model/domain.go deleted file mode 100644 index 59ed603..0000000 --- a/model/domain.go +++ /dev/null @@ -1,83 +0,0 @@ -package model - -import ( - "isp-system-service/entity" - - "github.com/go-pg/pg/v9" - "github.com/go-pg/pg/v9/orm" - "github.com/integration-system/isp-lib/v2/database" -) - -var emptyDomain = (*entity.Domain)(nil) - -type DomainRepository struct { - DB orm.DB - rxClient *database.RxDbClient -} - -func (r *DomainRepository) GetDomains(list []int32) ([]entity.Domain, error) { - res := make([]entity.Domain, 0) - q := r.getDb().Model(&res) - if len(res) > 0 { - q = q.Where("id IN (?)", pg.In(list)) - } - err := q.Order("created_at DESC").Select() - - return res, err -} - -func (r *DomainRepository) GetDomainsBySystemId(systemId int32) ([]entity.Domain, error) { - res := make([]entity.Domain, 0) - err := r.getDb().Model(&res).Where("system_id = ?", systemId).Order("created_at DESC").Select() - - return res, err -} - -func (r *DomainRepository) CreateDomain(domain entity.Domain) (entity.Domain, error) { - _, err := r.getDb().Model(&domain).Insert() - - return domain, err -} - -func (r *DomainRepository) GetDomainByNameAndSystemId(name string, systemId int32) (*entity.Domain, error) { - domain := new(entity.Domain) - err := r.getDb().Model(domain).Where("name = ? AND system_id = ?", name, systemId).First() - if err == pg.ErrNoRows { - return nil, nil - } - - return domain, err -} - -func (r *DomainRepository) UpdateDomain(domain entity.Domain) (entity.Domain, error) { - _, err := r.getDb().Model(&domain).Column("name", "description").WherePK().Returning("*").Update() - - return domain, err -} - -func (r *DomainRepository) GetDomainById(id int32) (*entity.Domain, error) { - domain := &entity.Domain{Id: id} - err := r.getDb().Select(domain) - if err == pg.ErrNoRows { - return nil, nil - } - - return domain, err -} - -func (r *DomainRepository) DeleteDomains(list []int32) (int, error) { - res, err := r.getDb().Model(emptyDomain).Where("id IN (?)", pg.In(list)).Delete() - if err != nil { - return 0, err - } - - return res.RowsAffected(), nil -} - -func (r *DomainRepository) getDb() orm.DB { - if r.DB != nil { - return r.DB - } - - return r.rxClient.Unsafe() -} diff --git a/repository/domain.go b/repository/domain.go new file mode 100644 index 0000000..4d8f5d6 --- /dev/null +++ b/repository/domain.go @@ -0,0 +1,153 @@ +package repository + +import ( + "context" + "database/sql" + + "github.com/Masterminds/squirrel" + "github.com/integration-system/isp-kit/db" + "github.com/integration-system/isp-kit/db/query" + "github.com/pkg/errors" + "isp-system-service/domain" + "isp-system-service/entity" +) + +type Domain struct { + db db.DB +} + +func NewDomain(db db.DB) Domain { + return Domain{ + db: db, + } +} + +func (r Domain) GetDomainById(ctx context.Context, id int) (*entity.Domain, error) { + q := ` + SELECT id, name, description, system_id, created_at, updated_at + FROM domain + WHERE id = $1 +` + result := entity.Domain{} + err := r.db.SelectRow(ctx, &result, q, id) + if err != nil { + if err == sql.ErrNoRows { + return nil, domain.ErrDomainNotFound + } + return nil, errors.WithMessage(err, "select row db") + } + + return &result, nil +} + +func (r Domain) GetDomainByIdList(ctx context.Context, idList []int) ([]entity.Domain, error) { + q, args, err := query.New(). + Select("id", "name", "description", "system_id", "created_at", "updated_at"). + From("domain"). + Where(squirrel.Eq{"id": idList}). + ToSql() + if err != nil { + return nil, errors.WithMessage(err, "build query") + } + + result := make([]entity.Domain, 0) + err = r.db.Select(ctx, &result, q, args...) + if err != nil { + return nil, errors.WithMessage(err, "select db") + } + + return result, nil +} + +func (r Domain) GetDomainBySystemId(ctx context.Context, systemId int) ([]entity.Domain, error) { + q := ` + SELECT id, name, description, system_id, created_at, updated_at + FROM domain + WHERE system_id = $1 + ORDER BY created_at DESC +` + result := make([]entity.Domain, 0) + err := r.db.Select(ctx, &result, q, systemId) + if err != nil { + return nil, errors.WithMessage(err, "select db") + } + + return result, nil +} + +func (r Domain) GetDomainByNameAndSystemId(ctx context.Context, name string, systemId int) (*entity.Domain, error) { + q := ` + SELECT id, name, description, system_id, created_at, updated_at + FROM domain + WHERE name = $1 AND system_id = $2 +` + result := entity.Domain{} + err := r.db.SelectRow(ctx, &result, q, name, systemId) + if err != nil { + if err == sql.ErrNoRows { + return nil, domain.ErrDomainNotFound + } + return nil, errors.WithMessage(err, "select row db") + } + + return &result, nil +} + +func (r Domain) CreateDomain(ctx context.Context, name string, desc string, systemId int) (*entity.Domain, error) { + q := ` + INSERT INTO domain + (name, description, system_id) + VALUES ($1, $2, $3) + RETURNING id, name, description, system_id, created_at, updated_at +` + result := entity.Domain{} + err := r.db.SelectRow(ctx, &result, q, name, desc, systemId) + if err != nil { + if err == sql.ErrNoRows { + return nil, domain.ErrDomainNotFound + } + return nil, errors.WithMessage(err, "select row db") + } + + return &result, nil +} + +func (r Domain) UpdateDomain(ctx context.Context, id int, name string, description string) (*entity.Domain, error) { + q := ` + UPDATE domain + SET name = $1, description = $2 + WHERE id = $3 + RETURNING id, name, description, system_id, created_at, updated_at +` + result := entity.Domain{} + err := r.db.SelectRow(ctx, &result, q, name, description, id) + if err != nil { + if err == sql.ErrNoRows { + return nil, domain.ErrDomainNotFound + } + return nil, errors.WithMessage(err, "select row db") + } + return &result, nil +} + +func (r Domain) DeleteDomain(ctx context.Context, idList []int) (int, error) { + q, args, err := query.New(). + Delete("domain"). + Where(squirrel.Eq{"id": idList}). + ToSql() + if err != nil { + return 0, errors.WithMessagef(err, "build query") + } + + result, err := r.db.Exec(ctx, q, args...) + if err != nil { + return 0, errors.WithMessagef(err, "exec db") + } + + rowsAffected, err := result.RowsAffected() + if err != nil { + return 0, errors.WithMessagef(err, "get rows affected") + } + + return int(rowsAffected), nil +} From bb36c55746aea7bac99205e03a162653d215ea31 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:12:05 +0400 Subject: [PATCH 08/35] MSP-623 remove global db client --- model/client.go | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 model/client.go diff --git a/model/client.go b/model/client.go deleted file mode 100644 index 1999534..0000000 --- a/model/client.go +++ /dev/null @@ -1,25 +0,0 @@ -package model - -import ( - "isp-system-service/log_code" - - "github.com/integration-system/isp-lib/v2/database" - log "github.com/integration-system/isp-log" -) - -var ( - DbClient = database.NewRxDbClient( - database.WithSchemaEnsuring(), - database.WithSchemaAutoInjecting(), - database.WithMigrationsEnsuring(), - database.WithInitializingErrorHandler(func(err *database.ErrorEvent) { - log.Error(log_code.ErrorDatabaseClient, err) - })) - - AppRep = AppRepository{rxClient: DbClient} - DomainRep = DomainRepository{rxClient: DbClient} - ServiceRep = ServiceRepository{rxClient: DbClient} - SystemRep = SystemRepository{rxClient: DbClient} - TokenRep = TokenRepository{rxClient: DbClient} - AccessListRep = AccessListRepository{rxClient: DbClient} -) From 4b5412e21b11480a07fa24c18afb634790b494c8 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Mon, 25 Apr 2022 19:01:25 +0400 Subject: [PATCH 09/35] MSP-623 add migration to set value access_list to not null --- migrations/20220425182212_not_null_access_list.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 migrations/20220425182212_not_null_access_list.sql diff --git a/migrations/20220425182212_not_null_access_list.sql b/migrations/20220425182212_not_null_access_list.sql new file mode 100644 index 0000000..62b118f --- /dev/null +++ b/migrations/20220425182212_not_null_access_list.sql @@ -0,0 +1,7 @@ +-- +goose Up +UPDATE access_list SET value = false WHERE value is null; + +ALTER TABLE access_list + ALTER COLUMN value SET NOT NULL; + +-- +goose Down From 0934f8136f12abf763c05b076bad60c9d488e2a5 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:05:36 +0400 Subject: [PATCH 10/35] MSP-623 split entity --- entity/access_list.go | 7 +++++ entity/application.go | 15 ++++++++++ entity/domain.go | 14 +++++++++ entity/entity.go | 67 ------------------------------------------- entity/service.go | 14 +++++++++ entity/token.go | 12 ++++++++ 6 files changed, 62 insertions(+), 67 deletions(-) create mode 100644 entity/access_list.go create mode 100644 entity/application.go create mode 100644 entity/domain.go delete mode 100644 entity/entity.go create mode 100644 entity/service.go create mode 100644 entity/token.go diff --git a/entity/access_list.go b/entity/access_list.go new file mode 100644 index 0000000..c0fc80a --- /dev/null +++ b/entity/access_list.go @@ -0,0 +1,7 @@ +package entity + +type AccessList struct { + AppId int + Method string + Value bool +} diff --git a/entity/application.go b/entity/application.go new file mode 100644 index 0000000..4d38c74 --- /dev/null +++ b/entity/application.go @@ -0,0 +1,15 @@ +package entity + +import ( + "time" +) + +type Application struct { + Id int + Name string + Description *string + ServiceId int + Type string + CreatedAt time.Time + UpdatedAt time.Time +} diff --git a/entity/domain.go b/entity/domain.go new file mode 100644 index 0000000..08dc9e8 --- /dev/null +++ b/entity/domain.go @@ -0,0 +1,14 @@ +package entity + +import ( + "time" +) + +type Domain struct { + Id int + Name string + Description *string + SystemId int + CreatedAt time.Time + UpdatedAt time.Time +} diff --git a/entity/entity.go b/entity/entity.go deleted file mode 100644 index 53bb777..0000000 --- a/entity/entity.go +++ /dev/null @@ -1,67 +0,0 @@ -package entity - -import "time" - -const ( - RootAdminApplicationId = 1 -) - -const ( - AppTypeSystem = "SYSTEM" - AppTypeMobile = "MOBILE" -) - -type System struct { - tableName string `pg:"system_service.system" json:"-"` //nolint - Id int32 - Name string `valid:"required~Required"` - Description string - CreatedAt time.Time - UpdatedAt time.Time -} - -type Domain struct { - tableName string `pg:"system_service.domain" json:"-"` //nolint - Name string `valid:"required~Required"` - Id int32 - SystemId int32 - Description string - CreatedAt time.Time - UpdatedAt time.Time -} - -type Service struct { - tableName string `pg:"system_service.service" json:"-"` //nolint - Id int32 - DomainId int32 `valid:"required~Required"` - Name string `valid:"required~Required"` - Description string - CreatedAt time.Time - UpdatedAt time.Time -} - -type Application struct { - tableName string `pg:"system_service.application" json:"-"` //nolint - Name string `valid:"required~Required"` - Description string - Type string `valid:"required~Required,in(SYSTEM|MOBILE)"` - ServiceId int32 `valid:"required~Required"` - Id int32 - CreatedAt time.Time - UpdatedAt time.Time -} - -type Token struct { - tableName string `pg:"system_service.token" json:"-"` //nolint - Token string `valid:"required~Required" pg:"pk:token"` - AppId int32 `valid:"required~Required"` - ExpireTime int64 - CreatedAt time.Time -} - -type AccessList struct { - tableName string `pg:"system_service.access_list" json:"-"` //nolint - Method string `pg:",pk"` - AppId int32 `pg:",pk"` - Value bool -} diff --git a/entity/service.go b/entity/service.go new file mode 100644 index 0000000..9a791d9 --- /dev/null +++ b/entity/service.go @@ -0,0 +1,14 @@ +package entity + +import ( + "time" +) + +type Service struct { + Id int + Name string + Description *string + DomainId int + CreatedAt time.Time + UpdatedAt time.Time +} diff --git a/entity/token.go b/entity/token.go new file mode 100644 index 0000000..50a553f --- /dev/null +++ b/entity/token.go @@ -0,0 +1,12 @@ +package entity + +import ( + "time" +) + +type Token struct { + Token string + AppId int + ExpireTime int + CreatedAt time.Time +} From 1512fe33ce28dd5b32a5343574f9fbe5c5985a87 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:08:05 +0400 Subject: [PATCH 11/35] MSP-623 update jwt service --- service/jwt.go | 66 ++++++++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/service/jwt.go b/service/jwt.go index 325ec18..ad99482 100644 --- a/service/jwt.go +++ b/service/jwt.go @@ -3,46 +3,54 @@ package service import ( "crypto/rand" "encoding/hex" - mathRand "math/rand" "time" - "isp-system-service/conf" - "github.com/dgrijalva/jwt-go" - "github.com/integration-system/isp-lib/v2/config" + "github.com/pkg/errors" ) -var Jwt jwtService - -type jwtService struct{} - -func init() { - mathRand.Seed(time.Now().UnixNano()) +type Jwt struct { + secret string } -func (s jwtService) CreateApplication(appId int32, expTime int64) (string, error) { - var ( - claims = jwt.MapClaims{} - created = time.Now() - secret = config.GetRemote().(*conf.RemoteConfig).ApplicationSecret - ) +func NewJwt(secret string) Jwt { + return Jwt{ + secret: secret, + } +} - claims["appId"] = appId - claims["iat"] = created.Unix() - claims["salt"] = s.getSalt() - if expTime > 0 { - claims["exp"] = created.Add(time.Millisecond * time.Duration(expTime)).Unix() +func (s Jwt) CreateApplicationToken(appId int, expireTime int) (string, error) { + random, err := s.generateSalt() + if err != nil { + return "", errors.WithMessage(err, "generate salt") } - return jwt.NewWithClaims(jwt.SigningMethodHS512, claims).SignedString([]byte(secret)) + created := time.Now().UTC() + claims := jwt.MapClaims{ + "appId": appId, + "iat": created.Unix(), + "salt": random, + } + if expireTime > 0 { + claims["exp"] = created.Add(time.Millisecond * time.Duration(expireTime)).Unix() + } + + token, err := jwt.NewWithClaims(jwt.SigningMethodHS512, claims). + SignedString([]byte(s.secret)) + if err != nil { + return "", errors.WithMessage(err, "signed token") + } + + return token, nil } -func (jwtService) getSalt() string { - const randIntSize = 30 - const minLen = 10 - randomInt := mathRand.Intn(randIntSize) //nolint:gosec - salt := make([]byte, randomInt+minLen) - _, _ = rand.Read(salt) +func (Jwt) generateSalt() (string, error) { + cryptoRand := make([]byte, 16) //nolint:gomnd + _, err := rand.Read(cryptoRand) + if err != nil { + return "", errors.WithMessage(err, "crypto/rand read") + } + random := hex.EncodeToString(cryptoRand) - return hex.EncodeToString(salt) + return random, nil } From c0994fa5f142deac92e18f5f4713d0ae5b0685f8 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:08:30 +0400 Subject: [PATCH 12/35] MSP-623 implement service service --- service/service.go | 145 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 service/service.go diff --git a/service/service.go b/service/service.go new file mode 100644 index 0000000..1a7768e --- /dev/null +++ b/service/service.go @@ -0,0 +1,145 @@ +package service + +import ( + "context" + + "github.com/pkg/errors" + "isp-system-service/domain" + "isp-system-service/entity" +) + +type IServiceServiceRep interface { + GetServiceById(ctx context.Context, id int) (*entity.Service, error) + GetServiceByIdList(ctx context.Context, idList []int) ([]entity.Service, error) + GetServiceByDomainId(ctx context.Context, domainIdList []int) ([]entity.Service, error) + GetServiceByNameAndDomainId(ctx context.Context, name string, domainId int) (*entity.Service, error) + CreateService(ctx context.Context, name string, desc string, domainId int) (*entity.Service, error) + UpdateService(ctx context.Context, id int, name string, description string) (*entity.Service, error) + DeleteService(ctx context.Context, idList []int) (int, error) +} + +type IServiceDomainRep interface { + GetDomainById(ctx context.Context, id int) (*entity.Domain, error) +} + +type Service struct { + domainRep IServiceDomainRep + serviceRep IServiceServiceRep +} + +func NewService( + domainRep IServiceDomainRep, + serviceRep IServiceServiceRep, +) Service { + return Service{ + domainRep: domainRep, + serviceRep: serviceRep, + } +} + +func (s Service) GetById(ctx context.Context, id int) (*domain.Service, error) { + serviceEntity, err := s.serviceRep.GetServiceById(ctx, id) + if err != nil { + return nil, errors.WithMessagef(err, "get service by id") + } + + result := s.convertService(*serviceEntity) + return &result, nil +} + +func (s Service) GetByIdList(ctx context.Context, idList []int) ([]domain.Service, error) { + serviceEntity, err := s.serviceRep.GetServiceByIdList(ctx, idList) + if err != nil { + return nil, errors.WithMessage(err, "get system by id list") + } + + result := make([]domain.Service, len(serviceEntity)) + for i := range serviceEntity { + result[i] = s.convertService(serviceEntity[i]) + } + return result, nil +} + +func (s Service) GetByDomainId(ctx context.Context, domainId int) ([]domain.Service, error) { + serviceEntity, err := s.serviceRep.GetServiceByDomainId(ctx, []int{domainId}) + if err != nil { + return nil, errors.WithMessage(err, "get system by id list") + } + + result := make([]domain.Service, len(serviceEntity)) + for i := range serviceEntity { + result[i] = s.convertService(serviceEntity[i]) + } + return result, nil +} + +func (s Service) CreateUpdate(ctx context.Context, req domain.ServiceCreateUpdateRequest) (*domain.Service, error) { + existed, err := s.serviceRep.GetServiceByNameAndDomainId(ctx, req.Name, req.DomainId) + switch { + case errors.Is(err, domain.ErrServiceNotFound): + case err != nil: + return nil, errors.WithMessage(err, "get service by name and domain_id") + } + + _, err = s.domainRep.GetDomainById(ctx, req.DomainId) + if err != nil { + return nil, errors.WithMessage(err, "get domain by id") + } + + if req.Id == 0 { + if existed != nil { + return nil, domain.ErrDomainDuplicateName + } + + serviceEntity, err := s.serviceRep.CreateService(ctx, req.Name, req.Description, req.DomainId) + if err != nil { + return nil, errors.WithMessage(err, "create service") + } + + result := s.convertService(*serviceEntity) + return &result, nil + } + + if existed != nil && existed.Id != req.Id { + return nil, domain.ErrDomainDuplicateName + } + + _, err = s.serviceRep.GetServiceById(ctx, req.Id) + if err != nil { + return nil, errors.WithMessage(err, "get service by id") + } + + serviceEntity, err := s.serviceRep.UpdateService(ctx, req.Id, req.Name, req.Description) + if err != nil { + return nil, errors.WithMessage(err, "update service") + } + + result := s.convertService(*serviceEntity) + return &result, nil +} + +func (s Service) Delete(ctx context.Context, idList []int) (int, error) { + result, err := s.serviceRep.DeleteService(ctx, idList) + if err != nil { + return 0, errors.WithMessage(err, "delete service") + } + + return result, nil +} + +func (s Service) convertService(req entity.Service) domain.Service { + desc := "" + if req.Description != nil { + desc = *req.Description + } + result := domain.Service{ + Id: req.Id, + Name: req.Name, + Description: desc, + DomainId: req.DomainId, + CreatedAt: req.CreatedAt, + UpdatedAt: req.UpdatedAt, + } + + return result +} From 0e22b988b28f188131fb5bf5559d94328a7b7d90 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:08:42 +0400 Subject: [PATCH 13/35] MSP-623 implement token service --- service/token.go | 220 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 service/token.go diff --git a/service/token.go b/service/token.go new file mode 100644 index 0000000..ad1998b --- /dev/null +++ b/service/token.go @@ -0,0 +1,220 @@ +package service + +import ( + "context" + + "github.com/pkg/errors" + "isp-system-service/domain" + "isp-system-service/entity" +) + +type ITokenJwt interface { + CreateApplicationToken(appId int, expireTime int) (string, error) +} + +type ITokenAppEnrich interface { + EnrichWithTokens(ctx context.Context, apps []entity.Application) ([]*domain.ApplicationWithTokens, error) +} + +type ITokenApplicationRep interface { + GetApplicationById(ctx context.Context, id int) (*entity.Application, error) +} + +type ITokenServiceRep interface { + GetServiceById(ctx context.Context, id int) (*entity.Service, error) +} + +type ITokenDomainRep interface { + GetDomainById(ctx context.Context, id int) (*entity.Domain, error) +} + +type ITokenTokenRep interface { + GetTokenByAppIdList(ctx context.Context, appIdList []int) ([]entity.Token, error) +} + +type ITokenCreateTx interface { + SaveToken(ctx context.Context, token string, appId int, expireTime int) (*entity.Token, error) +} + +type ITokenRevokeTx interface { + DeleteToken(ctx context.Context, tokens []string) (int, error) +} + +type ITokenTxRunner interface { + TokenCreateTx(ctx context.Context, tx func(ctx context.Context, tx ITokenCreateTx) error) error + TokenRevokeTx(ctx context.Context, tx func(ctx context.Context, tx ITokenRevokeTx) error) error +} + +type ITokenRedis interface { + SetApplicationToken(ctx context.Context, req entity.RedisSetToken) error + DeleteToken(ctx context.Context, tokens []string) error +} + +type Token struct { + redisRep ITokenRedis + defaultExpireTime int + jwt ITokenJwt + appEnrich ITokenAppEnrich + tx ITokenTxRunner + appRep ITokenApplicationRep + domainRep ITokenDomainRep + serviceRep ITokenServiceRep + tokenRep ITokenTokenRep +} + +func NewToken( + redisRep ITokenRedis, + defaultExpireTime int, + jwtGenerate ITokenJwt, + appEnrich ITokenAppEnrich, + tx ITokenTxRunner, + appRep ITokenApplicationRep, + domainRep ITokenDomainRep, + serviceRep ITokenServiceRep, + tokenRep ITokenTokenRep, +) Token { + return Token{ + redisRep: redisRep, + defaultExpireTime: defaultExpireTime, + appEnrich: appEnrich, + jwt: jwtGenerate, + tx: tx, + appRep: appRep, + domainRep: domainRep, + serviceRep: serviceRep, + tokenRep: tokenRep, + } +} + +func (s Token) GetByAppId(ctx context.Context, appId int) ([]domain.Token, error) { + tokenEntity, err := s.tokenRep.GetTokenByAppIdList(ctx, []int{appId}) + if err != nil { + return nil, errors.WithMessage(err, "get token by app_id list") + } + + result := make([]domain.Token, len(tokenEntity)) + for i, token := range tokenEntity { + result[i] = domain.Token(token) + } + + return result, nil +} + +func (s Token) Create(ctx context.Context, req domain.TokenCreateRequest) (*domain.ApplicationWithTokens, error) { + applicationEntity, err := s.appRep.GetApplicationById(ctx, req.AppId) + if err != nil { + return nil, errors.WithMessagef(err, "get application by id") + } + + serviceEntity, err := s.serviceRep.GetServiceById(ctx, applicationEntity.ServiceId) + if err != nil { + return nil, errors.WithMessagef(err, "get service by id") + } + + domainEntity, err := s.domainRep.GetDomainById(ctx, serviceEntity.DomainId) + if err != nil { + return nil, errors.WithMessagef(err, "get domain by id") + } + + expTime := req.ExpireTimeMs + if expTime == 0 { + expTime = s.defaultExpireTime + } + + token, err := s.jwt.CreateApplicationToken(req.AppId, expTime) + if err != nil { + return nil, errors.WithMessagef(err, "jwt create application token") + } + + err = s.tx.TokenCreateTx(ctx, func(ctx context.Context, tx ITokenCreateTx) error { + tokenEntity, err := tx.SaveToken(ctx, token, req.AppId, expTime) + if err != nil { + return errors.WithMessagef(err, "tx save token") + } + + err = s.redisRep.SetApplicationToken(ctx, entity.RedisSetToken{ + Token: tokenEntity.Token, + ExpireTime: tokenEntity.ExpireTime, + DomainIdentity: domainEntity.Id, + ServiceIdentity: serviceEntity.Id, + ApplicationIdentity: applicationEntity.Id, + }) + if err != nil { + return errors.WithMessage(err, "redis set token") + } + + return nil + }) + if err != nil { + return nil, errors.WithMessage(err, "token create transaction") + } + + arr, err := s.appEnrich.EnrichWithTokens(ctx, []entity.Application{*applicationEntity}) + if err != nil { + return nil, errors.WithMessagef(err, "application enrich with tokens") + } + + return arr[0], nil +} + +func (s Token) Revoke(ctx context.Context, req domain.TokenRevokeRequest) (*domain.ApplicationWithTokens, error) { + app, err := s.appRep.GetApplicationById(ctx, req.AppId) + if err != nil { + return nil, errors.WithMessagef(err, "get application by id") + } + + _, err = s.revokeTokens(ctx, req.Tokens) + if err != nil { + return nil, errors.WithMessagef(err, "reboke tokens") + } + + res, err := s.appEnrich.EnrichWithTokens(ctx, []entity.Application{*app}) + if err != nil { + return nil, errors.WithMessagef(err, "application enrich") + } + + return res[0], nil +} + +func (s Token) RevokeByAppId(ctx context.Context, appId int) (*domain.DeleteResponse, error) { + tokens, err := s.tokenRep.GetTokenByAppIdList(ctx, []int{appId}) + if err != nil { + return nil, errors.WithMessage(err, "get token by app_id list") + } + + tokenIdList := make([]string, len(tokens)) + for i, t := range tokens { + tokenIdList[i] = t.Token + } + + return s.revokeTokens(ctx, tokenIdList) +} + +func (s Token) revokeTokens(ctx context.Context, tokens []string) (*domain.DeleteResponse, error) { + if len(tokens) == 0 { + return &domain.DeleteResponse{Deleted: 0}, nil + } + + var count int + err := s.tx.TokenRevokeTx(ctx, func(ctx context.Context, tx ITokenRevokeTx) error { + deleted, err := tx.DeleteToken(ctx, tokens) + if err != nil { + return errors.WithMessagef(err, "tx delete token") + } + + err = s.redisRep.DeleteToken(ctx, tokens) + if err != nil { + return errors.WithMessage(err, "redis delete token") + } + + count = deleted + return nil + }) + if err != nil { + return nil, errors.WithMessage(err, "token revoke transaction") + } + + return &domain.DeleteResponse{ + Deleted: count, + }, nil +} From 6a120d6caa6dffd28cd1f380b50825ce9b40489a Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:08:59 +0400 Subject: [PATCH 14/35] MSP-623 implement domain service --- service/domain.go | 119 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 service/domain.go diff --git a/service/domain.go b/service/domain.go new file mode 100644 index 0000000..52dce98 --- /dev/null +++ b/service/domain.go @@ -0,0 +1,119 @@ +package service + +import ( + "context" + + "github.com/pkg/errors" + "isp-system-service/domain" + "isp-system-service/entity" +) + +type IDomainDomainRep interface { + GetDomainById(ctx context.Context, id int) (*entity.Domain, error) + GetDomainBySystemId(ctx context.Context, systemId int) ([]entity.Domain, error) + GetDomainByNameAndSystemId(ctx context.Context, name string, systemId int) (*entity.Domain, error) + CreateDomain(ctx context.Context, name string, desc string, systemId int) (*entity.Domain, error) + UpdateDomain(ctx context.Context, id int, name string, description string) (*entity.Domain, error) + DeleteDomain(ctx context.Context, idList []int) (int, error) +} + +type Domain struct { + domainRep IDomainDomainRep +} + +func NewDomain( + domainRep IDomainDomainRep, +) Domain { + return Domain{ + domainRep: domainRep, + } +} + +func (s Domain) GetById(ctx context.Context, id int) (*domain.Domain, error) { + domainEntity, err := s.domainRep.GetDomainById(ctx, id) + if err != nil { + return nil, errors.WithMessage(err, "get domain by id") + } + + result := s.convertDomain(*domainEntity) + return &result, nil +} + +func (s Domain) GetBySystemId(ctx context.Context, systemId int) ([]domain.Domain, error) { + domainEntity, err := s.domainRep.GetDomainBySystemId(ctx, systemId) + if err != nil { + return nil, errors.WithMessage(err, "get domain by system_id") + } + + result := make([]domain.Domain, len(domainEntity)) + for i := range domainEntity { + result[i] = s.convertDomain(domainEntity[i]) + } + return result, nil +} + +func (s Domain) CreateUpdate(ctx context.Context, req domain.DomainCreateUpdateRequest, systemId int) (*domain.Domain, error) { + existed, err := s.domainRep.GetDomainByNameAndSystemId(ctx, req.Name, systemId) + switch { + case errors.Is(err, domain.ErrDomainNotFound): + case err != nil: + return nil, errors.WithMessage(err, "get domain by name and system_id") + } + + if req.Id == 0 { + if existed != nil { + return nil, domain.ErrDomainDuplicateName + } + + domainEntity, err := s.domainRep.CreateDomain(ctx, req.Name, req.Description, systemId) + if err != nil { + return nil, errors.WithMessagef(err, "create domain") + } + + result := s.convertDomain(*domainEntity) + return &result, nil + } + + if existed != nil && existed.Id != req.Id { + return nil, domain.ErrDomainDuplicateName + } + + _, err = s.domainRep.GetDomainById(ctx, req.Id) + if err != nil { + return nil, errors.WithMessage(err, "get domain by id") + } + + domainEntity, err := s.domainRep.UpdateDomain(ctx, req.Id, req.Name, req.Description) + if err != nil { + return nil, errors.WithMessage(err, "update domain") + } + + result := s.convertDomain(*domainEntity) + return &result, nil +} + +func (s Domain) Delete(ctx context.Context, idList []int) (int, error) { + result, err := s.domainRep.DeleteDomain(ctx, idList) + if err != nil { + return 0, errors.WithMessage(err, "delete domain") + } + + return result, nil +} + +func (s Domain) convertDomain(req entity.Domain) domain.Domain { + desc := "" + if req.Description != nil { + desc = *req.Description + } + result := domain.Domain{ + Id: req.Id, + Name: req.Name, + Description: desc, + SystemId: req.SystemId, + CreatedAt: req.CreatedAt, + UpdatedAt: req.UpdatedAt, + } + + return result +} From 27d727823f77c143758a08ded96fa1812ff87bab Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:09:08 +0400 Subject: [PATCH 15/35] MSP-623 implement application service --- service/application.go | 329 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 329 insertions(+) create mode 100644 service/application.go diff --git a/service/application.go b/service/application.go new file mode 100644 index 0000000..3000180 --- /dev/null +++ b/service/application.go @@ -0,0 +1,329 @@ +package service + +import ( + "context" + "fmt" + + "github.com/pkg/errors" + "isp-system-service/domain" + "isp-system-service/entity" +) + +type IApplicationApplicationRep interface { + GetApplicationById(ctx context.Context, id int) (*entity.Application, error) + GetApplicationByIdList(ctx context.Context, idList []int) ([]entity.Application, error) + GetApplicationByServiceIdList(ctx context.Context, serviceIdList []int) ([]entity.Application, error) + GetApplicationByNameAndServiceId(ctx context.Context, name string, serviceId int) (*entity.Application, error) + CreateApplication(ctx context.Context, name string, desc string, serviceId int, appType string) (*entity.Application, error) + UpdateApplication(ctx context.Context, id int, name string, description string) (*entity.Application, error) +} + +type IApplicationTokenRep interface { + GetTokenByAppIdList(ctx context.Context, appIdList []int) ([]entity.Token, error) +} + +type IApplicationServiceRep interface { + GetServiceById(ctx context.Context, id int) (*entity.Service, error) + GetServiceByDomainId(ctx context.Context, domainIdList []int) ([]entity.Service, error) +} + +type IApplicationDomainRep interface { + GetDomainBySystemId(ctx context.Context, systemId int) ([]entity.Domain, error) +} + +type IApplicationDeleteTx interface { + GetAccessListByAppIdList(ctx context.Context, appIdList []int) ([]entity.AccessList, error) + GetTokenByAppIdList(ctx context.Context, appIdList []int) ([]entity.Token, error) + DeleteApplicationByIdList(ctx context.Context, idList []int) (int, error) +} + +type IApplicationTxRunner interface { + ApplicationDeleteTx(ctx context.Context, tx func(ctx context.Context, tx IApplicationDeleteTx) error) error +} + +type IApplicationRedis interface { + DeleteApplication(ctx context.Context, appTokens []string, applicationPermissionList []string) error +} + +type Application struct { + redis IApplicationRedis + tx IApplicationTxRunner + applicationRep IApplicationApplicationRep + domainRep IApplicationDomainRep + serviceRep IApplicationServiceRep + tokenRep IApplicationTokenRep +} + +func NewApplication( + redis IApplicationRedis, + tx IApplicationTxRunner, + applicationRep IApplicationApplicationRep, + domainRep IApplicationDomainRep, + serviceRep IApplicationServiceRep, + tokenRep IApplicationTokenRep, +) Application { + return Application{ + redis: redis, + tx: tx, + applicationRep: applicationRep, + domainRep: domainRep, + serviceRep: serviceRep, + tokenRep: tokenRep, + } +} + +func (s Application) GetById(ctx context.Context, appId int) (*domain.ApplicationWithTokens, error) { + application, err := s.applicationRep.GetApplicationById(ctx, appId) + if err != nil { + return nil, errors.WithMessage(err, "get application by id") + } + + arr, err := s.EnrichWithTokens(ctx, []entity.Application{*application}) + if err != nil { + return nil, errors.WithMessage(err, "enrich application with tokens") + } + + return arr[0], nil +} + +func (s Application) GetByIdList(ctx context.Context, idList []int) ([]*domain.ApplicationWithTokens, error) { + res, err := s.applicationRep.GetApplicationByIdList(ctx, idList) + if err != nil { + return nil, errors.WithMessage(err, "get application by id list") + } + + return s.EnrichWithTokens(ctx, res) +} + +func (s Application) GetByServiceId(ctx context.Context, id int) ([]*domain.ApplicationWithTokens, error) { + arr, err := s.applicationRep.GetApplicationByServiceIdList(ctx, []int{id}) + if err != nil { + return nil, errors.WithMessage(err, "get application by service_id") + } + + return s.EnrichWithTokens(ctx, arr) +} + +func (s Application) SystemTree(ctx context.Context, systemId int) ([]*domain.DomainWithService, error) { + domainEntityList, err := s.domainRep.GetDomainBySystemId(ctx, systemId) + if err != nil { + return nil, errors.WithMessage(err, "get domains by system_id") + } + if len(domainEntityList) == 0 { + return []*domain.DomainWithService{}, nil + } + + result := make([]*domain.DomainWithService, len(domainEntityList)) + resultByDomainId := make(map[int]*domain.DomainWithService, len(domainEntityList)) + domainIdList := make([]int, len(domainEntityList)) + for i, domainEntity := range domainEntityList { + domainIdList[i] = domainEntity.Id + description := "" + if domainEntity.Description != nil { + description = *domainEntity.Description + } + r := &domain.DomainWithService{ + Id: domainEntity.Id, + Name: domainEntity.Name, + Description: description, + Services: make([]*domain.ServiceWithApps, 0), + } + resultByDomainId[domainEntity.Id] = r + result[i] = r + } + + serviceEntityList, err := s.serviceRep.GetServiceByDomainId(ctx, domainIdList) + if err != nil { + return nil, errors.WithMessage(err, "get service by domain_id") + } + + serviceIdList := make([]int, len(serviceEntityList)) + resultServiceByServiceId := make(map[int]*domain.ServiceWithApps, len(serviceEntityList)) + for i, serviceEntity := range serviceEntityList { + serviceIdList[i] = serviceEntity.Id + description := "" + if serviceEntity.Description != nil { + description = *serviceEntity.Description + } + resultService := &domain.ServiceWithApps{ + Id: serviceEntity.Id, + Name: serviceEntity.Name, + Description: description, + Apps: make([]*domain.ApplicationSimple, 0), + } + r := resultByDomainId[serviceEntity.DomainId] + r.Services = append(r.Services, resultService) + resultServiceByServiceId[serviceEntity.Id] = resultService + } + + applicationEntityList, err := s.applicationRep.GetApplicationByServiceIdList(ctx, serviceIdList) + if err != nil { + return nil, errors.WithMessagef(err, "get application by service_id") + } + + for _, applicationEntity := range applicationEntityList { + resultService := resultServiceByServiceId[applicationEntity.ServiceId] + description := "" + if applicationEntity.Description != nil { + description = *applicationEntity.Description + } + resultService.Apps = append(resultService.Apps, &domain.ApplicationSimple{ + Id: applicationEntity.Id, + Name: applicationEntity.Name, + Type: applicationEntity.Type, + Description: description, + Tokens: make([]domain.Token, 0), + }) + } + + return result, nil +} + +func (s Application) CreateUpdate(ctx context.Context, req domain.ApplicationCreateUpdateRequest) (*domain.ApplicationWithTokens, error) { + existed, err := s.applicationRep.GetApplicationByNameAndServiceId(ctx, req.Name, req.ServiceId) + switch { + case errors.Is(err, domain.ErrApplicationNotFound): + case err != nil: + return nil, errors.WithMessage(err, "get application by name and service_id") + } + + _, err = s.serviceRep.GetServiceById(ctx, req.ServiceId) + if err != nil { + return nil, errors.WithMessage(err, "get service by id") + } + + if req.Id == 0 { + if existed != nil { + return nil, domain.ErrApplicationDuplicateName + } + + _, err = s.applicationRep.GetApplicationByNameAndServiceId(ctx, req.Name, req.ServiceId) + if err != nil { + return nil, errors.WithMessage(err, "get application by name and service_id") + } + + app, err := s.applicationRep.CreateApplication(ctx, req.Name, req.Description, req.ServiceId, req.Type) + if err != nil { + return nil, errors.WithMessage(err, "create application") + } + + result, err := s.EnrichWithTokens(ctx, []entity.Application{*app}) + if err != nil { + return nil, errors.WithMessage(err, "enrich application with tokens") + } + + return result[0], nil + } + + if existed.Id != req.Id { + return nil, domain.ErrApplicationDuplicateName + } + + _, err = s.applicationRep.GetApplicationById(ctx, req.Id) + if err != nil { + return nil, errors.WithMessage(err, "get application by id") + } + + app, err := s.applicationRep.UpdateApplication(ctx, req.Id, req.Name, req.Description) + if err != nil { + return nil, errors.WithMessage(err, "update application") + } + + result, err := s.EnrichWithTokens(ctx, []entity.Application{*app}) + if err != nil { + return nil, errors.WithMessage(err, "enrich application with tokens") + } + + return result[0], nil +} + +func (s Application) Delete(ctx context.Context, idList []int) (int, error) { + count := 0 + err := s.tx.ApplicationDeleteTx(ctx, func(ctx context.Context, tx IApplicationDeleteTx) error { + accessList, err := tx.GetAccessListByAppIdList(ctx, idList) + if err != nil { + return errors.WithMessage(err, "get access list by app_id list") + } + + permissionDeleteList := make([]string, 0) + for _, access := range accessList { + permissionDeleteList = append(permissionDeleteList, fmt.Sprintf("%d|%s", access.AppId, access.Method)) + } + + tokens, err := tx.GetTokenByAppIdList(ctx, idList) + if err != nil { + return errors.WithMessage(err, "get token by app_id list") + } + + tokenIdList := make([]string, len(tokens)) + for i, t := range tokens { + tokenIdList[i] = t.Token + } + + deletedApp, err := tx.DeleteApplicationByIdList(ctx, idList) + if err != nil { + return errors.WithMessage(err, "delete application by id list") + } + + err = s.redis.DeleteApplication(ctx, tokenIdList, permissionDeleteList) + if err != nil { + return errors.WithMessage(err, "redis delete application") + } + + count = deletedApp + return nil + }) + if err != nil { + return 0, errors.WithMessage(err, "transaction application delete") + } + + return count, nil +} + +func (s Application) EnrichWithTokens(ctx context.Context, apps []entity.Application) ([]*domain.ApplicationWithTokens, error) { + if len(apps) == 0 { + return []*domain.ApplicationWithTokens{}, nil + } + + appIdList := make([]int, len(apps)) + resultByAppId := make(map[int]*domain.ApplicationWithTokens, len(apps)) + result := make([]*domain.ApplicationWithTokens, len(apps)) + for i, a := range apps { + appIdList[i] = a.Id + awt := &domain.ApplicationWithTokens{ + App: s.convertApplication(a), + Tokens: make([]domain.Token, 0), + } + resultByAppId[a.Id] = awt + result[i] = awt + } + + tokens, err := s.tokenRep.GetTokenByAppIdList(ctx, appIdList) + if err != nil { + return nil, errors.WithMessage(err, "get token by app_id list") + } + + for _, token := range tokens { + r := resultByAppId[token.AppId] + r.Tokens = append(r.Tokens, domain.Token(token)) + } + + return result, nil +} + +func (s Application) convertApplication(req entity.Application) domain.Application { + desc := "" + if req.Description != nil { + desc = *req.Description + } + + return domain.Application{ + Id: req.Id, + Name: req.Name, + Description: desc, + ServiceId: req.ServiceId, + Type: req.Type, + CreatedAt: req.CreatedAt, + UpdatedAt: req.UpdatedAt, + } +} From 1ba15f4532972dd8cf30502d82c863913e7d7c3d Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:09:18 +0400 Subject: [PATCH 16/35] MSP-623 implement access_list service --- service/access_list.go | 191 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 service/access_list.go diff --git a/service/access_list.go b/service/access_list.go new file mode 100644 index 0000000..a7d13c3 --- /dev/null +++ b/service/access_list.go @@ -0,0 +1,191 @@ +package service + +import ( + "context" + "fmt" + + "github.com/pkg/errors" + "isp-system-service/domain" + "isp-system-service/entity" +) + +type IAccessListAccessListRep interface { + GetAccessListByAppId(ctx context.Context, appId int) ([]entity.AccessList, error) +} + +type IAccessListApplicationRep interface { + GetApplicationById(ctx context.Context, id int) (*entity.Application, error) +} + +type IAccessListSetOneTx interface { + UpsertAccessList(ctx context.Context, e entity.AccessList) (int, error) +} + +type IAccessListSetListTx interface { + GetAccessListByAppId(ctx context.Context, appId int) ([]entity.AccessList, error) + InsertArrayAccessList(ctx context.Context, entity []entity.AccessList) error + DeleteAccessList(ctx context.Context, appId int, methods []string) error + DeleteAccessListByAppId(ctx context.Context, appId int) ([]entity.AccessList, error) +} + +type IAccessListTxRunner interface { + AccessListSetOneTx(ctx context.Context, tx func(ctx context.Context, tx IAccessListSetOneTx) error) error + AccessListSetListTx(ctx context.Context, tx func(ctx context.Context, tx IAccessListSetListTx) error) error +} + +type IAccessListRedis interface { + UpdateApplicationPermission(ctx context.Context, req entity.RedisApplicationPermission) error + UpdateApplicationPermissionList(ctx context.Context, removed []string, added []interface{}) error +} + +type AccessList struct { + redis IAccessListRedis + tx IAccessListTxRunner + accessListRep IAccessListAccessListRep + applicationRep IAccessListApplicationRep +} + +func NewAccessList( + redis IAccessListRedis, + tx IAccessListTxRunner, + accessListRep IAccessListAccessListRep, + applicationRep IAccessListApplicationRep, +) AccessList { + return AccessList{ + redis: redis, + tx: tx, + accessListRep: accessListRep, + applicationRep: applicationRep, + } +} + +func (s AccessList) GetById(ctx context.Context, appId int) ([]domain.MethodInfo, error) { + _, err := s.applicationRep.GetApplicationById(ctx, appId) + if err != nil { + return nil, errors.WithMessage(err, "get application by id") + } + + accessList, err := s.accessListRep.GetAccessListByAppId(ctx, appId) + if err != nil { + return nil, errors.WithMessagef(err, "get access list by app_id") + } + + methodInfos := make([]domain.MethodInfo, len(accessList)) + for i, access := range accessList { + methodInfos[i] = domain.MethodInfo{ + Method: access.Method, + Value: access.Value, + } + } + + return methodInfos, nil +} + +func (s AccessList) SetOne(ctx context.Context, request domain.AccessListSetOneRequest) (*domain.AccessListSetOneResponse, error) { + _, err := s.applicationRep.GetApplicationById(ctx, request.AppId) + if err != nil { + return nil, errors.WithMessage(err, "get application by id") + } + + var resp int + err = s.tx.AccessListSetOneTx(ctx, func(ctx context.Context, tx IAccessListSetOneTx) error { + resp, err = tx.UpsertAccessList(ctx, entity.AccessList{ + AppId: request.AppId, + Method: request.Method, + Value: request.Value, + }) + if err != nil { + return errors.WithMessagef(err, "upsert access list") + } + + err = s.redis.UpdateApplicationPermission(ctx, entity.RedisApplicationPermission{ + AppId: request.AppId, + Method: request.Method, + Value: request.Value, + }) + if err != nil { + return errors.WithMessagef(err, "redis update application permission") + } + + return nil + }) + if err != nil { + return nil, errors.WithMessage(err, "transaction access list set one") + } + + return &domain.AccessListSetOneResponse{ + Count: resp, + }, nil +} + +func (s AccessList) SetList(ctx context.Context, req domain.AccessListSetListRequest) ([]domain.MethodInfo, error) { + _, err := s.applicationRep.GetApplicationById(ctx, req.AppId) + if err != nil { + return nil, errors.WithMessage(err, "get application by id") + } + + err = s.tx.AccessListSetListTx(ctx, func(ctx context.Context, tx IAccessListSetListTx) error { + oldAccessList := make([]entity.AccessList, 0) + if req.RemoveOld { + oldAccessList, err = tx.DeleteAccessListByAppId(ctx, req.AppId) + if err != nil { + return errors.WithMessage(err, "delete access list by app_id") + } + } + + newAccessList := make([]entity.AccessList, len(req.Methods)) + updateMethods := make([]string, len(req.Methods)) + redisMsetRequest := make([]interface{}, 0) + for i, m := range req.Methods { + updateMethods[i] = m.Method + newAccessList[i] = entity.AccessList{ + AppId: req.AppId, + Method: m.Method, + Value: m.Value, + } + redisMsetRequest = append(redisMsetRequest, fmt.Sprintf("%d|%s", req.AppId, m.Method), m.Value) + } + + redisDelRequest := make([]string, len(oldAccessList)) + for i, access := range oldAccessList { + redisDelRequest[i] = fmt.Sprintf("%d|%s", req.AppId, access.Method) + } + + if len(newAccessList) > 0 { + err = tx.DeleteAccessList(ctx, req.AppId, updateMethods) + if err != nil { + return errors.WithMessage(err, "delete access_list") + } + + err = tx.InsertArrayAccessList(ctx, newAccessList) + if err != nil { + return errors.WithMessage(err, "insert access_list") + } + } + + err = s.redis.UpdateApplicationPermissionList(ctx, redisDelRequest, redisMsetRequest) + if err != nil { + return errors.WithMessage(err, "redis update application permission list") + } + + return nil + }) + if err != nil { + return nil, errors.WithMessage(err, "transaction access list set list") + } + + accessList, err := s.accessListRep.GetAccessListByAppId(ctx, req.AppId) + if err != nil { + return nil, errors.WithMessagef(err, "get access list by app_id") + } + + methodInfos := make([]domain.MethodInfo, len(accessList)) + for i, access := range accessList { + methodInfos[i] = domain.MethodInfo{ + Method: access.Method, + Value: access.Value, + } + } + + return methodInfos, nil +} From 3d9c516cfb0e398c486e77d6c85f9adbfebeba2e Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:11:11 +0400 Subject: [PATCH 17/35] MSP-623 implement transaction manager --- transaction/manager.go | 90 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 transaction/manager.go diff --git a/transaction/manager.go b/transaction/manager.go new file mode 100644 index 0000000..2af2685 --- /dev/null +++ b/transaction/manager.go @@ -0,0 +1,90 @@ +package transaction + +import ( + "context" + + "github.com/integration-system/isp-kit/db" + "isp-system-service/repository" + "isp-system-service/service" +) + +type Manager struct { + db db.Transactional +} + +func NewManager(db db.Transactional) *Manager { + return &Manager{ + db: db, + } +} + +type accessListSetOneTx struct { + repository.AccessList +} + +func (m Manager) AccessListSetOneTx(ctx context.Context, msgTx func(ctx context.Context, tx service.IAccessListSetOneTx) error) error { + return m.db.RunInTransaction(ctx, func(ctx context.Context, tx *db.Tx) error { + accessListRepository := repository.NewAccessList(tx) + return msgTx(ctx, accessListSetOneTx{ + AccessList: accessListRepository, + }) + }) +} + +type accessListSetListTx struct { + repository.AccessList +} + +func (m Manager) AccessListSetListTx(ctx context.Context, msgTx func(ctx context.Context, tx service.IAccessListSetListTx) error) error { + return m.db.RunInTransaction(ctx, func(ctx context.Context, tx *db.Tx) error { + accessListRep := repository.NewAccessList(tx) + return msgTx(ctx, accessListSetListTx{ + AccessList: accessListRep, + }) + }) +} + +type applicationDeleteTx struct { + repository.AccessList + repository.Application + repository.Token +} + +func (m Manager) ApplicationDeleteTx(ctx context.Context, msgTx func(ctx context.Context, tx service.IApplicationDeleteTx) error) error { + return m.db.RunInTransaction(ctx, func(ctx context.Context, tx *db.Tx) error { + accessListRep := repository.NewAccessList(tx) + applicationRep := repository.NewApplication(tx) + tokenRep := repository.NewToken(tx) + return msgTx(ctx, applicationDeleteTx{ + AccessList: accessListRep, + Application: applicationRep, + Token: tokenRep, + }) + }) +} + +type tokenCreateTx struct { + repository.Token +} + +func (m Manager) TokenCreateTx(ctx context.Context, msgTx func(ctx context.Context, tx service.ITokenCreateTx) error) error { + return m.db.RunInTransaction(ctx, func(ctx context.Context, tx *db.Tx) error { + tokenRep := repository.NewToken(tx) + return msgTx(ctx, tokenCreateTx{ + Token: tokenRep, + }) + }) +} + +type tokenRevokeTx struct { + repository.Token +} + +func (m Manager) TokenRevokeTx(ctx context.Context, msgTx func(ctx context.Context, tx service.ITokenRevokeTx) error) error { + return m.db.RunInTransaction(ctx, func(ctx context.Context, tx *db.Tx) error { + tokenRep := repository.NewToken(tx) + return msgTx(ctx, tokenRevokeTx{ + Token: tokenRep, + }) + }) +} From 97fcc21fc61b1316e9aa82e4da39e0d7073b1031 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:13:11 +0400 Subject: [PATCH 18/35] MSP-623 reimplement redis cli --- entity/redis.go | 15 +++++ redis/client.go | 34 ---------- redis/redis.go | 164 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 179 insertions(+), 34 deletions(-) create mode 100644 entity/redis.go delete mode 100644 redis/client.go create mode 100644 redis/redis.go diff --git a/entity/redis.go b/entity/redis.go new file mode 100644 index 0000000..c03a5d1 --- /dev/null +++ b/entity/redis.go @@ -0,0 +1,15 @@ +package entity + +type RedisSetToken struct { + Token string + ExpireTime int + DomainIdentity int + ServiceIdentity int + ApplicationIdentity int +} + +type RedisApplicationPermission struct { + AppId int + Method string + Value bool +} diff --git a/redis/client.go b/redis/client.go deleted file mode 100644 index 8475aa3..0000000 --- a/redis/client.go +++ /dev/null @@ -1,34 +0,0 @@ -package redis - -import ( - "isp-system-service/log_code" - - rd "github.com/integration-system/isp-lib/v2/redis" - "github.com/integration-system/isp-lib/v2/structure" - log "github.com/integration-system/isp-log" -) - -var Client = &redisClient{ - cli: rd.NewRxClient( - rd.WithInitHandler(func(c *rd.Client, err error) { - if err != nil { - log.Fatal(log_code.ErrorRedisClient, err) - } - })), -} - -type redisClient struct { - cli *rd.RxClient -} - -func (c *redisClient) ReceiveConfiguration(configuration structure.RedisConfiguration) { - c.cli.ReceiveConfiguration(configuration) -} - -func (c *redisClient) Get() *rd.RxClient { - return c.cli -} - -func (c *redisClient) Close() { - _ = c.cli.Close() -} diff --git a/redis/redis.go b/redis/redis.go new file mode 100644 index 0000000..2b797ff --- /dev/null +++ b/redis/redis.go @@ -0,0 +1,164 @@ +package redis + +import ( + "context" + "fmt" + "time" + + rd "github.com/go-redis/redis/v8" + "github.com/integration-system/isp-lib/v2/redis" + "github.com/pkg/errors" + "isp-system-service/domain" + "isp-system-service/entity" +) + +const ( + systemIdentityFieldInDb = "1" + domainIdentityFieldInDb = "2" + serviceIdentityFieldInDb = "3" + applicationIdentityFieldInDb = "4" +) + +type Client struct { + instanceUuid string + cli *redis.RxClient +} + +func NewClient(instanceUuid string, cli *redis.RxClient) Client { + return Client{ + cli: cli, + instanceUuid: instanceUuid, + } +} + +func (r Client) SetApplicationToken(ctx context.Context, req entity.RedisSetToken) error { + _, err := r.cli.UseDbTx(redis.ApplicationTokenDb, func(pipeline rd.Pipeliner) error { + idMap := map[string]interface{}{ + systemIdentityFieldInDb: domain.DefaultSystemId, + domainIdentityFieldInDb: req.DomainIdentity, + serviceIdentityFieldInDb: req.ServiceIdentity, + applicationIdentityFieldInDb: req.ApplicationIdentity, + } + + key := fmt.Sprintf("%s|%s", req.Token, r.instanceUuid) + stat := pipeline.HMSet(ctx, key, idMap) + err := stat.Err() + if err != nil { + return errors.WithMessagef(err, "pipeline hmset") + } + + if req.ExpireTime > 0 { + err = pipeline.Expire(ctx, req.Token, time.Duration(req.ExpireTime)*time.Millisecond).Err() + if err != nil { + return errors.WithMessage(err, "pipeline expire token") + } + } + + return nil + }) + if err != nil { + return errors.WithMessage(err, "application_token transaction") + } + + return nil +} + +func (r Client) UpdateApplicationPermission(ctx context.Context, req entity.RedisApplicationPermission) error { + _, err := r.cli.UseDb(redis.ApplicationPermissionDb, func(pipeline rd.Pipeliner) error { + key := fmt.Sprintf("%d|%s", req.AppId, req.Method) + _, err := pipeline.Set(ctx, key, req.Value, 0).Result() + if err != nil { + return errors.WithMessage(err, "pipeline set") + } + + return nil + }) + if err != nil { + return errors.WithMessage(err, "application_permission transaction") + } + + return nil +} + +func (r Client) UpdateApplicationPermissionList(ctx context.Context, removed []string, added []interface{}) error { + _, err := r.cli.UseDb(redis.ApplicationPermissionDb, func(pipeline rd.Pipeliner) error { + if len(removed) > 0 { + _, err := pipeline.Del(ctx, removed...).Result() + if err != nil { + return errors.WithMessage(err, "pipeline del") + } + } + + if len(added) > 0 { + _, err := pipeline.MSet(ctx, added...).Result() + if err != nil { + return errors.WithMessage(err, "pipeline mset") + } + } + + return nil + }) + if err != nil { + return errors.WithMessage(err, "application_permission transaction") + } + + return nil +} + +func (r Client) DeleteApplication(ctx context.Context, appTokens []string, applicationPermissionList []string) error { + keys := make([]string, len(appTokens)) + for i, token := range appTokens { + keys[i] = fmt.Sprintf("%s|%s", token, r.instanceUuid) + } + + _, err := r.cli.UseDbTx(redis.ApplicationTokenDb, func(pipeline rd.Pipeliner) error { + if len(appTokens) > 0 { + _, err := pipeline.Del(ctx, keys...).Result() + if err != nil { + return errors.WithMessage(err, "pipeline del") + } + } + + if len(applicationPermissionList) > 0 { + _, err := r.cli.UseDb(redis.ApplicationPermissionDb, func(pipeliner rd.Pipeliner) error { + _, err := pipeliner.Del(ctx, applicationPermissionList...).Result() + if err != nil { + return errors.WithMessage(err, "pipeline del") + } + + return nil + }) + if err != nil { + return errors.WithMessage(err, "application_permission transaction") + } + } + + return nil + }) + if err != nil { + return errors.WithMessage(err, "application_token transaction") + } + + return nil +} + +func (r Client) DeleteToken(ctx context.Context, tokens []string) error { + keys := make([]string, len(tokens)) + for i, token := range tokens { + keys[i] = fmt.Sprintf("%s|%s", token, r.instanceUuid) + } + + _, err := r.cli.UseDbTx(redis.ApplicationTokenDb, func(p rd.Pipeliner) error { + _, err := p.Del(ctx, keys...).Result() + if err != nil { + return errors.WithMessage(err, "del keys") + } + + return nil + }) + if err != nil { + return errors.WithMessage(err, "application_token transaction") + } + + return nil +} From e0fc90e4d4f2e48bb4132b3d59f7bfa02f4fbcf9 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:14:39 +0400 Subject: [PATCH 19/35] MSP-623 remove system controller --- controller/system.go | 133 ------------------------------------------- 1 file changed, 133 deletions(-) delete mode 100644 controller/system.go diff --git a/controller/system.go b/controller/system.go deleted file mode 100644 index 6ea41e5..0000000 --- a/controller/system.go +++ /dev/null @@ -1,133 +0,0 @@ -package controller - -import ( - "fmt" - - "isp-system-service/domain" - "isp-system-service/entity" - "isp-system-service/model" - - _ "github.com/integration-system/isp-lib/v2/structure" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -var System systemController - -type systemController struct{} - -// GetSystems godoc -// @Tags system -// @Summary Получить список систем -// @Description Возвращает список систем по их идентификаторам -// @Accept json -// @Produce json -// @Param body body []integer false "Массив идентификаторов систем" -// @Success 200 {array} entity.System -// @Failure 500 {object} structure.GrpcError -// @Router /system/get_systems [POST] -func (systemController) GetSystems(list []int32) ([]entity.System, error) { - res, err := model.SystemRep.GetSystems(list) - if err != nil { - return res, err - } - - return res, nil -} - -// CreateUpdateSystem godoc -// @Tags system -// @Summary Создать/обновить систему -// @Description Если система с такими идентификатором существует, то обновляет данные, если нет, то добавляет данные в базу -// @Accept json -// @Produce json -// @Param body body entity.System true "Объект системы" -// @Success 200 {object} entity.System -// @Failure 404 {object} structure.GrpcError -// @Failure 409 {object} structure.GrpcError -// @Failure 500 {object} structure.GrpcError -// @Router /system/create_update_system [POST] -func (systemController) CreateUpdateSystem(system entity.System) (*entity.System, error) { - existed, err := model.SystemRep.GetSystemByName(system.Name) - if err != nil { - return nil, err - } - if system.Id == 0 { - if existed != nil { - return nil, status.Errorf(codes.AlreadyExists, "System with name %s already exists", system.Name) - } - - system, err = model.SystemRep.CreateSystem(system) - if err != nil { - return nil, err - } - - return &system, nil - } - - if existed != nil && existed.Id != system.Id { - return nil, status.Errorf(codes.AlreadyExists, "System with name %s already exists", system.Name) - } - - existed, err = model.SystemRep.GetSystemById(system.Id) - if err != nil { - return nil, err - } - if existed == nil { - return nil, status.Error(codes.NotFound, fmt.Sprintf("System with id %d not found", system.Id)) - } - - system, err = model.SystemRep.UpdateSystem(system) - if err != nil { - return nil, err - } - - return &system, nil -} - -// GetSystemById godoc -// @Tags system -// @Summary Получить систему по идентификатору -// @Description Возвращает описание системы по ее идентификатору -// @Accept json -// @Produce json -// @Param body body domain.Identity true "Идентификатор системы" -// @Success 200 {object} entity.System -// @Failure 404 {object} structure.GrpcError -// @Failure 500 {object} structure.GrpcError -// @Router /system/get_system_by_id [POST] -func (systemController) GetSystemById(identity domain.Identity) (*entity.System, error) { - sys, err := model.SystemRep.GetSystemById(identity.Id) - if err != nil { - return nil, err - } - if sys == nil { - return nil, status.Error(codes.NotFound, fmt.Sprintf("System with id %d not found", identity.Id)) - } - - return sys, nil -} - -// DeleteSystems godoc -// @Tags system -// @Summary Удалить системы -// @Description Удаляет системы по списку их идентификаторов, возвращает количество удаленных систем -// @Accept json -// @Produce json -// @Param body body []integer false "Массив идентификаторов систем" -// @Success 200 {object} domain.DeleteResponse -// @Failure 400 {object} structure.GrpcError -// @Failure 500 {object} structure.GrpcError -// @Router /system/delete_systems [POST] -func (systemController) DeleteSystems(list []int32) (domain.DeleteResponse, error) { - if len(list) == 0 { - return domain.DeleteResponse{}, status.Error(codes.InvalidArgument, "At least one id are required") - } - - res, err := model.SystemRep.DeleteSystems(list) - if err != nil { - return domain.DeleteResponse{}, err - } - - return domain.DeleteResponse{Deleted: res}, nil -} From ed5cb04ed331c17224cacffaa6e429ad229ec05f Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:15:01 +0400 Subject: [PATCH 20/35] MSP-623 reimplement token controller --- controller/token.go | 264 +++++++++----------------------------------- 1 file changed, 54 insertions(+), 210 deletions(-) diff --git a/controller/token.go b/controller/token.go index 1617ae0..33b8d39 100644 --- a/controller/token.go +++ b/controller/token.go @@ -2,114 +2,85 @@ package controller import ( "context" - "fmt" - "time" - rd "github.com/go-redis/redis/v8" - "github.com/integration-system/isp-lib/v2/config" - redisLib "github.com/integration-system/isp-lib/v2/redis" + "github.com/pkg/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "isp-system-service/conf" "isp-system-service/domain" - "isp-system-service/entity" - "isp-system-service/model" - "isp-system-service/redis" - "isp-system-service/service" ) -const ( - SystemIdentityFieldInDb = "1" - DomainIdentityFieldInDb = "2" - ServiceIdentityFieldInDb = "3" - ApplicationIdentityFieldInDb = "4" -) +type ITokenService interface { + GetByAppId(ctx context.Context, appId int) ([]domain.Token, error) + Create(ctx context.Context, req domain.TokenCreateRequest) (*domain.ApplicationWithTokens, error) + Revoke(ctx context.Context, req domain.TokenRevokeRequest) (*domain.ApplicationWithTokens, error) + RevokeByAppId(ctx context.Context, appId int) (*domain.DeleteResponse, error) +} -var Token tokenController +type Token struct { + service ITokenService +} -type tokenController struct{} +func NewToken(service ITokenService) Token { + return Token{ + service: service, + } +} -// CreateToken godoc +// GetByAppId godoc +// @Tags token +// @Summary Получить токены по идентификатору приложения +// @Description Возвращает список токенов, привязанных к приложению +// @Accept json +// @Produce json +// @Param body body domain.Identity true "Идентификатор приложения" +// @Success 200 {array} entity.Token +// @Failure 500 {object} structure.GrpcError +// @Router /token/get_tokens_by_app_id [POST] +func (c Token) GetByAppId(ctx context.Context, req domain.Identity) ([]domain.Token, error) { + return c.service.GetByAppId(ctx, req.Id) +} + +// Create godoc // @Tags token // @Summary Создать токен -// @Description Созддает токен и привязывает его к приложению +// @Description Создает токен и привязывает его к приложению // @Accept json // @Produce json -// @Param body body domain.CreateTokenRequest true "Объект создания токена" -// @Success 200 {object} domain.AppWithToken +// @Param body body domain.TokenCreateRequest true "Объект создания токена" +// @Success 200 {object} domain.ApplicationWithTokens // @Failure 500 {object} structure.GrpcError // @Router /token/create_token [POST] -func (c tokenController) CreateToken(req domain.CreateTokenRequest) (*domain.AppWithToken, error) { - m, err, app := c.getIdMap(req.AppId) - if err != nil { +func (c Token) Create(ctx context.Context, req domain.TokenCreateRequest) (*domain.ApplicationWithTokens, error) { + result, err := c.service.Create(ctx, req) + switch { + case errors.Is(err, domain.ErrApplicationNotFound): + return nil, status.Errorf(codes.NotFound, "application with id %d not found", req.AppId) + case errors.Is(err, domain.ErrServiceNotFound): + return nil, status.Errorf(codes.NotFound, "service for app_id id %d not found", req.AppId) + case errors.Is(err, domain.ErrDomainNotFound): + return nil, status.Errorf(codes.NotFound, "domain for app_id %d not found", req.AppId) + case err != nil: return nil, err + default: + return result, nil } - - expTime := req.ExpireTimeMs - if expTime == 0 { - expTime = config.GetRemote().(*conf.RemoteConfig).DefaultTokenExpireTime - } - token, err := service.Jwt.CreateApplication(req.AppId, expTime) - if err != nil { - return nil, err - } - - tokenInfo := entity.Token{ - Token: token, - ExpireTime: expTime, - AppId: req.AppId, - CreatedAt: time.Now(), - } - - if err := model.DbClient.RunInTransaction(func(repository model.TokenRepository) error { - tokenInfo, err = repository.SaveToken(tokenInfo) - if err != nil { - return err - } - - return c.setIdentityMapForToken(tokenInfo, m) - }); err != nil { - return nil, err - } - - arr, err := Application.enrichWithTokens(*app) - if err != nil { - return nil, err - } - - return arr[0], nil } -// RevokeTokens godoc +// Revoke godoc // @Tags token // @Summary Отозвать токены -// @Description Отвязывает токены от приложений и удялет их +// @Description Отвязывает токены от приложений и удаляет их // @Accept json // @Produce json -// @Param body body domain.RevokeTokensRequest true "Объект отзыва токенов" -// @Success 200 {object} domain.AppWithToken +// @Param body body domain.TokenRevokeRequest true "Объект отзыва токенов" +// @Success 200 {object} domain.ApplicationWithTokens // @Failure 500 {object} structure.GrpcError // @Router /token/revoke_tokens [POST] -func (c tokenController) RevokeTokens(req domain.RevokeTokensRequest) (*domain.AppWithToken, error) { - app, err := model.AppRep.GetApplicationById(req.AppId) - if err != nil { - return nil, err - } - - _, err = c.revokeTokens(req.Tokens) - if err != nil { - return nil, err - } - - res, err := Application.enrichWithTokens(*app) - if err != nil { - return nil, err - } - - return res[0], nil +func (c Token) Revoke(ctx context.Context, req domain.TokenRevokeRequest) (*domain.ApplicationWithTokens, error) { + return c.service.Revoke(ctx, req) } -// RevokeTokensForApp godoc +// RevokeForApp godoc // @Tags token // @Summary Отозвать токены для приложения // @Description Отвязывает токены от приложений и удаляет их по идентификатору приложения @@ -119,133 +90,6 @@ func (c tokenController) RevokeTokens(req domain.RevokeTokensRequest) (*domain.A // @Success 200 {object} domain.DeleteResponse // @Failure 500 {object} structure.GrpcError // @Router /token/revoke_tokens_for_app [POST] -func (c tokenController) RevokeTokensForApp(identity domain.Identity) (*domain.DeleteResponse, error) { - return c.revokeTokensForApp(identity) -} - -// GetTokensByAppId godoc -// @Tags token -// @Summary Получить токены по идентификаотру приложения -// @Description Возвращает список токенов, привязанных к приложению -// @Accept json -// @Produce json -// @Param body body domain.Identity true "Идентификатор приложения" -// @Success 200 {array} entity.Token -// @Failure 500 {object} structure.GrpcError -// @Router /token/get_tokens_by_app_id [POST] -func (tokenController) GetTokensByAppId(identity domain.Identity) ([]entity.Token, error) { - return model.TokenRep.GetTokensByAppId(identity.Id) -} - -func (c tokenController) setIdentityMapForToken(token entity.Token, idMap map[string]interface{}) error { - return c.SetIdentityMapForTokenV2(token.Token, token.ExpireTime, idMap) -} - -func (tokenController) SetIdentityMapForTokenV2(token string, expireTime int64, idMap map[string]interface{}) error { - instanceUuid := config.Get().(*conf.Configuration).InstanceUuid - _, e := redis.Client.Get().UseDbTx(redisLib.ApplicationTokenDb, func(p rd.Pipeliner) error { - key := fmt.Sprintf("%s|%s", token, instanceUuid) - stat := p.HMSet(context.Background(), key, idMap) - err := stat.Err() - if err != nil { - return err - } - if expireTime > 0 { - err = p.Expire(context.Background(), token, time.Duration(expireTime)*time.Millisecond).Err() - } - - return err - }) - - return e -} - -func (tokenController) getIdMap(appId int32) (map[string]interface{}, error, *entity.Application) { - appInfo, err := model.AppRep.GetApplicationById(appId) - if err != nil { - return nil, err, nil - } - if appInfo == nil { - return nil, status.Errorf(codes.NotFound, "Application with id %d not found", appId), nil - } - - serviceInfo, err := model.ServiceRep.GetServiceById(appInfo.ServiceId) - if err != nil { - return nil, err, appInfo - } - if serviceInfo == nil { - return nil, status.Errorf(codes.NotFound, "Service with id %d not found", appInfo.ServiceId), appInfo - } - - domainInfo, err := model.DomainRep.GetDomainById(serviceInfo.DomainId) - if err != nil { - return nil, err, appInfo - } - if domainInfo == nil { - return nil, status.Errorf(codes.NotFound, "Domain with id %d not found", serviceInfo.DomainId), appInfo - } - - systemInfo, err := model.SystemRep.GetSystemById(domainInfo.SystemId) - if err != nil { - return nil, err, appInfo - } - if systemInfo == nil { - return nil, status.Errorf(codes.NotFound, "System with id %d not found", domainInfo.SystemId), appInfo - } - - return map[string]interface{}{ - SystemIdentityFieldInDb: systemInfo.Id, - DomainIdentityFieldInDb: domainInfo.Id, - ServiceIdentityFieldInDb: serviceInfo.Id, - ApplicationIdentityFieldInDb: appInfo.Id, - }, nil, appInfo -} - -func (c tokenController) revokeTokensForApp(identity domain.Identity) (*domain.DeleteResponse, error) { - tokens, err := model.TokenRep.GetTokensByAppId(identity.Id) - if err != nil { - return nil, err - } - - tokenIdList := make([]string, len(tokens)) - for i, t := range tokens { - tokenIdList[i] = t.Token - } - - return c.revokeTokens(tokenIdList) -} - -func (tokenController) revokeTokens(tokens []string) (*domain.DeleteResponse, error) { - if len(tokens) == 0 { - return &domain.DeleteResponse{Deleted: 0}, nil - } - - var ( - count = 0 - instanceUuid = config.Get().(*conf.Configuration).InstanceUuid - keys = make([]string, len(tokens)) - ) - for i, token := range tokens { - keys[i] = fmt.Sprintf("%s|%s", token, instanceUuid) - } - err := model.DbClient.RunInTransaction(func(rep model.TokenRepository) error { - deleted, err := rep.DeleteTokens(tokens) - if err != nil { - return err - } - count = deleted - - _, err = redis.Client.Get().UseDbTx(redisLib.ApplicationTokenDb, func(p rd.Pipeliner) error { - _, err := p.Del(context.Background(), keys...).Result() - - return err - }) - - return err - }) - if err != nil { - return nil, err - } - - return &domain.DeleteResponse{Deleted: count}, nil +func (c Token) RevokeForApp(ctx context.Context, req domain.Identity) (*domain.DeleteResponse, error) { + return c.service.RevokeByAppId(ctx, req.Id) } From da4156afde7e185a33e125fb6a61bf243b480157 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:15:16 +0400 Subject: [PATCH 21/35] MSP-623 reimplement service controller --- controller/service.go | 199 +++++++++++++++++++----------------------- 1 file changed, 90 insertions(+), 109 deletions(-) diff --git a/controller/service.go b/controller/service.go index 805e61e..2aaa3ad 100644 --- a/controller/service.go +++ b/controller/service.go @@ -1,134 +1,113 @@ package controller import ( - "isp-system-service/domain" - "isp-system-service/entity" - "isp-system-service/model" + "context" + "github.com/pkg/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "isp-system-service/domain" ) -var Service serviceController - -type serviceController struct{} - -// GetService godoc -// @Tags service -// @Summary Получить список сервисов -// @Description Возвращает список сервисов по их идентификаторам -// @Accept json -// @Produce json -// @Param body body []integer false "Массив идентификаторов сервисов" -// @Success 200 {array} entity.Service -// @Failure 500 {object} structure.GrpcError -// @Router /service/get_service [POST] -func (serviceController) GetService(list []int32) ([]entity.Service, error) { - res, err := model.ServiceRep.GetServices(list) - if err != nil { - return res, err - } - - return res, nil +type ServiceService interface { + GetById(ctx context.Context, id int) (*domain.Service, error) + GetByIdList(ctx context.Context, idList []int) ([]domain.Service, error) + GetByDomainId(ctx context.Context, domainId int) ([]domain.Service, error) + CreateUpdate(ctx context.Context, req domain.ServiceCreateUpdateRequest) (*domain.Service, error) + Delete(ctx context.Context, idList []int) (int, error) } -// GetServicesByDomainId godoc -// @Tags service -// @Summary Получить список сервисов по идентификатору домена -// @Description Возвращает список сервисов по идентификатору домена -// @Accept json -// @Produce json -// @Param body body domain.Identity true "Идентификатор домена" -// @Success 200 {array} entity.Service -// @Failure 500 {object} structure.GrpcError -// @Router /service/get_services_by_domain_id [POST] -func (serviceController) GetServicesByDomainId(identity domain.Identity) ([]entity.Service, error) { - return model.ServiceRep.GetServicesByDomainId(identity.Id) +type Service struct { + service ServiceService } -// CreateUpdateService godoc -// @Tags service -// @Summary Создать/обновить сервис -// @Description Если сервис с такими идентификатором существует, то обновляет данные, если нет, то добавляет данные в базу -// @Accept json -// @Produce json -// @Param body body entity.Service true "Объект сервиса" -// @Success 200 {object} entity.Service -// @Failure 400 {object} structure.GrpcError -// @Failure 404 {object} structure.GrpcError -// @Failure 409 {object} structure.GrpcError -// @Failure 500 {object} structure.GrpcError -// @Router /service/create_update_service [POST] -func (serviceController) CreateUpdateService(service entity.Service) (*entity.Service, error) { - existed, err := model.ServiceRep.GetServiceByNameAndDomainId(service.Name, service.DomainId) - if err != nil { - return nil, err +func NewService(service ServiceService) Service { + return Service{ + service: service, } - - d, err := model.DomainRep.GetDomainById(service.DomainId) - if err != nil { - return nil, err - } - if d == nil { - return nil, status.Errorf(codes.InvalidArgument, "Domain with id %d not found", service.DomainId) - } - - if service.Id == 0 { - if existed != nil { - return nil, status.Errorf(codes.AlreadyExists, "Service with name %s already exists", service.Name) - } - service, err = model.ServiceRep.CreateService(service) - if err != nil { - return nil, err - } - - return &service, nil - } - - if existed != nil && existed.Id != service.Id { - return nil, status.Errorf(codes.AlreadyExists, "Service with name %s already exists", service.Name) - } - - existed, err = model.ServiceRep.GetServiceById(service.Id) - if err != nil { - return nil, err - } - if existed == nil { - return nil, status.Errorf(codes.NotFound, "Service with id %d not found", service.Id) - } - - service, err = model.ServiceRep.UpdateService(service) - if err != nil { - return nil, err - } - - return &service, nil } -// GetServiceById godoc +// GetById godoc // @Tags service // @Summary Получить сервис по идентификатору // @Description Возвращает описание сервиса по его идентификатору // @Accept json // @Produce json // @Param body body domain.Identity true "Идентификатор сервиса" -// @Success 200 {object} entity.Service +// @Success 200 {object} domain.Service // @Failure 404 {object} structure.GrpcError // @Failure 500 {object} structure.GrpcError // @Router /service/get_service_by_id [POST] -func (serviceController) GetServiceById(identity domain.Identity) (*entity.Service, error) { - service, err := model.ServiceRep.GetServiceById(identity.Id) - if err != nil { +func (c Service) GetById(ctx context.Context, req domain.Identity) (*domain.Service, error) { + result, err := c.service.GetById(ctx, req.Id) + switch { + case errors.Is(err, domain.ErrServiceNotFound): + return nil, status.Errorf(codes.NotFound, "service with id %d not found", req.Id) + case err != nil: return nil, err + default: + return result, nil } - if service == nil { - return nil, status.Errorf(codes.NotFound, "Service with id %d not found", identity.Id) - } - - return service, nil } -// DeleteService godoc +// Get godoc +// @Tags service +// @Summary Получить список сервисов +// @Description Возвращает список сервисов по их идентификаторам +// @Accept json +// @Produce json +// @Param body body []integer false "Массив идентификаторов сервисов" +// @Success 200 {array} domain.Service +// @Failure 500 {object} structure.GrpcError +// @Router /service/get_service [POST] +func (c Service) Get(ctx context.Context, req []int) ([]domain.Service, error) { + return c.service.GetByIdList(ctx, req) +} + +// GetByDomainId godoc +// @Tags service +// @Summary Получить список сервисов по идентификатору домена +// @Description Возвращает список сервисов по идентификатору домена +// @Accept json +// @Produce json +// @Param body body domain.Identity true "Идентификатор домена" +// @Success 200 {array} domain.Service +// @Failure 500 {object} structure.GrpcError +// @Router /service/get_services_by_domain_id [POST] +func (c Service) GetByDomainId(ctx context.Context, req domain.Identity) ([]domain.Service, error) { + return c.service.GetByDomainId(ctx, req.Id) +} + +// CreateUpdate godoc +// @Tags service +// @Summary Создать/обновить сервис +// @Description Если сервис с такими идентификатором существует, то обновляет данные, если нет, то добавляет данные в базу +// @Accept json +// @Produce json +// @Param body body domain.ServiceCreateUpdateRequest true "Объект сервиса" +// @Success 200 {object} domain.Service +// @Failure 400 {object} structure.GrpcError +// @Failure 404 {object} structure.GrpcError +// @Failure 409 {object} structure.GrpcError +// @Failure 500 {object} structure.GrpcError +// @Router /service/create_update_service [POST] +func (c Service) CreateUpdate(ctx context.Context, req domain.ServiceCreateUpdateRequest) (*domain.Service, error) { + result, err := c.service.CreateUpdate(ctx, req) + switch { + case errors.Is(err, domain.ErrDomainNotFound): + return nil, status.Errorf(codes.InvalidArgument, "domain with id %d not found", req.DomainId) + case errors.Is(err, domain.ErrServiceNotFound): + return nil, status.Errorf(codes.NotFound, "service with id %d not found", req.Id) + case errors.Is(err, domain.ErrServiceDuplicateName): + return nil, status.Errorf(codes.AlreadyExists, "service with name %s already exists", req.Name) + case err != nil: + return nil, err + default: + return result, nil + } +} + +// Delete godoc // @Tags service // @Summary Удалить сервисы // @Description Удаляет сервисов по списку их идентификаторов, возвращает количество удаленных сервисов @@ -139,15 +118,17 @@ func (serviceController) GetServiceById(identity domain.Identity) (*entity.Servi // @Failure 400 {object} structure.GrpcError // @Failure 500 {object} structure.GrpcError // @Router /service/delete_service [POST] -func (serviceController) DeleteService(list []int32) (domain.DeleteResponse, error) { - if len(list) == 0 { - return domain.DeleteResponse{Deleted: 0}, status.Error(codes.InvalidArgument, "At least one id are required") +func (c Service) Delete(ctx context.Context, req []int) (*domain.DeleteResponse, error) { + if len(req) == 0 { + return nil, status.Error(codes.InvalidArgument, "at least one id are required") } - res, err := model.ServiceRep.DeleteServices(list) + result, err := c.service.Delete(ctx, req) if err != nil { - return domain.DeleteResponse{}, err + return nil, err } - return domain.DeleteResponse{Deleted: res}, nil + return &domain.DeleteResponse{ + Deleted: result, + }, nil } From 82fd46b056fea5ef5c5a50e5d0d6df93e1e05ca9 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:15:38 +0400 Subject: [PATCH 22/35] MSP-623 reimplement application controller --- controller/application.go | 392 ++++++++++---------------------------- 1 file changed, 103 insertions(+), 289 deletions(-) diff --git a/controller/application.go b/controller/application.go index ba45f47..c973c0c 100644 --- a/controller/application.go +++ b/controller/application.go @@ -2,165 +2,127 @@ package controller import ( "context" - "fmt" - "isp-system-service/conf" - "isp-system-service/domain" - "isp-system-service/entity" - "isp-system-service/model" - "isp-system-service/redis" - - rd "github.com/go-redis/redis/v8" - "github.com/integration-system/isp-lib/v2/config" - rdLib "github.com/integration-system/isp-lib/v2/redis" - _ "github.com/integration-system/isp-lib/v2/structure" - "github.com/integration-system/isp-lib/v2/utils" + "github.com/pkg/errors" "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "isp-system-service/domain" ) -var Application applicationController - -type applicationController struct{} - -// GetApplications godoc -// @Tags application -// @Summary Получить список приложений -// @Description Возвращает массив приложений с токенами по их идентификаторам -// @Accept json -// @Produce json -// @Param body body []integer false "Массив идентификаторов приложений" -// @Success 200 {array} domain.AppWithToken -// @Failure 500 {object} structure.GrpcError -// @Router /application/get_applications [POST] -func (c applicationController) GetApplications(list []int32) ([]*domain.AppWithToken, error) { - res, err := model.AppRep.GetApplications(list) - if err != nil { - return nil, err - } - - return c.enrichWithTokens(res...) +type ApplicationService interface { + GetById(ctx context.Context, appId int) (*domain.ApplicationWithTokens, error) + GetByIdList(ctx context.Context, idList []int) ([]*domain.ApplicationWithTokens, error) + GetByServiceId(ctx context.Context, id int) ([]*domain.ApplicationWithTokens, error) + SystemTree(ctx context.Context, systemId int) ([]*domain.DomainWithService, error) + CreateUpdate(ctx context.Context, req domain.ApplicationCreateUpdateRequest) (*domain.ApplicationWithTokens, error) + Delete(ctx context.Context, idList []int) (int, error) } -// GetApplicationsByServiceId godoc -// @Tags application -// @Summary Получить список приложений по идентификатору сервиса -// @Description Возвращает список приложений по запрошенныму идентификатору сервиса -// @Accept json -// @Produce json -// @Param body body domain.Identity true "Идентификатор серсиса" -// @Success 200 {array} domain.AppWithToken -// @Failure 500 {object} structure.GrpcError -// @Router /application/get_applications_by_service_id [POST] -func (c applicationController) GetApplicationsByServiceId(identity domain.Identity) ([]*domain.AppWithToken, error) { - arr, err := model.AppRep.GetApplicationsByServiceId(identity.Id) - if err != nil { - return nil, err - } - - return c.enrichWithTokens(arr...) +type Application struct { + service ApplicationService } -// CreateUpdateApplication godoc -// @Tags application -// @Summary Создать/обновить приложение -// @Description Если приложение с такими идентификатором существует, то обновляет данные, если нет, то добавляет данные в базу -// @Accept json -// @Produce json -// @Param body body entity.Application true "Объект приложения" -// @Success 200 {object} domain.AppWithToken -// @Failure 400 {object} structure.GrpcError -// @Failure 404 {object} structure.GrpcError -// @Failure 409 {object} structure.GrpcError -// @Failure 500 {object} structure.GrpcError -// @Router /application/create_update_application [POST] -func (c applicationController) CreateUpdateApplication(app entity.Application) (*domain.AppWithToken, error) { - existed, err := model.AppRep.GetApplicationByNameAndServiceId(app.Name, app.ServiceId) - if err != nil { - return nil, err +func NewApplication(service ApplicationService) Application { + return Application{ + service: service, } - - s, err := model.ServiceRep.GetServiceById(app.ServiceId) - if err != nil { - return nil, err - } - if s == nil { - return nil, status.Errorf(codes.InvalidArgument, "Service with id %d not found", app.ServiceId) - } - - if app.Id == 0 { - if existed != nil { - return nil, status.Errorf(codes.AlreadyExists, "Application with name %s already exists", app.Name) - } - - app, err = model.AppRep.CreateApplication(app) - if err != nil { - return nil, err - } - - _, err = c.enrichWithTokens(app) - if err != nil { - return nil, err - } - - return &domain.AppWithToken{App: app, Tokens: []entity.Token{}}, nil - } - - if existed != nil && existed.Id != app.Id { - return nil, status.Errorf(codes.AlreadyExists, "Application with name %s already exists", app.Name) - } - - existed, err = model.AppRep.GetApplicationById(app.Id) - if err != nil { - return nil, err - } - if existed == nil { - return nil, status.Errorf(codes.NotFound, "Application with id %d not found", app.Id) - } - - app, err = model.AppRep.UpdateApplication(app) - if err != nil { - return nil, err - } - arr, err := c.enrichWithTokens(app) - if err != nil { - return nil, err - } - - return arr[0], nil } -// GetApplicationById godoc +// GetById godoc // @Tags application // @Summary Получить приложение по идентификатору // @Description Возвращает описание приложения по его идентификатору // @Accept json // @Produce json // @Param body body domain.Identity true "Идентификатор приложения" -// @Success 200 {object} domain.AppWithToken +// @Success 200 {object} domain.ApplicationWithTokens // @Failure 400 {object} structure.GrpcError // @Failure 404 {object} structure.GrpcError // @Failure 500 {object} structure.GrpcError // @Router /application/get_application_by_id [POST] -func (c applicationController) GetApplicationById(identity domain.Identity) (*domain.AppWithToken, error) { - application, err := model.AppRep.GetApplicationById(identity.Id) - if err != nil { +func (c Application) GetById(ctx context.Context, req domain.Identity) (*domain.ApplicationWithTokens, error) { + result, err := c.service.GetById(ctx, req.Id) + switch { + case errors.Is(err, domain.ErrApplicationNotFound): + return nil, status.Errorf(codes.NotFound, "application with id %d not found", req.Id) + case err != nil: return nil, err + default: + return result, nil } - if application == nil { - return nil, status.Errorf(codes.NotFound, "Application with id %d not found", identity.Id) - } - - arr, err := c.enrichWithTokens(*application) - if err != nil { - return nil, err - } - - return arr[0], nil } -// DeleteApplications godoc +// GetByIdList godoc +// @Tags application +// @Summary Получить список приложений +// @Description Возвращает массив приложений с токенами по их идентификаторам +// @Accept json +// @Produce json +// @Param body body []integer false "Массив идентификаторов приложений" +// @Success 200 {array} domain.ApplicationWithTokens +// @Failure 500 {object} structure.GrpcError +// @Router /application/get_applications [POST] +func (c Application) GetByIdList(ctx context.Context, req []int) ([]*domain.ApplicationWithTokens, error) { + return c.service.GetByIdList(ctx, req) +} + +// GetByServiceId godoc +// @Tags application +// @Summary Получить список приложений по идентификатору сервиса +// @Description Возвращает список приложений по запрошенному идентификатору сервиса +// @Accept json +// @Produce json +// @Param body body domain.Identity true "Идентификатор сервиса" +// @Success 200 {array} domain.ApplicationWithTokens +// @Failure 500 {object} structure.GrpcError +// @Router /application/get_applications_by_service_id [POST] +func (c Application) GetByServiceId(ctx context.Context, req domain.Identity) ([]*domain.ApplicationWithTokens, error) { + return c.service.GetByServiceId(ctx, req.Id) +} + +// GetSystemTree godoc +// @Tags application +// @Summary Метод получения системного дерева +// @Description Возвращает описание взаимосвязей сервисов и приложений +// @Accept json +// @Produce json +// @Success 200 {array} domain.DomainWithService +// @Failure 500 {object} structure.GrpcError +// @Router /application/get_system_tree [POST] +func (c Application) GetSystemTree(ctx context.Context) ([]*domain.DomainWithService, error) { + return c.service.SystemTree(ctx, domain.DefaultSystemId) +} + +// CreateUpdate godoc +// @Tags application +// @Summary Создать/обновить приложение +// @Description Если приложение с такими идентификатором существует, то обновляет данные, если нет, то добавляет данные в базу +// @Accept json +// @Produce json +// @Param body body domain.ApplicationCreateUpdateRequest true "Объект приложения" +// @Success 200 {object} domain.ApplicationWithTokens +// @Failure 400 {object} structure.GrpcError +// @Failure 404 {object} structure.GrpcError +// @Failure 409 {object} structure.GrpcError +// @Failure 500 {object} structure.GrpcError +// @Router /application/create_update_application [POST] +func (c Application) CreateUpdate(ctx context.Context, req domain.ApplicationCreateUpdateRequest) (*domain.ApplicationWithTokens, error) { + result, err := c.service.CreateUpdate(ctx, req) + switch { + case errors.Is(err, domain.ErrServiceNotFound): + return nil, status.Errorf(codes.InvalidArgument, "service with id %d not found", req.ServiceId) + case errors.Is(err, domain.ErrApplicationDuplicateName): + return nil, status.Errorf(codes.AlreadyExists, "application with name %s already exists", req.Name) + case errors.Is(err, domain.ErrApplicationNotFound): + return nil, status.Errorf(codes.NotFound, "Application with id %d not found", req.Id) + case err != nil: + return nil, err + default: + return result, nil + } +} + +// Delete godoc // @Tags application // @Summary Удалить приложения // @Description Удаляет приложения по списку их идентификаторов, возвращает количество удаленных приложений @@ -171,165 +133,17 @@ func (c applicationController) GetApplicationById(identity domain.Identity) (*do // @Failure 400 {object} structure.GrpcError // @Failure 500 {object} structure.GrpcError // @Router /application/delete_applications [POST] -func (applicationController) DeleteApplications(list []int32) (domain.DeleteResponse, error) { - if len(list) == 0 { - return domain.DeleteResponse{}, status.Errorf(codes.InvalidArgument, "At least one id are required") +func (c Application) Delete(ctx context.Context, req []int) (*domain.DeleteResponse, error) { + if len(req) == 0 { + return nil, status.Errorf(codes.InvalidArgument, "At least one id are required") } - var ( - count = 0 - instanceUuid = config.Get().(*conf.Configuration).InstanceUuid - ) - _, err := redis.Client.Get().UseDb(rdLib.ApplicationTokenDb, func(p rd.Pipeliner) error { - return model.DbClient.RunInTransaction(func( - appRep model.AppRepository, tokenRep model.TokenRepository, accessRep model.AccessListRepository) error { - accessList, err := accessRep.GetByAppIdList(list) - if err != nil { - return err - } - - redisDelRequest := make([]string, len(accessList)) - for i, access := range accessList { - redisDelRequest[i] = fmt.Sprintf("%d|%s", access.AppId, access.Method) - } - - tokens, err := tokenRep.GetTokensByAppId(list...) - if err != nil { - return err - } - - tokenIdList := make([]string, len(tokens)) - for i, t := range tokens { - tokenIdList[i] = t.Token - } - - if len(tokenIdList) != 0 { - keys := make([]string, len(tokens)) - for i, token := range tokenIdList { - keys[i] = fmt.Sprintf("%s|%s", token, instanceUuid) - } - - _, err := p.Del(context.Background(), keys...).Result() - if err != nil { - return err - } - } - - count, err = appRep.DeleteApplications(list) - if err != nil { - return err - } - - if len(redisDelRequest) > 0 { - _, err := redis.Client.Get().UseDb(rdLib.ApplicationPermissionDb, func(p rd.Pipeliner) error { - _, err := p.Del(context.Background(), redisDelRequest...).Result() - - return err - }) - if err != nil { - return err - } - } - - return nil - }) - }) + result, err := c.service.Delete(ctx, req) if err != nil { - return domain.DeleteResponse{}, err + return nil, err } - return domain.DeleteResponse{Deleted: count}, nil -} - -// GetSystemTree godoc -// @Tags application -// @Summary Метод получения системного дерева -// @Description Возвращает описание взаимосвязей сервисов и приложений -// @Accept json -// @Produce json -// @Success 200 {array} domain.DomainWithServices -// @Failure 500 {object} structure.GrpcError -// @Router /application/get_system_tree [POST] -func (applicationController) GetSystemTree(md metadata.MD) ([]*domain.DomainWithServices, error) { - sysId, err := utils.ResolveMetadataIdentity(utils.SystemIdHeader, md) - if err != nil { - return nil, err - } - domains, err := model.DomainRep.GetDomainsBySystemId(int32(sysId)) - if err != nil { - return nil, err - } - - l := len(domains) - if l == 0 { - return []*domain.DomainWithServices{}, nil - } - idList := make([]int32, l) - domainsMap := make(map[int32]*domain.DomainWithServices, l) - res := make([]*domain.DomainWithServices, l) - for i, d := range domains { - idList[i] = d.Id - dws := &domain.DomainWithServices{Id: d.Id, Name: d.Name, Description: d.Description, Services: make([]*domain.ServiceWithApps, 0)} - domainsMap[d.Id] = dws - res[i] = dws - } - services, err := model.ServiceRep.GetServicesByDomainId(idList...) - if err != nil { - return nil, err - } - - l = len(services) - idList = make([]int32, l) - servicesMap := make(map[int32]*domain.ServiceWithApps, l) - for i, s := range services { - idList[i] = s.Id - d := domainsMap[s.DomainId] - swa := &domain.ServiceWithApps{Id: s.Id, Name: s.Name, Description: s.Description, Apps: make([]*domain.SimpleApp, 0)} - d.Services = append(d.Services, swa) - servicesMap[s.Id] = swa - } - apps, err := model.AppRep.GetApplicationsByServiceId(idList...) - if err != nil { - return nil, err - } - - for _, app := range apps { - s := servicesMap[app.ServiceId] - s.Apps = append(s.Apps, &domain.SimpleApp{ - Id: app.Id, - Name: app.Name, - Type: app.Type, - Description: app.Description, - Tokens: make([]entity.Token, 0), - }) - } - - return res, nil -} - -func (applicationController) enrichWithTokens(apps ...entity.Application) ([]*domain.AppWithToken, error) { - l := len(apps) - if len(apps) == 0 { - return []*domain.AppWithToken{}, nil - } - idList := make([]int32, l) - appMap := make(map[int32]*domain.AppWithToken, l) - enriched := make([]*domain.AppWithToken, l) - for i, a := range apps { - idList[i] = a.Id - awt := &domain.AppWithToken{App: a, Tokens: make([]entity.Token, 0)} - appMap[a.Id] = awt - enriched[i] = awt - } - tokens, err := model.TokenRep.GetTokensByAppId(idList...) - if err != nil { - return nil, err - } - - for _, v := range tokens { - app := appMap[v.AppId] - app.Tokens = append(app.Tokens, v) - } - - return enriched, nil + return &domain.DeleteResponse{ + Deleted: result, + }, nil } From b429c0b6fccecf90b182b37ac83672b10228ad4d Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:15:47 +0400 Subject: [PATCH 23/35] MSP-623 reimplement access_list controller --- controller/access_list.go | 184 ++++++++++---------------------------- 1 file changed, 45 insertions(+), 139 deletions(-) diff --git a/controller/access_list.go b/controller/access_list.go index c715b88..bcfec1f 100644 --- a/controller/access_list.go +++ b/controller/access_list.go @@ -2,22 +2,28 @@ package controller import ( "context" - "fmt" - "isp-system-service/domain" - "isp-system-service/entity" - "isp-system-service/model" - "isp-system-service/redis" - - rd "github.com/go-redis/redis/v8" - rdLib "github.com/integration-system/isp-lib/v2/redis" + "github.com/pkg/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "isp-system-service/domain" ) -var AccessList accessListController +type AccessListService interface { + GetById(ctx context.Context, appId int) ([]domain.MethodInfo, error) + SetOne(ctx context.Context, request domain.AccessListSetOneRequest) (*domain.AccessListSetOneResponse, error) + SetList(ctx context.Context, req domain.AccessListSetListRequest) ([]domain.MethodInfo, error) +} -type accessListController struct{} +type AccessList struct { + service AccessListService +} + +func NewAccessList(service AccessListService) AccessList { + return AccessList{ + service: service, + } +} // GetById godoc // @Tags accessList @@ -30,160 +36,60 @@ type accessListController struct{} // @Failure 404 {object} structure.GrpcError // @Failure 500 {object} structure.GrpcError // @Router /access_list/get_by_id [POST] -func (c accessListController) GetById(request domain.Identity) ([]domain.MethodInfo, error) { - err := c.checkAppById(request.Id) - if err != nil { +func (c AccessList) GetById(ctx context.Context, req domain.Identity) ([]domain.MethodInfo, error) { + result, err := c.service.GetById(ctx, req.Id) + switch { + case errors.Is(err, domain.ErrApplicationNotFound): + return nil, status.Errorf(codes.NotFound, "application not found") + case err != nil: return nil, err + default: + return result, nil } - - return c.getAccessListById(request.Id) } // SetOne godoc // @Tags accessList // @Summary Настроить доступность метода для приложения -// @Description Возвращает количество изменных строк +// @Description Возвращает количество измененных строк // @Accept json // @Produce json -// @Param body body entity.AccessList false "объект для настройки доступа" -// @Success 200 {object} domain.CountResponse "количество измененных строк" +// @Param body body domain.AccessListSetOneRequest false "объект для настройки доступа" +// @Success 200 {object} domain.AccessListSetOneResponse "количество измененных строк" // @Failure 404 {object} structure.GrpcError // @Failure 500 {object} structure.GrpcError // @Router /access_list/set_one [POST] -func (c accessListController) SetOne(request entity.AccessList) (*domain.CountResponse, error) { - err := c.checkAppById(request.AppId) - if err != nil { +func (c AccessList) SetOne(ctx context.Context, req domain.AccessListSetOneRequest) (*domain.AccessListSetOneResponse, error) { + result, err := c.service.SetOne(ctx, req) + switch { + case errors.Is(err, domain.ErrApplicationNotFound): + return nil, status.Errorf(codes.NotFound, "application not found") + case err != nil: return nil, err + default: + return result, nil } - - resp := 0 - err = model.DbClient.RunInTransaction(func(repository model.AccessListRepository) error { - resp, err = repository.Upsert(request) - if err != nil { - return err - } - - _, err = redis.Client.Get().UseDb(rdLib.ApplicationPermissionDb, func(p rd.Pipeliner) error { - key := fmt.Sprintf("%d|%s", request.AppId, request.Method) - _, err := p.Set(context.Background(), key, request.Value, 0).Result() - - return err - }) - - return err - }) - if err != nil { - return nil, err - } - - return &domain.CountResponse{Count: resp}, nil } // SetList godoc // @Tags accessList -// @Summary Настройть доступность списка методов для приложения +// @Summary Настроить доступность списка методов для приложения // @Description Возвращает список методов для приложения, для которых заданы настройки доступа // @Accept json // @Produce json -// @Param body body domain.SetListRequest false "объект настройки доступа" +// @Param body body domain.AccessListSetListRequest false "объект настройки доступа" // @Success 200 {array} domain.MethodInfo "список доступности методов" // @Failure 404 {object} structure.GrpcError // @Failure 500 {object} structure.GrpcError // @Router /access_list/set_list [POST] -func (c accessListController) SetList(request domain.SetListRequest) ([]domain.MethodInfo, error) { - err := c.checkAppById(request.AppId) - if err != nil { +func (c AccessList) SetList(ctx context.Context, req domain.AccessListSetListRequest) ([]domain.MethodInfo, error) { + result, err := c.service.SetList(ctx, req) + switch { + case errors.Is(err, domain.ErrApplicationNotFound): + return nil, status.Errorf(codes.NotFound, "application not found") + case err != nil: return nil, err + default: + return result, nil } - - oldAccessList := make([]entity.AccessList, 0) - err = model.DbClient.RunInTransaction(func(repository model.AccessListRepository) error { - if request.RemoveOld { - oldAccessList, err = repository.DeleteById(request.AppId) - if err != nil { - return err - } - } - - newAccessList := make([]entity.AccessList, len(request.Methods)) - redisMsetRequest := make([]interface{}, 0) - for i, m := range request.Methods { - newAccessList[i] = entity.AccessList{ - AppId: request.AppId, - Method: m.Method, - Value: m.Value, - } - redisMsetRequest = append(redisMsetRequest, fmt.Sprintf("%d|%s", request.AppId, m.Method), m.Value) - } - - redisDelRequest := make([]string, len(oldAccessList)) - for i, access := range oldAccessList { - redisDelRequest[i] = fmt.Sprintf("%d|%s", request.AppId, access.Method) - } - - if len(newAccessList) > 0 { - _, err := repository.UpsertArray(newAccessList) - if err != nil { - return err - } - } - - _, err := redis.Client.Get().UseDb(rdLib.ApplicationPermissionDb, func(p rd.Pipeliner) error { - if len(redisDelRequest) > 0 { - _, err := p.Del(context.Background(), redisDelRequest...).Result() - if err != nil { - return err - } - } - - if len(redisMsetRequest) > 0 { - _, err := p.MSet(context.Background(), redisMsetRequest...).Result() - if err != nil { - return err - } - } - - return nil - }) - - return err - }) - if err != nil { - return nil, err - } - - return c.getAccessListById(request.AppId) -} - -func (c accessListController) getAccessListById(id int32) ([]domain.MethodInfo, error) { - accessList, err := model.AccessListRep.GetByAppId(id) - if err != nil { - return nil, err - } - - return c.convertAccessList(accessList), nil -} - -func (accessListController) convertAccessList(accessLists []entity.AccessList) []domain.MethodInfo { - methodInfos := make([]domain.MethodInfo, len(accessLists)) - for i, access := range accessLists { - methodInfos[i] = domain.MethodInfo{ - Method: access.Method, - Value: access.Value, - } - } - - return methodInfos -} - -func (accessListController) checkAppById(appId int32) error { - app, err := model.AppRep.GetApplicationById(appId) - if err != nil { - return err - } - if app == nil { - return status.Errorf(codes.NotFound, "application '%d' not found", appId) - } - - return nil } From 9db858b0e22840c6e8bd188586a9e5979561f0a0 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:19:59 +0400 Subject: [PATCH 24/35] MSP-623 reimplement domain controller --- controller/domain.go | 180 ++++++++++++++++++------------------------- 1 file changed, 75 insertions(+), 105 deletions(-) diff --git a/controller/domain.go b/controller/domain.go index 9bfc018..d74549a 100644 --- a/controller/domain.go +++ b/controller/domain.go @@ -1,127 +1,95 @@ package controller import ( - "isp-system-service/domain" - "isp-system-service/entity" - "isp-system-service/model" + "context" - _ "github.com/integration-system/isp-lib/v2/structure" - "github.com/integration-system/isp-lib/v2/utils" + "github.com/pkg/errors" "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "isp-system-service/domain" ) -var Domain domainController - -type domainController struct{} - -// GetDomainsBySystemId godoc -// @Tags domain -// @Summary Получить домены по идентификатору системы -// @Description Возвращает список доменов по системному идентификатору -// @Accept json -// @Produce json -// @Param body body integer false "Идентификатор системы" -// @Success 200 {array} entity.Domain -// @Failure 500 {object} structure.GrpcError -// @Router /domain/get_domains_by_system_id [POST] -func (domainController) GetDomainsBySystemId(md metadata.MD) ([]entity.Domain, error) { - sysId, err := utils.ResolveMetadataIdentity(utils.SystemIdHeader, md) - if err != nil { - return nil, err - } - - return model.DomainRep.GetDomainsBySystemId(int32(sysId)) +type DomainService interface { + GetById(ctx context.Context, id int) (*domain.Domain, error) + GetBySystemId(ctx context.Context, systemId int) ([]domain.Domain, error) + CreateUpdate(ctx context.Context, req domain.DomainCreateUpdateRequest, systemId int) (*domain.Domain, error) + Delete(ctx context.Context, idList []int) (int, error) } -// CreateUpdateDomain godoc -// @Tags domain -// @Summary Создать/обновить домен -// @Description Если домен с такими идентификатором существует, то обновляет данные, если нет, то добавляет данные в базу -// @Accept json -// @Produce json -// @Param body body entity.Domain true "Объект домена" -// @Success 200 {object} entity.Domain -// @Failure 500 {object} structure.GrpcError -// @Router /domain/create_update_domain [POST] -func (domainController) CreateUpdateDomain(domain entity.Domain, md metadata.MD) (*entity.Domain, error) { - existed, err := model.DomainRep.GetDomainByNameAndSystemId(domain.Name, domain.SystemId) - if err != nil { - return nil, err - } - - sysId, err := utils.ResolveMetadataIdentity(utils.SystemIdHeader, md) - if err != nil { - return nil, err - } - domain.SystemId = int32(sysId) - - sys, err := model.SystemRep.GetSystemById(domain.SystemId) - if err != nil { - return nil, err - } - if sys == nil { - return nil, status.Errorf(codes.InvalidArgument, "System with id %d not found", domain.SystemId) - } - - if domain.Id == 0 { - if existed != nil { - return nil, status.Errorf(codes.AlreadyExists, "Domain with name %s already exists", domain.Name) - } - - domain, err = model.DomainRep.CreateDomain(domain) - if err != nil { - return nil, err - } - - return &domain, nil - } - - if existed != nil && existed.Id != domain.Id { - return nil, status.Errorf(codes.AlreadyExists, "Domain with name %s already exists", domain.Name) - } - - existed, err = model.DomainRep.GetDomainById(domain.Id) - if err != nil { - return nil, err - } - if existed == nil { - return nil, status.Errorf(codes.NotFound, "Domain with id %d not found", domain.Id) - } - - domain, err = model.DomainRep.UpdateDomain(domain) - if err != nil { - return nil, err - } - - return &domain, nil +type Domain struct { + service DomainService } -// GetDomainById godoc +func NewDomain(service DomainService) Domain { + return Domain{ + service: service, + } +} + +// GetById godoc // @Tags domain // @Summary Получить домен по идентификатору // @Description Возвращает описание домена по его идентификатору // @Accept json // @Produce json // @Param body body domain.Identity true "Идентификатор домена" -// @Success 200 {object} entity.Domain +// @Success 200 {object} domain.Domain // @Failure 404 {object} structure.GrpcError // @Failure 500 {object} structure.GrpcError // @Router /domain/get_domain_by_id [POST] -func (domainController) GetDomainById(identity domain.Identity) (*entity.Domain, error) { - d, err := model.DomainRep.GetDomainById(identity.Id) - if err != nil { +func (c Domain) GetById(ctx context.Context, req domain.Identity) (*domain.Domain, error) { + result, err := c.service.GetById(ctx, req.Id) + switch { + case errors.Is(err, domain.ErrDomainNotFound): + return nil, status.Errorf(codes.NotFound, "domain with id %d not found", req.Id) + case err != nil: return nil, err + default: + return result, nil } - if d == nil { - return nil, status.Errorf(codes.NotFound, "Domain with id %d not found", identity.Id) - } - - return d, err } -// DeleteDomains godoc +// GetBySystemId godoc +// @Tags domain +// @Summary Получить домены по идентификатору системы +// @Description Возвращает список доменов по системному идентификатору +// @Accept json +// @Produce json +// @Param body body integer false "Идентификатор системы" +// @Success 200 {array} domain.Domain +// @Failure 500 {object} structure.GrpcError +// @Router /domain/get_domains_by_system_id [POST] +func (c Domain) GetBySystemId(ctx context.Context) ([]domain.Domain, error) { + return c.service.GetBySystemId(ctx, domain.DefaultSystemId) +} + +// CreateUpdate godoc +// @Tags domain +// @Summary Создать/обновить домен +// @Description Если домен с такими идентификатором существует, то обновляет данные, если нет, то добавляет данные в базу +// @Accept json +// @Produce json +// @Param body body domain.DomainCreateUpdateRequest true "Объект домена" +// @Success 200 {object} domain.Domain +// @Failure 500 {object} structure.GrpcError +// @Router /domain/create_update_domain [POST] +func (c Domain) CreateUpdate(ctx context.Context, req domain.DomainCreateUpdateRequest) (*domain.Domain, error) { + result, err := c.service.CreateUpdate(ctx, req, domain.DefaultSystemId) + switch { + case errors.Is(err, domain.ErrSystemNotFound): + return nil, status.Errorf(codes.InvalidArgument, "system with id %d not found", domain.DefaultSystemId) + case errors.Is(err, domain.ErrDomainNotFound): + return nil, status.Errorf(codes.NotFound, "domain with id %d not found", req.Id) + case errors.Is(err, domain.ErrDomainDuplicateName): + return nil, status.Errorf(codes.AlreadyExists, "domain with name %s already exists", req.Name) + case err != nil: + return nil, err + default: + return result, nil + } +} + +// Delete godoc // @Tags domain // @Summary Удаление доменов // @Description Удаляет домены по списку их идентификаторов, возвращает количество удаленных доменов @@ -132,15 +100,17 @@ func (domainController) GetDomainById(identity domain.Identity) (*entity.Domain, // @Failure 400 {object} structure.GrpcError // @Failure 500 {object} structure.GrpcError // @Router /domain/delete_domains [POST] -func (domainController) DeleteDomains(list []int32) (domain.DeleteResponse, error) { - if len(list) == 0 { - return domain.DeleteResponse{Deleted: 0}, status.Errorf(codes.InvalidArgument, "At least one id are required") +func (c Domain) Delete(ctx context.Context, req []int) (*domain.DeleteResponse, error) { + if len(req) == 0 { + return nil, status.Errorf(codes.InvalidArgument, "at least one id are required") } - res, err := model.DomainRep.DeleteDomains(list) + result, err := c.service.Delete(ctx, req) if err != nil { - return domain.DeleteResponse{}, err + return nil, err } - return domain.DeleteResponse{Deleted: res}, nil + return &domain.DeleteResponse{ + Deleted: result, + }, nil } From 7b5ca9d12c64d087c394f54e2021a55a839cff4a Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:17:00 +0400 Subject: [PATCH 25/35] MSP-623 reimplement routes --- helper/handler.go | 120 ------------------------------ routes/routes.go | 182 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 182 insertions(+), 120 deletions(-) delete mode 100644 helper/handler.go create mode 100644 routes/routes.go diff --git a/helper/handler.go b/helper/handler.go deleted file mode 100644 index 4b7692b..0000000 --- a/helper/handler.go +++ /dev/null @@ -1,120 +0,0 @@ -package helper - -import ( - "isp-system-service/controller" - "isp-system-service/domain" - "isp-system-service/entity" - - "google.golang.org/grpc/metadata" -) - -type SystemHandler struct { - GetSystems func([]int32) ([]entity.System, error) `method:"get_systems" group:"system" inner:"true"` - CreateUpdateSystem func(entity.System) (*entity.System, error) `method:"create_update_system" group:"system" inner:"true"` - GetSystemById func(domain.Identity) (*entity.System, error) `method:"get_system_by_id" group:"system" inner:"true"` - DeleteSystems func([]int32) (domain.DeleteResponse, error) `method:"delete_systems" group:"system" inner:"true"` -} - -type DomainHandler struct { - GetDomainsBySystemId func(metadata.MD) ([]entity.Domain, error) `method:"get_domains_by_system_id" group:"domain" inner:"true"` - CreateUpdateDomain func(entity.Domain, metadata.MD) (*entity.Domain, error) `method:"create_update_domain" group:"domain" inner:"true"` - GetDomainById func(domain.Identity) (*entity.Domain, error) `method:"get_domain_by_id" group:"domain" inner:"true"` - DeleteDomains func([]int32) (domain.DeleteResponse, error) `method:"delete_domains" group:"domain" inner:"true"` -} - -type ServiceHandler struct { - GetService func([]int32) ([]entity.Service, error) `method:"get_service" group:"service" inner:"true"` - GetServicesByDomainId func(domain.Identity) ([]entity.Service, error) `method:"get_services_by_domain_id" group:"service" inner:"true"` - CreateUpdateService func(entity.Service) (*entity.Service, error) `method:"create_update_service" group:"service" inner:"true"` - GetServiceById func(domain.Identity) (*entity.Service, error) `method:"get_service_by_id" group:"service" inner:"true"` - DeleteService func([]int32) (domain.DeleteResponse, error) `method:"delete_service" group:"service" inner:"true"` -} - -type ApplicationHandler struct { - GetApplications func([]int32) ([]*domain.AppWithToken, error) `method:"get_applications" group:"application" inner:"true"` - GetApplicationsByServiceId func(domain.Identity) ([]*domain.AppWithToken, error) `method:"get_applications_by_service_id" group:"application" inner:"true"` - CreateUpdateApplication func(entity.Application) (*domain.AppWithToken, error) `method:"create_update_application" group:"application" inner:"true"` - GetApplicationById func(domain.Identity) (*domain.AppWithToken, error) `method:"get_application_by_id" group:"application" inner:"true"` - DeleteApplications func([]int32) (domain.DeleteResponse, error) `method:"delete_applications" group:"application" inner:"true"` - GetSystemTree func(metadata.MD) ([]*domain.DomainWithServices, error) `method:"get_system_tree" group:"application" inner:"true"` -} - -type TokenHandler struct { - CreateToken func(domain.CreateTokenRequest) (*domain.AppWithToken, error) `method:"create_token" group:"token" inner:"true"` - RevokeTokens func(domain.RevokeTokensRequest) (*domain.AppWithToken, error) `method:"revoke_tokens" group:"token" inner:"true"` - RevokeTokensForApp func(domain.Identity) (*domain.DeleteResponse, error) `method:"revoke_tokens_for_app" group:"token" inner:"true"` - GetTokensByAppId func(domain.Identity) ([]entity.Token, error) `method:"get_tokens_by_app_id" group:"token" inner:"true"` -} - -type AccessListHandler struct { - GetById func(domain.Identity) ([]domain.MethodInfo, error) `method:"get_by_id" group:"access_list" inner:"true"` - SetOne func(entity.AccessList) (*domain.CountResponse, error) `method:"set_one" group:"access_list" inner:"true"` - SetList func(domain.SetListRequest) ([]domain.MethodInfo, error) `method:"set_list" group:"access_list" inner:"true"` -} - -func GetSystemHandler() *SystemHandler { - return &SystemHandler{ - GetSystems: controller.System.GetSystems, - CreateUpdateSystem: controller.System.CreateUpdateSystem, - GetSystemById: controller.System.GetSystemById, - DeleteSystems: controller.System.DeleteSystems, - } -} - -func GetDomainHandler() *DomainHandler { - return &DomainHandler{ - GetDomainsBySystemId: controller.Domain.GetDomainsBySystemId, - CreateUpdateDomain: controller.Domain.CreateUpdateDomain, - GetDomainById: controller.Domain.GetDomainById, - DeleteDomains: controller.Domain.DeleteDomains, - } -} - -func GetServiceHandler() *ServiceHandler { - return &ServiceHandler{ - GetService: controller.Service.GetService, - GetServicesByDomainId: controller.Service.GetServicesByDomainId, - CreateUpdateService: controller.Service.CreateUpdateService, - GetServiceById: controller.Service.GetServiceById, - DeleteService: controller.Service.DeleteService, - } -} - -func GetApplicationHandler() *ApplicationHandler { - return &ApplicationHandler{ - GetApplications: controller.Application.GetApplications, - GetApplicationsByServiceId: controller.Application.GetApplicationsByServiceId, - CreateUpdateApplication: controller.Application.CreateUpdateApplication, - GetApplicationById: controller.Application.GetApplicationById, - DeleteApplications: controller.Application.DeleteApplications, - GetSystemTree: controller.Application.GetSystemTree, - } -} - -func GetTokenHandler() *TokenHandler { - return &TokenHandler{ - CreateToken: controller.Token.CreateToken, - GetTokensByAppId: controller.Token.GetTokensByAppId, - RevokeTokens: controller.Token.RevokeTokens, - RevokeTokensForApp: controller.Token.RevokeTokensForApp, - } -} - -func GetAccessListHandler() *AccessListHandler { - return &AccessListHandler{ - GetById: controller.AccessList.GetById, - SetOne: controller.AccessList.SetOne, - SetList: controller.AccessList.SetList, - } -} - -func GetAllHandlers() []interface{} { - return []interface{}{ - GetSystemHandler(), - GetDomainHandler(), - GetServiceHandler(), - GetApplicationHandler(), - GetTokenHandler(), - GetAccessListHandler(), - } -} diff --git a/routes/routes.go b/routes/routes.go new file mode 100644 index 0000000..3eb9800 --- /dev/null +++ b/routes/routes.go @@ -0,0 +1,182 @@ +package routes + +import ( + "github.com/integration-system/isp-kit/cluster" + "github.com/integration-system/isp-kit/grpc" + "github.com/integration-system/isp-kit/grpc/endpoint" + "github.com/integration-system/isp-kit/grpc/isp" + "isp-system-service/controller" +) + +type Controllers struct { + AccessList controller.AccessList + Domain controller.Domain + Service controller.Service + Application controller.Application + Token controller.Token +} + +func EndpointDescriptors() []cluster.EndpointDescriptor { + return endpointDescriptors(Controllers{}) +} + +func Handler(wrapper endpoint.Wrapper, c Controllers) isp.BackendServiceServer { + muxer := grpc.NewMux() + for _, descriptor := range endpointDescriptors(c) { + muxer.Handle(descriptor.Path, wrapper.Endpoint(descriptor.Handler)) + } + return muxer +} + +func endpointDescriptors(c Controllers) []cluster.EndpointDescriptor { + return concatCluster([][]cluster.EndpointDescriptor{ + accessListCluster(c), + domainCluster(c), + serviceCluster(c), + applicationCluster(c), + tokenCluster(c), + }) +} + +func accessListCluster(c Controllers) []cluster.EndpointDescriptor { + return []cluster.EndpointDescriptor{ + { + Path: "system/access_list/get_by_id", + Inner: true, + Handler: c.AccessList.GetById, + }, + { + Path: "system/access_list/set_one", + Inner: true, + Handler: c.AccessList.SetOne, + }, + { + Path: "system/access_list/set_list", + Inner: true, + Handler: c.AccessList.SetList, + }, + } +} + +func domainCluster(c Controllers) []cluster.EndpointDescriptor { + return []cluster.EndpointDescriptor{ + { + Path: "system/domain/get_domains_by_system_id", + Inner: true, + Handler: c.Domain.GetBySystemId, + }, + { + Path: "system/domain/create_update_domain", + Inner: true, + Handler: c.Domain.CreateUpdate, + }, + { + Path: "system/domain/get_domain_by_id", + Inner: true, + Handler: c.Domain.GetById, + }, + { + Path: "system/domain/delete_domains", + Inner: true, + Handler: c.Domain.Delete, + }, + } +} + +func serviceCluster(c Controllers) []cluster.EndpointDescriptor { + return []cluster.EndpointDescriptor{ + { + Path: "system/service/get_service", + Inner: true, + Handler: c.Service.Get, + }, + { + Path: "system/service/get_services_by_domain_id", + Inner: true, + Handler: c.Service.GetByDomainId, + }, + { + Path: "system/service/create_update_service", + Inner: true, + Handler: c.Service.CreateUpdate, + }, + { + Path: "system/service/get_service_by_id", + Inner: true, + Handler: c.Service.GetById, + }, + { + Path: "system/service/delete_service", + Inner: true, + Handler: c.Service.Delete, + }, + } +} + +func applicationCluster(c Controllers) []cluster.EndpointDescriptor { + return []cluster.EndpointDescriptor{ + { + Path: "system/application/get_applications", + Inner: true, + Handler: c.Application.GetByIdList, + }, + { + Path: "system/application/get_applications_by_service_id", + Inner: true, + Handler: c.Application.GetByServiceId, + }, + { + Path: "system/application/create_update_application", + Inner: true, + Handler: c.Application.CreateUpdate, + }, + { + Path: "system/application/get_application_by_id", + Inner: true, + Handler: c.Application.GetById, + }, + { + Path: "system/application/delete_applications", + Inner: true, + Handler: c.Application.Delete, + }, + { + Path: "system/application/get_system_tree", + Inner: true, + Handler: c.Application.GetSystemTree, + }, + } +} + +func tokenCluster(c Controllers) []cluster.EndpointDescriptor { + return []cluster.EndpointDescriptor{ + { + Path: "system/token/create_token", + Inner: true, + Handler: c.Token.Create, + }, + { + Path: "system/token/revoke_tokens", + Inner: true, + Handler: c.Token.Revoke, + }, + { + Path: "system/token/revoke_tokens_for_app", + Inner: true, + Handler: c.Token.RevokeForApp, + }, + { + Path: "system/token/get_tokens_by_app_id", + Inner: true, + Handler: c.Token.GetByAppId, + }, + } +} + +func concatCluster(clusters [][]cluster.EndpointDescriptor) []cluster.EndpointDescriptor { + var result []cluster.EndpointDescriptor + for _, c := range clusters { + result = append(result, c...) + } + return result +} From a7feb4e2347ea79451f9fdf6ff5e2f1f32abd8c7 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:18:05 +0400 Subject: [PATCH 26/35] MSP-623 refactoring initialize migration --- migrations/0004_2018-04-27_initialize.go | 190 ++++++++++++++--------- migrations/init.json | 62 -------- 2 files changed, 120 insertions(+), 132 deletions(-) diff --git a/migrations/0004_2018-04-27_initialize.go b/migrations/0004_2018-04-27_initialize.go index 850810f..250889f 100644 --- a/migrations/0004_2018-04-27_initialize.go +++ b/migrations/0004_2018-04-27_initialize.go @@ -1,17 +1,17 @@ package migrations import ( + "context" "database/sql" "encoding/json" "fmt" "io/ioutil" "path/filepath" - "github.com/integration-system/isp-lib/v2/database" - "github.com/integration-system/isp-lib/v2/structure" + "github.com/pkg/errors" "github.com/pressly/goose" - "isp-system-service/controller" "isp-system-service/domain" + "isp-system-service/entity" ) const ( @@ -25,105 +25,155 @@ const ( initFile = "init.json" ) -var DatabaseConfig structure.DBConfiguration - func init() { - goose.AddMigration(Up, Down) + goose.AddMigration(Initialize.Up, Initialize.Down) } -func Up(tx *sql.Tx) error { - path := filepath.Join(database.ResolveMigrationsDirectory(), initFile) +type IRedis interface { + SetApplicationToken(ctx context.Context, req entity.RedisSetToken) error +} + +var Initialize = &initializeMigration{} + +type initializeMigration struct { + redis IRedis + migrationDir string + schema string +} + +type identity struct { + domainId int + appId int + serviceId int +} + +func (i *initializeMigration) SetParams(redis IRedis, migrationDir string, schema string) { + i.redis = redis + i.migrationDir = migrationDir + i.schema = schema +} + +func (i *initializeMigration) Up(tx *sql.Tx) error { + path := filepath.Join(i.migrationDir, initFile) bytes, err := ioutil.ReadFile(path) if err != nil { - return err + return errors.WithMessage(err, "read file") } - var list []domain.DomainWithServices - if err := json.Unmarshal(bytes, &list); err != nil { - return err + list := make([]domain.DomainWithService, 0) + err = json.Unmarshal(bytes, &list) + if err != nil { + return errors.WithMessage(err, "json unmarshal") } - schema := DatabaseConfig.Schema - lastDomainId := int64(0) - lastServiceId := int64(0) - lastAppId := int64(0) + lastDomainId := 0 + lastServiceId := 0 + lastAppId := 0 for _, domainInfo := range list { - domainId := int64(0) - if domainId, err = insertNode(tx, insertDomain, true, schema, domainInfo.Id, domainInfo.Name, domainInfo.Description, 1); err != nil { - return err + last, err := i.insert(tx, domainInfo) + if err != nil { + return errors.WithMessage(err, "") } - if domainId > lastDomainId { - lastDomainId = domainId + if last.domainId > lastDomainId { + lastDomainId = last.domainId } - - for _, service := range domainInfo.Services { - serviceId := int64(0) - if serviceId, err = insertNode(tx, insertService, true, schema, service.Id, service.Name, service.Description, domainId); err != nil { - return err - } - if serviceId > lastServiceId { - lastServiceId = serviceId - } - - for _, app := range service.Apps { - appId := int64(0) - if appId, err = insertNode(tx, insertApp, true, schema, app.Id, app.Name, app.Description, serviceId, app.Type); err != nil { - return err - } - if appId > lastAppId { - lastAppId = appId - } - - for _, t := range app.Tokens { - if _, err := insertNode(tx, insertToken, false, schema, t.Token, appId, t.ExpireTime); err != nil { - return err - } else { - idMap := map[string]interface{}{ - controller.SystemIdentityFieldInDb: 1, - controller.DomainIdentityFieldInDb: domainId, - controller.ServiceIdentityFieldInDb: serviceId, - controller.ApplicationIdentityFieldInDb: appId, - } - if err := controller.Token.SetIdentityMapForTokenV2(t.Token, t.ExpireTime, idMap); err != nil { - return err - } - } - } - } + if last.serviceId > lastServiceId { + lastServiceId = last.serviceId + } + if last.appId > lastAppId { + lastAppId = last.appId } } - if err := setSeq(tx, schema, "domain", lastDomainId); err != nil { - return err - } else if err := setSeq(tx, schema, "service", lastServiceId); err != nil { - return err - } else if err := setSeq(tx, schema, "application", lastAppId); err != nil { - return err + err = i.setSeq(tx, "domain", lastDomainId) + if err != nil { + return errors.WithMessage(err, "set domain") + } + + err = i.setSeq(tx, "service", lastServiceId) + if err != nil { + return errors.WithMessage(err, "set service") + } + + err = i.setSeq(tx, "application", lastAppId) + if err != nil { + return errors.WithMessage(err, "set application") } return nil } -func Down(tx *sql.Tx) error { +func (i *initializeMigration) Down(tx *sql.Tx) error { return nil } -func insertNode(tx *sql.Tx, query string, scan bool, args ...interface{}) (int64, error) { - var id int64 +func (i *initializeMigration) insert(tx *sql.Tx, domainInfo domain.DomainWithService) (*identity, error) { + domainId, err := i.insertNode(tx, insertDomain, true, i.schema, domainInfo.Id, domainInfo.Name, domainInfo.Description, 1) + if err != nil { + return nil, errors.WithMessage(err, "insert domain") + } + + serviceId := 0 + appId := 0 + for _, service := range domainInfo.Services { + serviceId, err = i.insertNode(tx, insertService, true, i.schema, service.Id, service.Name, service.Description, domainId) + if err != nil { + return nil, errors.WithMessage(err, "insert service") + } + + for _, app := range service.Apps { + appId, err = i.insertNode(tx, insertApp, true, i.schema, app.Id, app.Name, app.Description, serviceId, app.Type) + if err != nil { + return nil, errors.WithMessage(err, "insert application") + } + + for _, t := range app.Tokens { + _, err = i.insertNode(tx, insertToken, false, i.schema, t.Token, appId, t.ExpireTime) + if err != nil { + return nil, errors.WithMessage(err, "insert token") + } + + err = i.redis.SetApplicationToken(context.Background(), entity.RedisSetToken{ + Token: t.Token, + ExpireTime: t.ExpireTime, + DomainIdentity: domainId, + ServiceIdentity: serviceId, + ApplicationIdentity: appId, + }) + if err != nil { + return nil, errors.WithMessage(err, "redis set token") + } + } + } + } + + return &identity{ + domainId: domainId, + appId: appId, + serviceId: serviceId, + }, nil +} + +func (i *initializeMigration) insertNode(tx *sql.Tx, query string, scan bool, args ...interface{}) (int, error) { + var id int query = fmt.Sprintf(query, args...) row := tx.QueryRow(query) if scan { - if err := row.Scan(&id); err != nil { - return 0, err + err := row.Scan(&id) + if err != nil { + return 0, errors.WithMessage(err, "row scan") } } return id, nil } -func setSeq(tx *sql.Tx, schema, table string, value int64) error { - q := fmt.Sprintf(setSeqQuery, schema, table, value) +func (i *initializeMigration) setSeq(tx *sql.Tx, table string, value int) error { + q := fmt.Sprintf(setSeqQuery, i.schema, table, value) _, err := tx.Exec(q) + if err != nil { + return errors.WithMessage(err, "exec db") + } - return err + return nil } diff --git a/migrations/init.json b/migrations/init.json index 16ab5e9..5d30e3e 100644 --- a/migrations/init.json +++ b/migrations/init.json @@ -24,67 +24,5 @@ ] } ] - }, - { - "id": 2, - "name": "citymodule", - "description": "", - "services": [ - { - "id": 2, - "name": "citymodule_service", - "description": "", - "apps": [ - { - "id": 2, - "name": "cityservice", - "description": "", - "type": "SYSTEM", - "tokens": [ - { - "token": "{{ isp_service_cityservice_token }}", - "expireTime": -1 - } - ] - }, - { - "id": 3, - "name": "citymodule", - "description": "", - "type": "MOBILE", - "tokens": [ - { - "token": "{{ isp_service_citymodule_token }}", - "expireTime": -1 - } - ] - }, - { - "id": 4, - "name": "cityservice_operator_ui", - "description": "", - "type": "SYSTEM", - "tokens": [ - { - "token": "{{ isp_service_cityservice_operator_ui_token }}", - "expireTime": -1 - } - ] - }, - { - "id": 5, - "name": "cityservice_web_portal", - "description": "", - "type": "SYSTEM", - "tokens": [ - { - "token": "{{ isp_service_cityservice_web_portal_token }}", - "expireTime": -1 - } - ] - } - ] - } - ] } ] From 2863f95a97266e9223507432d033f1b3fbe111d6 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:19:12 +0400 Subject: [PATCH 27/35] MSP-623 update config --- conf/config.yml | 6 ++++++ conf/default_remote_config.json | 23 +++++++---------------- conf/local.go | 10 ++++++++++ conf/local_config.go | 13 ------------- conf/remote.go | 26 ++++++++++++++++++++++++++ conf/remoteConfig.go | 13 ------------- 6 files changed, 49 insertions(+), 42 deletions(-) create mode 100644 conf/local.go delete mode 100644 conf/local_config.go create mode 100644 conf/remote.go delete mode 100644 conf/remoteConfig.go diff --git a/conf/config.yml b/conf/config.yml index de15d36..a100b46 100644 --- a/conf/config.yml +++ b/conf/config.yml @@ -9,3 +9,9 @@ grpcInnerAddress: port: 9005 moduleName: system instanceUuid: 3f4faf30-8482-48ef-931a-b15575a3af1d + +logfile: + path: /var/log/isp-system-service/runtime.log + maxSizeMb: 512 + maxBackups: 4 + compress: true \ No newline at end of file diff --git a/conf/default_remote_config.json b/conf/default_remote_config.json index db16e57..a1de5ea 100644 --- a/conf/default_remote_config.json +++ b/conf/default_remote_config.json @@ -1,12 +1,12 @@ { + "logLevel": "debug", "database": { - "address": "127.0.0.1", - "port": "5432", - "schema": "system_service", - "database": "name", - "username": "name", - "password": "password", - "createSchema": true + "schema": "mdm_service", + "database": "{{ msp_pgsql_name }}", + "password": "{{ msp_pgsql_password }}", + "username": "{{ msp_pgsql_user }}", + "host": "{{ msp_pgsql_address }}", + "port": 5432 }, "redis": { "address": { @@ -15,14 +15,5 @@ }, "defaultDB": 0 }, - "metrics": { - "gc": true, - "memory": true, - "address": { - "ip": "0.0.0.0", - "path": "/metrics", - "port": "9555" - } - }, "applicationSecret": "SECRET_ACCESS_KEY" } \ No newline at end of file diff --git a/conf/local.go b/conf/local.go new file mode 100644 index 0000000..5a55fda --- /dev/null +++ b/conf/local.go @@ -0,0 +1,10 @@ +package conf + +import ( + "github.com/integration-system/isp-kit/bootstrap" +) + +type Local struct { + *bootstrap.LocalConfig + InstanceUuid string +} diff --git a/conf/local_config.go b/conf/local_config.go deleted file mode 100644 index d63a566..0000000 --- a/conf/local_config.go +++ /dev/null @@ -1,13 +0,0 @@ -package conf - -import ( - "github.com/integration-system/isp-lib/v2/config" - "github.com/integration-system/isp-lib/v2/structure" -) - -type Configuration struct { - config.CommonLocalConfig - InstanceUuid string - GrpcOuterAddress structure.AddressConfiguration `valid:"required~Required" json:"grpcOuterAddress"` - GrpcInnerAddress structure.AddressConfiguration `valid:"required~Required" json:"grpcInnerAddress"` -} diff --git a/conf/remote.go b/conf/remote.go new file mode 100644 index 0000000..ca7c20a --- /dev/null +++ b/conf/remote.go @@ -0,0 +1,26 @@ +package conf + +import ( + "reflect" + + "github.com/integration-system/isp-kit/dbx" + "github.com/integration-system/isp-kit/log" + "github.com/integration-system/isp-kit/rc/schema" + "github.com/integration-system/isp-lib/v2/structure" + "github.com/integration-system/jsonschema" +) + +func init() { + schema.CustomGenerators.Register("logLevel", func(field reflect.StructField, t *jsonschema.Type) { + t.Type = "string" + t.Enum = []interface{}{"debug", "info", "error", "fatal"} + }) +} + +type Remote struct { + Database dbx.Config `schema:"Настройка базы данных"` + LogLevel log.Level `schemaGen:"logLevel" schema:"Уровень логирования"` + Redis structure.RedisConfiguration `schema:"Настройка Redis" valid:"required~Required"` + DefaultTokenExpireTime int `schema:"Время жизни токена по умолчанию,время жизни токена в миллисекундах с момента его создания. если = -1 - время жизни неограниченно"` + ApplicationSecret string `schema:"Ключ для подписи application токенов" valid:"required~Required"` +} diff --git a/conf/remoteConfig.go b/conf/remoteConfig.go deleted file mode 100644 index 69781e5..0000000 --- a/conf/remoteConfig.go +++ /dev/null @@ -1,13 +0,0 @@ -package conf - -import ( - "github.com/integration-system/isp-lib/v2/structure" -) - -type RemoteConfig struct { - Database structure.DBConfiguration `schema:"Настройка базы данных"` - Redis structure.RedisConfiguration `schema:"Настройка Redis" valid:"required~Required"` - DefaultTokenExpireTime int64 `schema:"Время жизни токена по умолчанию,время жизни токена в миллисекундах с момента его создания. если = -1 - время жизни неограниченно"` - Metrics structure.MetricConfiguration `schema:"Настройка метрик"` - ApplicationSecret string `schema:"Ключ для подписи application токенов" valid:"required~Required"` -} From 8deb2a2e38b2b939a83c6dd25648b111f021b9a1 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:20:12 +0400 Subject: [PATCH 28/35] MSP-623 add assembly --- assembly/assembly.go | 108 +++++++++++++++++++++++++++++++++++++++++++ assembly/locator.go | 70 ++++++++++++++++++++++++++++ 2 files changed, 178 insertions(+) create mode 100644 assembly/assembly.go create mode 100644 assembly/locator.go diff --git a/assembly/assembly.go b/assembly/assembly.go new file mode 100644 index 0000000..9415cff --- /dev/null +++ b/assembly/assembly.go @@ -0,0 +1,108 @@ +package assembly + +import ( + "context" + + "github.com/integration-system/isp-kit/app" + "github.com/integration-system/isp-kit/bootstrap" + "github.com/integration-system/isp-kit/cluster" + "github.com/integration-system/isp-kit/dbrx" + "github.com/integration-system/isp-kit/dbx" + "github.com/integration-system/isp-kit/grpc" + "github.com/integration-system/isp-kit/log" + rd "github.com/integration-system/isp-lib/v2/redis" + "github.com/pkg/errors" + "isp-system-service/conf" + "isp-system-service/migrations" + "isp-system-service/redis" +) + +type Assembly struct { + boot *bootstrap.Bootstrap + db *dbrx.Client + redis *rd.RxClient + server *grpc.Server + logger *log.Adapter + instanceUuid string +} + +func New(boot *bootstrap.Bootstrap) (*Assembly, error) { + dbCli := dbrx.New(dbx.WithMigration(boot.MigrationsDir)) + server := grpc.NewServer() + + localConfig := conf.Local{} + err := boot.App.Config().Read(&localConfig) + if err != nil { + return nil, errors.WithMessage(err, "read local config") + } + + redisCli := rd.NewRxClient( + rd.WithInitHandler(func(c *rd.Client, err error) { + if err != nil { + boot.App.Logger().Fatal(c.Context(), "redis init", log.Any("err", err)) + } + })) + + return &Assembly{ + boot: boot, + db: dbCli, + redis: redisCli, + server: server, + logger: boot.App.Logger(), + instanceUuid: localConfig.InstanceUuid, + }, nil +} + +func (a *Assembly) ReceiveConfig(ctx context.Context, remoteConfig []byte) error { + var ( + newCfg conf.Remote + prevCfg conf.Remote + ) + err := a.boot.RemoteConfig.Upgrade(remoteConfig, &newCfg, &prevCfg) + if err != nil { + a.logger.Fatal(ctx, errors.WithMessage(err, "upgrade remote config")) + } + + a.redis.ReceiveConfiguration(newCfg.Redis) + redisCli := redis.NewClient(a.instanceUuid, a.redis) + + migrations.Initialize.SetParams(redisCli, a.boot.MigrationsDir, newCfg.Database.Schema) + + a.logger.SetLevel(newCfg.LogLevel) + + err = a.db.Upgrade(ctx, newCfg.Database) + if err != nil { + a.logger.Fatal(ctx, errors.WithMessage(err, "upgrade db client"), log.Any("config", newCfg.Database)) + } + + locator := NewLocator(a.db, redisCli, a.logger) + handler := locator.Handler(newCfg) + a.server.Upgrade(handler) + + return nil +} + +func (a *Assembly) Runners() []app.Runner { + eventHandler := cluster.NewEventHandler(). + RemoteConfigReceiver(a) + return []app.Runner{ + app.RunnerFunc(func(ctx context.Context) error { + return a.server.ListenAndServe(a.boot.BindingAddress) + }), + app.RunnerFunc(func(ctx context.Context) error { + return a.boot.ClusterCli.Run(ctx, eventHandler) + }), + } +} + +func (a *Assembly) Closers() []app.Closer { + return []app.Closer{ + a.boot.ClusterCli, + app.CloserFunc(func() error { + a.server.Shutdown() + return nil + }), + a.redis, + a.db, + } +} diff --git a/assembly/locator.go b/assembly/locator.go new file mode 100644 index 0000000..522e2f2 --- /dev/null +++ b/assembly/locator.go @@ -0,0 +1,70 @@ +package assembly + +import ( + "github.com/integration-system/isp-kit/db" + "github.com/integration-system/isp-kit/grpc/endpoint" + "github.com/integration-system/isp-kit/grpc/isp" + "github.com/integration-system/isp-kit/log" + "isp-system-service/conf" + "isp-system-service/controller" + "isp-system-service/redis" + "isp-system-service/repository" + "isp-system-service/routes" + "isp-system-service/service" + "isp-system-service/transaction" +) + +type DB interface { + db.DB + db.Transactional +} + +type Locator struct { + db DB + redis redis.Client + logger log.Logger +} + +func NewLocator(db DB, redisCli redis.Client, logger log.Logger) Locator { + return Locator{ + db: db, + redis: redisCli, + logger: logger, + } +} + +func (l Locator) Handler(cfg conf.Remote) isp.BackendServiceServer { + txManager := transaction.NewManager(l.db) + accessListRep := repository.NewAccessList(l.db) + applicationRep := repository.NewApplication(l.db) + domainRep := repository.NewDomain(l.db) + serviceRep := repository.NewService(l.db) + tokenRep := repository.NewToken(l.db) + + accessListService := service.NewAccessList(l.redis, txManager, accessListRep, applicationRep) + applicationService := service.NewApplication(l.redis, txManager, applicationRep, domainRep, serviceRep, tokenRep) + domainService := service.NewDomain(domainRep) + serviceService := service.NewService(domainRep, serviceRep) + + jwtService := service.NewJwt(cfg.ApplicationSecret) + tokenService := service.NewToken(l.redis, cfg.DefaultTokenExpireTime, jwtService, applicationService, txManager, + applicationRep, domainRep, serviceRep, tokenRep, + ) + + accessListController := controller.NewAccessList(accessListService) + applicationController := controller.NewApplication(applicationService) + domainController := controller.NewDomain(domainService) + serviceController := controller.NewService(serviceService) + tokenController := controller.NewToken(tokenService) + + c := routes.Controllers{ + AccessList: accessListController, + Domain: domainController, + Service: serviceController, + Application: applicationController, + Token: tokenController, + } + mapper := endpoint.DefaultWrapper(l.logger, endpoint.BodyLogger(l.logger)) + server := routes.Handler(mapper, c) + return server +} From 9b8432bb4c6da4b54520ff4f897adec006c61681 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:21:24 +0400 Subject: [PATCH 29/35] MSP-623 update go mod --- go.mod | 86 ++++++- go.sum | 759 ++++++++++++++++++++++++++++++--------------------------- 2 files changed, 480 insertions(+), 365 deletions(-) diff --git a/go.mod b/go.mod index 3f2a7e5..832861e 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,87 @@ module isp-system-service -go 1.16 +go 1.17 require ( + github.com/integration-system/isp-kit v1.7.0 + github.com/integration-system/jsonschema v1.0.1 + github.com/pkg/errors v0.9.1 +) + +require ( + github.com/KyleBanks/depth v1.2.1 // indirect + github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/fsnotify/fsnotify v1.5.3 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.20.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/iancoleman/strcase v0.2.0 // indirect + github.com/integration-system/bellows v1.0.1 // indirect + github.com/integration-system/go-cmp v0.0.0-20190131081942-ac5582987a2f // indirect + github.com/integration-system/isp-etp-go/v2 v2.1.3 // indirect + github.com/jackc/chunkreader/v2 v2.0.1 // indirect + github.com/jackc/pgconn v1.12.0 // indirect + github.com/jackc/pgio v1.0.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgproto3/v2 v2.3.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect + github.com/jackc/pgtype v1.11.0 // indirect + github.com/jackc/pgx/v4 v4.16.0 // indirect + github.com/jmoiron/sqlx v1.3.5 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.15.1 // indirect + github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect + github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/magiconair/properties v1.8.6 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect + github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/cast v1.4.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.11.0 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + github.com/swaggo/swag v1.7.0 // indirect + go.opentelemetry.io/otel v0.19.0 // indirect + go.opentelemetry.io/otel/metric v0.19.0 // indirect + go.opentelemetry.io/otel/trace v0.19.0 // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.8.0 // indirect + go.uber.org/zap v1.21.0 // indirect + golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect + golang.org/x/net v0.0.0-20220421235706-1d1ef9303861 // indirect + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect + golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/genproto v0.0.0-20220422154200-b37d22cd5731 // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/ini.v1 v1.66.4 // indirect + gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + nhooyr.io/websocket v1.8.7 // indirect +) + +require ( + github.com/BurntSushi/toml v1.1.0 // indirect + github.com/Masterminds/squirrel v1.5.2 + github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/dgrijalva/jwt-go v3.2.0+incompatible - github.com/go-pg/pg/v9 v9.2.1 + github.com/go-openapi/spec v0.20.5 // indirect + github.com/go-openapi/swag v0.21.1 // indirect github.com/go-redis/redis/v8 v8.8.2 - github.com/integration-system/isp-lib/v2 v2.8.7 - github.com/integration-system/isp-log v1.1.8 - github.com/pressly/goose v2.6.0+incompatible - google.golang.org/grpc v1.38.0 + github.com/integration-system/isp-lib/v2 v2.10.0 + github.com/mailru/easyjson v0.7.7 // indirect + github.com/pressly/goose v2.7.0+incompatible + golang.org/x/tools v0.1.10 // indirect + google.golang.org/grpc v1.46.0 ) diff --git a/go.sum b/go.sum index 7b1a119..2dda8b0 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,7 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -15,18 +16,32 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -36,70 +51,54 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/Azure/azure-sdk-for-go v51.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= -github.com/Azure/go-autorest/autorest/validation v0.3.1/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I= +github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/sketches-go v0.0.0-20190923095040-43f19ad77ff7/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= -github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/squirrel v1.5.2 h1:UiOEi2ZX4RCSkpiNDQN5kro/XIBpSRk9iTqdIRPzUXE= +github.com/Masterminds/squirrel v1.5.2/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.1 h1:KqhlKozYbRtJvsPrrEeXcO+N2l6NYT5A2QAFmSULpEc= github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 h1:EFSB7Zo9Eg91v7MJPVsifUysc/wPdN+NOnVe6bWbdBM= -github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg= +github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asaskevich/govalidator v0.0.0-20180315120708-ccb8e960c48f h1:y2hSFdXeA1y5z5f0vfNO0Dg5qVY036qzlz3Pds0B92o= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20180315120708-ccb8e960c48f/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aws/aws-sdk-go v1.29.9/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= -github.com/benbjohnson/clock v1.0.0/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/buaazp/fasthttprouter v0.1.1 h1:4oAnN0C3xZjylvZJdP35cxfclyn4TYkW6Y+DSvS+h8Q= github.com/buaazp/fasthttprouter v0.1.1/go.mod h1:h/Ap5oRVLeItGKTVBb+heQPks+HdIUtGmI4H5WCYijM= -github.com/cenkalti/backoff/v4 v4.0.0/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= -github.com/cenkalti/backoff/v4 v4.0.2/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= -github.com/cenkalti/backoff/v4 v4.1.0 h1:c8LkOFQTzuO0WBM/ae5HdGQuZPfPxp7lqBRwQRm4fSc= github.com/cenkalti/backoff/v4 v4.1.0/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -109,23 +108,26 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/codemodus/kace v0.5.1 h1:4OCsBlE2c/rSJo375ggfnucv9eRzge/U5LrrOZd47HA= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/codemodus/kace v0.5.1/go.mod h1:coddaHoX1ku1YFSe4Ip0mL9kQjJvKkzb9CfIdG1YR04= -github.com/containerd/containerd v1.4.4 h1:rtRG4N6Ct7GNssATwgpvMGfnjnwfjnu/Zs9W3Ikzq+M= -github.com/containerd/containerd v1.4.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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= @@ -135,110 +137,79 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.13.1/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.5+incompatible h1:o5WL5onN4awYGwrW7+oTn5x9AF2prw7V0Ox8ZEkoCdg= -github.com/docker/docker v20.10.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dop251/goja v0.0.0-20201221183957-6b6d5e2b5d80/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= -github.com/dop251/goja v0.0.0-20210427212725-462d53687b0d/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +github.com/fsnotify/fsnotify v1.5.3 h1:vNFpj2z7YIbwh2bw7x35sqYpp2wfuq+pivKbWG09B8c= +github.com/fsnotify/fsnotify v1.5.3/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/gzip v0.0.1/go.mod h1:fGBJBCdt6qCZuCAOwWuFhBB4OOq9EFqlo5dEaFhhu5w= -github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.3.0/go.mod h1:7cKuhb5qV2ggCFctp2fJQ+ErvciLZrIeoOSOm6mUr7Y= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/go-chi/chi v4.0.2+incompatible h1:maB6vn6FqCxrpz4FqWdh4+lwpyZIQS7YEAUcHlgXVRs= github.com/go-chi/chi v4.0.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.4/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.9/go.mod h1:vqK/dIdLGCosfvYsQV3WfC7N3TiZSnGY2RZKoFK7X28= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= github.com/go-openapi/spec v0.19.14/go.mod h1:gwrgJS15eCUgjLpMjBJmbZezCsw88LmgeEip0M63doA= -github.com/go-openapi/spec v0.20.0 h1:HGLc8AJ7ynOxwv0Lq4TsnwLsWMawHAYiJIFzbcML86I= github.com/go-openapi/spec v0.20.0/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFutcFKaVbmU= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/spec v0.20.5 h1:skHa8av4VnAtJU5zyAUXrrdK/NDiVX8lchbG+BfcdrE= +github.com/go-openapi/spec v0.20.5/go.mod h1:QbfOSIVt3/sac+a1wzmKbbcLXm5NdZnyBZYtCijp43o= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= github.com/go-openapi/swag v0.19.11/go.mod h1:Uc0gKkdR+ojzsEpjh39QChyu92vPgIr72POcgHMAgSY= -github.com/go-openapi/swag v0.19.12 h1:Bc0bnY2c3AoF7Gc+IMIAQQsD8fLHjHpc19wXvYuayQI= github.com/go-openapi/swag v0.19.12/go.mod h1:eFdyEBkTdoAf/9RXBvj4cr1nH7GD8Kzo5HTt47gr72M= -github.com/go-pg/pg/v9 v9.0.0-beta.14/go.mod h1:T2Sr6bpTCOr2lUqOUMiXLMJqZHSUBKk1LdgSqjwhZfA= -github.com/go-pg/pg/v9 v9.0.3/go.mod h1:Tm/Q3Vt6gdQOH6TTN1H/xLlIXc+Qrka7TZ6uREtu/eA= -github.com/go-pg/pg/v9 v9.1.4/go.mod h1:QM13HBLkdml4zcKOfUfGLymM6hb72aKTJLrmaH8rsFg= -github.com/go-pg/pg/v9 v9.1.5/go.mod h1:QM13HBLkdml4zcKOfUfGLymM6hb72aKTJLrmaH8rsFg= -github.com/go-pg/pg/v9 v9.1.7/go.mod h1:QM13HBLkdml4zcKOfUfGLymM6hb72aKTJLrmaH8rsFg= -github.com/go-pg/pg/v9 v9.2.1 h1:4rWNJkj+aPuDFqgieTzNhHBuYaXREh3yaB9NlBerFys= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU= +github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-pg/pg/v9 v9.2.1/go.mod h1:fG8qbL+ei4e/fCZLHK+Z+/7b9B+pliZtbpaucG4/YNQ= -github.com/go-pg/urlstruct v0.1.0/go.mod h1:2Nag+BIny6G/KYCkdt++ZnqU/VinzimGapKfs4kwlN0= -github.com/go-pg/urlstruct v0.2.6/go.mod h1:dxENwVISWSOX+k87hDt0ueEJadD+gZWv3tHzwfmZPu8= -github.com/go-pg/urlstruct v0.3.0/go.mod h1:/XKyiUOUUS3onjF+LJxbfmSywYAdl6qMfVbX33Q8rgg= -github.com/go-pg/zerochecker v0.1.1/go.mod h1:NJZ4wKL0NmTtz0GKCoJ8kym6Xn/EQzXRl2OnAe7MmDo= -github.com/go-pg/zerochecker v0.2.0 h1:pp7f72c3DobMWOb2ErtZsnrPaSvHd2W4o9//8HtF4mU= github.com/go-pg/zerochecker v0.2.0/go.mod h1:NJZ4wKL0NmTtz0GKCoJ8kym6Xn/EQzXRl2OnAe7MmDo= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= -github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-redis/redis/v8 v8.0.0-beta.2/go.mod h1:o1M7JtsgfDYyv3o+gBn/jJ1LkqpnCrmil7PSppZGBak= -github.com/go-redis/redis/v8 v8.4.4/go.mod h1:nA0bQuF0i5JFx4Ta9RZxGKXFrQ8cRWntra97f0196iY= +github.com/go-playground/validator/v10 v10.9.0 h1:NgTtmN58D0m8+UuxtYmGztBJB7VnPgjj221I1QHci2A= +github.com/go-playground/validator/v10 v10.9.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-redis/redis/v8 v8.8.2 h1:O/NcHqobw7SEptA0yA6up6spZVFtwE06SXM8rgLtsP8= github.com/go-redis/redis/v8 v8.8.2/go.mod h1:F7resOH5Kdug49Otu24RjHWwgK7u9AmtqWMnCV1iP5Y= +github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= @@ -247,16 +218,15 @@ github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -265,6 +235,7 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 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= @@ -283,7 +254,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -296,12 +267,15 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -311,177 +285,216 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v0.9.1/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.16.0 h1:uCeOEwSWGMwhJUdpUjk+1cVKIEfGu2/1nFXukimi2MU= github.com/hashicorp/go-hclog v0.16.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= -github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/raft v1.1.1/go.mod h1:vPAJM8Asw6u8LxC3eJCUZmRP/E4QmUGE1R7g7k8sG/8= -github.com/hashicorp/raft v1.1.2 h1:oxEL5DDeurYxLd3UbcY/hccgSPhLLpiBZ1YxtWEq59c= -github.com/hashicorp/raft v1.1.2/go.mod h1:vPAJM8Asw6u8LxC3eJCUZmRP/E4QmUGE1R7g7k8sG/8= -github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea/go.mod h1:pNv7Wc3ycL6F5oOWn+tPGo2gWD4a5X+yp/ntwdKLjRk= +github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/integration-system/bellows v0.0.0-20190821124023-244325e8836c/go.mod h1:6cf4ZNvtzZ/KMiuc+d5Y7rSHjzlYBWEqbVyDfUDhqIE= -github.com/integration-system/bellows v1.0.0/go.mod h1:qHPg1ptN3AHHr0f/wvoicfA2LOCprOyrbXnIa5QIRe0= github.com/integration-system/bellows v1.0.1 h1:7g1lhD/6EcvsSo9iuiFqw98XGS78Sko6kUKPzfte/SY= github.com/integration-system/bellows v1.0.1/go.mod h1:qHPg1ptN3AHHr0f/wvoicfA2LOCprOyrbXnIa5QIRe0= -github.com/integration-system/cony v0.3.0 h1:wSDrThUe7JdI1kUo1PBQ+TdYcGkrPzfbV01bBC6mpbQ= -github.com/integration-system/cony v0.3.0/go.mod h1:3DTgNOKVMPhFyI0CD85HlIfeP29x3h7hAK0XLsg4mww= -github.com/integration-system/go-amqp v0.12.8/go.mod h1:ALB2VeQh/HXN/2Nk0XClCbsL30yT+6y0qKRRZg3D9FM= -github.com/integration-system/go-amqp v0.13.61/go.mod h1:8zftwPfjfeIw2XncclRoV4MuQb4v0xs30jpnpcwCiuw= github.com/integration-system/go-cmp v0.0.0-20190131081942-ac5582987a2f h1:52UOJguw5yqe1y2JjmyVxGcZf3kv2BQeUodR363MkiQ= github.com/integration-system/go-cmp v0.0.0-20190131081942-ac5582987a2f/go.mod h1:w+dmaWojuIwNujSYg6qt1wKHhSdorLOivCEl/XuLzbM= github.com/integration-system/gowsdl v1.0.0/go.mod h1:ZwTCE+Av5aQLnPj2/3PIop6mzCs1FY7jXrcWDvSjrBA= -github.com/integration-system/isp-etp-go/v2 v2.1.1/go.mod h1:Ndq5DMM3sDJjZn4cyKKvZrVED0FMeoXMRWHZTq+2Z1o= -github.com/integration-system/isp-etp-go/v2 v2.1.2/go.mod h1:fSkS09/engepaDDqaDAEeXUpzmtcMpSLjilZ35BfNcc= +github.com/integration-system/grmq v1.1.0/go.mod h1:hdiknZZJsTzoXxx5mZMGJGrQTIHHD9tZgGnk22e98Us= github.com/integration-system/isp-etp-go/v2 v2.1.3 h1:vcHP/PE7p1G3rxqoVKrKtXzoSxFA4ryxigd+zPkAb3w= github.com/integration-system/isp-etp-go/v2 v2.1.3/go.mod h1:ZpB+FIH3hy7md+f8ylVSQx5zwZVjczhkc45f1B2z9nw= -github.com/integration-system/isp-event-lib v1.6.0/go.mod h1:lCzAci6oS+vc51W8EfHVCh9p3p057r0DpMuY4T0lSj0= -github.com/integration-system/isp-event-lib v1.6.1/go.mod h1:5ZIXsMG3gC7sfQ+eICjkDpy2RSvSAxV3Cq1BVN8LFIk= -github.com/integration-system/isp-event-lib v1.6.5 h1:cHjQmp5Y48sbVgpF0sCE05INq9m1jh7vh+23Aersrns= -github.com/integration-system/isp-event-lib v1.6.5/go.mod h1:gQg0S8TMeISIkTLM9/DwgWwnpS3BUkNFjgByRg3+Ub0= -github.com/integration-system/isp-lib-test v1.5.4/go.mod h1:rD+X0QMiOIeJDhqwB4avdYhnc1hoEkL4z+7C7lwTuOA= -github.com/integration-system/isp-lib-test v1.6.0/go.mod h1:If5QK5jsXE48DZuq6WzCw8yC22k7GogLrEnMngXiE2Y= -github.com/integration-system/isp-lib-test v1.6.4 h1:5n2Srk9pjAUqllYMxWid3yaJIiejLfZj2rN70AzZa5o= -github.com/integration-system/isp-lib-test v1.6.4/go.mod h1:k8DiXG/Bx3k8cft0QI/+BTRsL/43effW5575udzWv1M= -github.com/integration-system/isp-lib/v2 v2.4.0/go.mod h1:hxyzKBD7eIf6Hm4x6zRsLW5p8m/aFeqeezKMFYBAtho= -github.com/integration-system/isp-lib/v2 v2.6.2/go.mod h1:ZGW7qQsCuELBHRBnSSDSEonPx+FxAfHiAfwsGQZzVO4= -github.com/integration-system/isp-lib/v2 v2.8.4/go.mod h1:bKFyatmLqEkaQWJjww0R1Dz+cRn8T7YSaf4VrROgeTw= -github.com/integration-system/isp-lib/v2 v2.8.7 h1:g6/pdcBwhWo89V8oSQzm/rqa3dG2arp/XXPATxcRfBc= -github.com/integration-system/isp-lib/v2 v2.8.7/go.mod h1:bJKlQ2vVrJt3n88Icdsp5gbUScihtBuddAapxUfFTaQ= -github.com/integration-system/isp-log v1.1.2/go.mod h1:VVMr3cHW+RuFurPUSeVz71KUnOGQxogxO5atV9N8ISs= -github.com/integration-system/isp-log v1.1.5/go.mod h1:VVMr3cHW+RuFurPUSeVz71KUnOGQxogxO5atV9N8ISs= -github.com/integration-system/isp-log v1.1.6/go.mod h1:TpUZ/Tx84sRipAT/YXZ8V7Z21C4iZ8o3wXQs3Cee0Pk= -github.com/integration-system/isp-log v1.1.8 h1:LqyuQmTVvUo+hyhz2mkSU36upRK8Q1oq9UtVv7YQ5Rw= +github.com/integration-system/isp-kit v1.7.0 h1:wd9lIvTHiFM139McR4CCQ1LcrNooHfY/ZL5bu7hSUdQ= +github.com/integration-system/isp-kit v1.7.0/go.mod h1:Js7AypcB7sKz2uE4yYskKu8TQ0wF2MlFpWGowG2UdN4= +github.com/integration-system/isp-lib/v2 v2.10.0 h1:rMOVfMYndEmX1hf6Y10aMGhSzzC7/FxlEkGQ+3iNKUE= +github.com/integration-system/isp-lib/v2 v2.10.0/go.mod h1:Uz79/zcx4BNq4LpTBY2GoJR83WJDy2TZhYrmQAY0R+k= github.com/integration-system/isp-log v1.1.8/go.mod h1:xSYA6TY/N45lFYSDwhoOW96Q/4it0nufG0yQDA2BNy8= -github.com/integration-system/jsonschema v1.0.0/go.mod h1:EoqDH7RmC8Epg5EgjboIxDo7Udv3WX2exGqtIVB4hI0= github.com/integration-system/jsonschema v1.0.1 h1:nR78BEDG9djX2uXQ1YP66a/9yQOMmp2HFmw8VPUdAa8= github.com/integration-system/jsonschema v1.0.1/go.mod h1:EoqDH7RmC8Epg5EgjboIxDo7Udv3WX2exGqtIVB4hI0= -github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.12.0 h1:/RvQ24k3TnNdfBSW0ou9EOi5jx2cX7zfE8n2nLKuiP0= +github.com/jackc/pgconn v1.12.0/go.mod h1:ZkhRC59Llhrq3oSfrikvwQ5NaxYExr6twkdkMLaKono= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.3.0 h1:brH0pCGBDkBW07HWlN/oSBXrmo3WB0UvZd1pIuDcL8Y= +github.com/jackc/pgproto3/v2 v2.3.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.11.0 h1:u4uiGPz/1hryuXzyaBhSk6dnIyyG2683olG2OV+UUgs= +github.com/jackc/pgtype v1.11.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.16.0 h1:4k1tROTJctHotannFYzu77dY3bgtMRymQP7tXQjqpPk= +github.com/jackc/pgx/v4 v4.16.0/go.mod h1:N0A9sFdWzkw/Jy1lwoiB64F2+ugFZi987zRxcPez/wI= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= +github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -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/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -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/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.10.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.8 h1:difgzQsp5mdAz9v8lm3P/I+EpDKMU/6uTMw1y1FObuo= github.com/klauspost/compress v1.11.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.15.1 h1:y9FcTHGyrebwfP0ZZqFiaxTaiDnUrGkJkI+f583BL1A= +github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= 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/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= 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/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= +github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw= +github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= +github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= +github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.1 h1:6VXZrLU0jHBYyAqrSPa+MgPfnSvTPuMgK+k0o5kVFWo= -github.com/lib/pq v1.10.1/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.3 h1:v9QZf2Sn6AmjXtQeFpdoq/eaNtYP6IN+7lcrygsIAtg= +github.com/lib/pq v1.10.3/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= +github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= @@ -489,147 +502,111 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2 h1:+RB5hMpXUUA2dfxuhBTEkMOrYmM+gKIZYS1KjSostMI= -github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/nats-server/v2 v2.1.4/go.mod h1:Jw1Z28soD/QasIA2uWjXyM9El1jly3YwyFOuR8tH1rg= -github.com/nats-io/nats-server/v2 v2.1.7/go.mod h1:rbRrRE/Iv93O/rUvZ9dh4NfT0Cm9HWjW/BqOWLGgYiE= -github.com/nats-io/nats-server/v2 v2.1.8 h1:d5GoJA6W7vQkmt99Nfdeie3pEFFUEjIwt1YZp50DkIQ= -github.com/nats-io/nats-server/v2 v2.1.8/go.mod h1:rbRrRE/Iv93O/rUvZ9dh4NfT0Cm9HWjW/BqOWLGgYiE= -github.com/nats-io/nats-streaming-server v0.17.0/go.mod h1:ewPBEsmp62Znl3dcRsYtlcfwudxHEdYMtYqUQSt4fE0= -github.com/nats-io/nats-streaming-server v0.18.0 h1:+RDozeN9scwCm0Wc2fYlvGcP144hvxvSOtxZ8FE21ME= -github.com/nats-io/nats-streaming-server v0.18.0/go.mod h1:Y9Aiif2oANuoKazQrs4wXtF3jqt6p97ODQg68lR5TnY= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nats.go v1.10.0/go.mod h1:AjGArbfyR50+afOUotNX2Xs5SYHf+CoOa5HH1eEl2HE= -github.com/nats-io/nats.go v1.11.0 h1:L263PZkrmkRJRJT2YHU8GwWWvEvmr9/LUKuJTXsF32k= -github.com/nats-io/nats.go v1.11.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.4/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= -github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= -github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= -github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nats-io/stan.go v0.6.0/go.mod h1:eIcD5bi3pqbHT/xIIvXMwvzXYElgouBvaVRftaE+eac= -github.com/nats-io/stan.go v0.7.0/go.mod h1:Ci6mUIpGQTjl++MqK2XzkWI/0vF+Bl72uScx7ejSYmU= -github.com/nats-io/stan.go v0.8.3 h1:XyemjL9vAeGHooHn5RQy+ngljd8AVSM2l65Jdnpv4rI= -github.com/nats-io/stan.go v0.8.3/go.mod h1:Ejm8bbHnMTSptU6uNMAVuxeapMJYBB/Ml3ej6z4GoSY= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olivere/elastic v6.2.29+incompatible/go.mod h1:J+q1zQJTgAz9woqsbVRqGeB5G1iqDKVBWLNSYW8yfJ8= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ= github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= -github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opentracing/opentracing-go v1.1.1-0.20190913142402-a7454ce5950e/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.0.0-beta.8 h1:dy81yyLYJDwMTifq24Oi/IslOslRrDSb3jwDggjz3Z0= +github.com/pelletier/go-toml/v2 v2.0.0-beta.8/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/pressly/goose v2.6.0+incompatible h1:3f8zIQ8rfgP9tyI0Hmcs2YNAqUCL1c+diLe3iU8Qd/k= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/pressly/goose v2.6.0+incompatible/go.mod h1:m+QHWCqxR3k8D9l7qfzuC/djtlfzxr34mozWDYEu1z8= -github.com/profefe/profefe v0.0.0-20200307211836-5ab457f7a4d8 h1:9lI6rm0yjyeB6Q5zE/SytxlNDgRQ1thnRZGQChtsLRs= +github.com/pressly/goose v2.7.0+incompatible h1:PWejVEv07LCerQEzMMeAtjuyCKbyprZ/LBa6K5P0OCQ= +github.com/pressly/goose v2.7.0+incompatible/go.mod h1:m+QHWCqxR3k8D9l7qfzuC/djtlfzxr34mozWDYEu1z8= github.com/profefe/profefe v0.0.0-20200307211836-5ab457f7a4d8/go.mod h1:QOlABo1QFtwVrB7Rdl8gwY9pqxmln8lIWOQEW1oj1uI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.0.9 h1:DksSrntiTPE63NQuxGcFa1OS/odKfwJu3PJHrhKAy7Q= github.com/prometheus/procfs v0.0.9/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563 h1:dY6ETXrvDG7Sa4vE8ZQG4yqWg6UnOcbqTAahkV813vQ= +github.com/rabbitmq/amqp091-go v1.2.0/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM= +github.com/rabbitmq/amqp091-go v1.3.4/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM= github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.2.2-0.20200205151950-d13a6085d55c/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= +github.com/sagikazarmark/crypt v0.5.0/go.mod h1:l+nzl7KWh51rpzp2h7t4MZWyiEWdhNpOAnclKvg+mdA= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/segmentio/encoding v0.1.10/go.mod h1:RWhr02uzMB9gQC1x+MfYxedtmBibb9cZ6Vv9VxRSSbw= -github.com/segmentio/encoding v0.1.15 h1:btgfyAuFo3uLw7eOrRDPo8H4Bc881+bSPHzAEe0ukho= github.com/segmentio/encoding v0.1.15/go.mod h1:RWhr02uzMB9gQC1x+MfYxedtmBibb9cZ6Vv9VxRSSbw= -github.com/segmentio/kafka-go v0.4.9/go.mod h1:BVDwBTF24avtlj4l8/xsWNb4papVeg16+jO6/0qjvhA= -github.com/segmentio/kafka-go v0.4.10/go.mod h1:BVDwBTF24avtlj4l8/xsWNb4papVeg16+jO6/0qjvhA= -github.com/segmentio/kafka-go v0.4.16/go.mod h1:19+Eg7KwrNKy/PFhiIthEPkO8k+ac7/ZYXwYM9Df10w= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.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/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= +github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= @@ -638,14 +615,9 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.6.3/go.mod h1:jUMtyi0/lB5yZH/FjyGAoH7IMNrIhlBf6pXZmbMDvzw= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/streadway/amqp v0.0.0-20200108173154-1c71cc93ed71/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= -github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/spf13/viper v1.11.0 h1:7OX/1FS6n7jHD1zGrZTM7WtY13ZELRyosK4k93oPr44= +github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUsX7Zk= 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/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -654,71 +626,42 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14 h1:PyYN9JH5jY9j6av01SpfRMb+1DWg/i3MbGOKPxJ2wjM= github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14/go.mod h1:gxQT6pBGRuIGunNf/+tSOB5OHvguWi8Tbt82WOkf35E= -github.com/swaggo/gin-swagger v1.2.0/go.mod h1:qlH2+W7zXGZkczuL+r2nEBR2JTT+/lX05Nn6vPhc7OI= -github.com/swaggo/http-swagger v0.0.0-20200308142732-58ac5e232fba/go.mod h1:O1lAbCgAAX/KZ80LM/OXwtWFI/5TvZlwxSg8Cq08PV0= -github.com/swaggo/http-swagger v1.0.0 h1:ksYgVBCYmAaxFsGVGojlPROgYfiQQSllETTWMtHJHTo= github.com/swaggo/http-swagger v1.0.0/go.mod h1:cKIcshBU9yEAnfWv6ZzVKSsEf8h5ozxB8/zHQWyOQ/8= -github.com/swaggo/swag v1.5.1/go.mod h1:1Bl9F/ZBpVWh22nY0zmYyASPO1lI/zIwRDrpZU+tv8Y= -github.com/swaggo/swag v1.6.3/go.mod h1:wcc83tB4Mb2aNiL/HP4MFeQdpHUrca+Rp/DRNgWAUio= -github.com/swaggo/swag v1.6.7/go.mod h1:xDhTyuFIujYiN3DKWC/H/83xcfHp+UE/IzWWampG7Zc= github.com/swaggo/swag v1.7.0 h1:5bCA/MTLQoIqDXXyHfOpMeDvL9j68OY/udlK4pQoo4E= github.com/swaggo/swag v1.7.0/go.mod h1:BdPIL73gvS9NBsdi7M1JOxLvlbfvNRaBP8m6WT6Aajo= -github.com/thecodeteam/goodbye v0.0.0-20170927022442-a83968bda2d3/go.mod h1:ehwM4AFY4byYSorQbigh79cKUOUNL3pAOz5eCAQNlGI= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.5-pre/go.mod h1:FwP/aQVg39TXzItUBMwnWp9T9gPQnXw4Poh4/oBQZ/0= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181022190402-e5e69e061d4f/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.5-pre/go.mod h1:tULtS6Gy1AE1yCENaw4Vb//HLH5njI2tfCQDUqRd8fI= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.9.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasthttp v1.16.0/go.mod h1:YOKImeEosDdBPnxc0gy7INqi3m1zK6A+xl6TwOBhHCA= -github.com/valyala/fasthttp v1.18.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8ermTRJNroD7A= -github.com/valyala/fasthttp v1.24.0 h1:AAiG4oLDUArTb7rYf9oO2bkGooOqCaUF6a2u8asBP3I= github.com/valyala/fasthttp v1.24.0/go.mod h1:0mw2RjXGOzxf4NL2jni3gUQ7LfjjUSiG5sskOUUSEpU= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/vmihailenco/bufpool v0.1.5/go.mod h1:fL9i/PRTuS7AELqAHwSU1Zf1c70xhkhGe/cD5ud9pJk= -github.com/vmihailenco/bufpool v0.1.11 h1:gOq2WmBrq0i2yW5QJ16ykccQ4wH9UyEsgLm6czKAd94= github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ= -github.com/vmihailenco/msgpack/v4 v4.3.5/go.mod h1:DuaveEe48abshDmz5UBKyZ+yDugvaeFk5ayfrewUOaw= -github.com/vmihailenco/msgpack/v4 v4.3.7/go.mod h1:Ii+PksJlvFT5ZRcB/4YLAInMIp6a0WOCm0L3BU0aNG4= -github.com/vmihailenco/msgpack/v4 v4.3.11/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= -github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= -github.com/vmihailenco/tagparser v0.1.0/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/api/v3 v3.5.2/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/pkg/v3 v3.5.2/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.etcd.io/etcd/client/v2 v2.305.2/go.mod h1:2D7ZejHVMIfog1221iLSYlQRzrtECw3kz4I4VAQm3qI= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -726,8 +669,6 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/otel v0.5.0/go.mod h1:jzBIgIzK43Iu1BpDAXwqOd6UPsSAk+ewVZ5ofSXw4Ek= -go.opentelemetry.io/otel v0.15.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA= go.opentelemetry.io/otel v0.19.0 h1:Lenfy7QHRXPZVsw/12CWpxX6d/JkrX8wrx2vO8G80Ng= go.opentelemetry.io/otel v0.19.0/go.mod h1:j9bF567N9EfomkSidSfmMwIwIBuP37AMAIzVW85OxSg= go.opentelemetry.io/otel/metric v0.19.0 h1:dtZ1Ju44gkJkYvo+3qGqVXmf88tc+a42edOywypengg= @@ -736,41 +677,53 @@ go.opentelemetry.io/otel/oteltest v0.19.0 h1:YVfA0ByROYqTwOxqHVZYZExzEpfZor+MU1r go.opentelemetry.io/otel/oteltest v0.19.0/go.mod h1:tI4yxwh8U21v7JD6R3BcA/2+RBoTKFexE/PJ/nSO7IA= go.opentelemetry.io/otel/trace v0.19.0 h1:1ucYlenXIDA1OlHVLDZKX0ObXV5RLaq06DtUKz5e5zc= go.opentelemetry.io/otel/trace v0.19.0/go.mod h1:4IXiNextNOpPnRlI4ryK69mn5iC84bjBWZQA5DXz/qg= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= +go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/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-20190506204251-e1dfcc566284/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191029031824-8986dd9e96cf/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20191128160524-b544559bb6d1/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200206161412-a0c6ece9d31a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b h1:wSOdpTq0/eI46Ez/LkDwIsAKA71YP2SRKBODiRWM0as= -golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -805,37 +758,32 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190420063019-afa5a82059c6/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/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190611141213-3f473d35a33a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222033325-078779b8f2d8/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -845,23 +793,33 @@ golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201016165138-7b1cca2348c0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201207224615-747e23833adb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226101413-39120d07d75e/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220421235706-1d1ef9303861 h1:yssD99+7tqHWO5Gwh81phT+67hg+KttniBr6UnEXOY8= +golang.org/x/net v0.0.0-20220421235706-1d1ef9303861/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= 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/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -874,6 +832,15 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -884,37 +851,35 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/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-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/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190523142557-0e01d883c5c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190610200419-93c9922d18ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -922,6 +887,7 @@ golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -931,15 +897,11 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -947,16 +909,42 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210507014357-30e306a8bba5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 h1:xHms4gcpe1YE7A3yIllJXP16CMAGuqwO2lX1mTyyRRc= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 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= @@ -964,14 +952,13 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/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= @@ -979,16 +966,15 @@ golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3 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-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 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-20190606050223-4d9ae51c2468/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190611222205-d73e1c7e250b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1002,6 +988,7 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1022,7 +1009,6 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200826040757-bc8aaaa29e06/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201120155355-20be4ac4bd6e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1032,14 +1018,23 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f h1:GGU+dLjvlC3qDwqYgL6UgRmHXhOOgns0bZu2Ty5mm6U= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1062,13 +1057,27 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 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= @@ -1078,8 +1087,6 @@ google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191009194640-548a555dbc03/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= @@ -1087,14 +1094,12 @@ google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200211111953-2dc5924e3898/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200413115906-b5235f65be36/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -1109,19 +1114,49 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220422154200-b37d22cd5731 h1:nquqdM9+ps0JZcIiI70+tqoaIFS5Ql4ZuK8UXnz3HfE= +google.golang.org/genproto v0.0.0-20220422154200-b37d22cd5731/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= 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.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 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.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -1137,8 +1172,18 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5 google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0 h1:oCjezcn6g6A75TGoKYBPgKmVBLexhYLM6MebdrPApP8= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1150,8 +1195,10 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 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= @@ -1161,19 +1208,19 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= +gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= 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= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1183,8 +1230,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= 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= @@ -1193,11 +1238,7 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.2/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -mellium.im/sasl v0.2.1 h1:nspKSRg7/SyO0cRGY71OkfHab8tf9kCts6a6oTDut0w= mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ= -nhooyr.io/websocket v1.7.4/go.mod h1:PxYxCwFdFYQ0yRvtQz3s/dC+VEm7CSuC/4b9t8MQQxw= -nhooyr.io/websocket v1.8.4/go.mod h1:LiqdCg1Cu7TPWxEvPjPa0TGYxCsy4pHNTN9gGluwBpQ= -nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= From 9c1fc8743032f05375e78a638abfa2d4c8e972b5 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:21:45 +0400 Subject: [PATCH 30/35] MSP-623 update gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5386965..73fbb5a 100644 --- a/.gitignore +++ b/.gitignore @@ -71,5 +71,6 @@ fabric.properties /vendor/ google/ package.json -structure/ yarn.lock + +conf/config_dev.yml From f40b91a4310d2599f3d77df4e0103c6a5b9cc444 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:22:31 +0400 Subject: [PATCH 31/35] MSP-623 update linter --- .golangci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index a63b7d0..1a49ba0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -18,7 +18,6 @@ linters: - goprintffuncname - gosimple - govet - - maligned - nakedret - nestif - nolintlint @@ -38,8 +37,6 @@ linters: - exportloopref #for _,p := []int{1, 2, 3} { s.Bar(&p) /* If s stores the pointer, it will be bug.*/ } - sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed. linters-settings: - maligned: - suggest-new: true funlen: lines: 80 statements: 40 @@ -58,6 +55,7 @@ linters-settings: disabled-checks: - hugeParam - rangeValCopy + - ifElseChain exhaustive: default-signifies-exhaustive: true From ce75f8933cc55404135c7da4e2f942b4e8538bf8 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:22:50 +0400 Subject: [PATCH 32/35] MSP-623 update main --- main.go | 107 ++++++++++++++------------------------------------------ 1 file changed, 27 insertions(+), 80 deletions(-) diff --git a/main.go b/main.go index dfa3e1b..8c939cd 100644 --- a/main.go +++ b/main.go @@ -1,28 +1,19 @@ package main import ( - "context" - "os" - - "github.com/integration-system/isp-lib/v2/backend" - "github.com/integration-system/isp-lib/v2/bootstrap" - "github.com/integration-system/isp-lib/v2/config/schema" - "github.com/integration-system/isp-lib/v2/metric" - "github.com/integration-system/isp-lib/v2/structure" - log "github.com/integration-system/isp-log" - "github.com/integration-system/isp-log/stdcodes" + "github.com/integration-system/isp-kit/bootstrap" + "github.com/integration-system/isp-kit/shutdown" + "isp-system-service/assembly" "isp-system-service/conf" - _ "isp-system-service/docs" - "isp-system-service/helper" - "isp-system-service/migrations" - "isp-system-service/model" - "isp-system-service/redis" + "isp-system-service/routes" ) -var version = "0.1.0" +var ( + version = "1.0.0" +) -// @title ISP system service -// @version 1.1.2 +// @title isp-system-service +// @version 1.0.0 // @description Сервис управления реестром внешних приложений и токенами аутентификации // @license.name GNU GPL v3.0 @@ -33,70 +24,26 @@ var version = "0.1.0" //go:generate swag init --parseDependency //go:generate rm -f docs/swagger.json func main() { - bootstrap. - ServiceBootstrap(&conf.Configuration{}, &conf.RemoteConfig{}). - OnLocalConfigLoad(onLocalConfigLoad). - DefaultRemoteConfigPath(schema.ResolveDefaultConfigPath("default_remote_config.json")). - SocketConfiguration(socketConfiguration). - DeclareMe(routesData). - OnRemoteConfigReceive(onRemoteConfigReceive). - OnShutdown(onShutdown). - OnSocketErrorReceive(onRemoteErrorReceive). - OnConfigErrorReceive(onRemoteConfigErrorReceive). - SubscribeBroadcastEvent(bootstrap.ListenRestartEvent()). - Run() -} + boot := bootstrap.New(version, conf.Remote{}, routes.EndpointDescriptors()) + app := boot.App + logger := app.Logger() -func onRemoteErrorReceive(errorMessage map[string]interface{}) { - log.WithMetadata(errorMessage).Error(stdcodes.ReceiveErrorFromConfig, "error from config service") -} + assembly, err := assembly.New(boot) + if err != nil { + logger.Fatal(app.Context(), err) + } + app.AddRunners(assembly.Runners()...) + app.AddClosers(assembly.Closers()...) -func onRemoteConfigErrorReceive(errorMessage string) { - log.WithMetadata(map[string]interface{}{ - "message": errorMessage, - }).Error(stdcodes.ReceiveErrorOnGettingConfigFromConfig, "error on getting remote configuration") -} + shutdown.On(func() { + logger.Info(app.Context(), "starting shutdown") + app.Shutdown() + logger.Info(app.Context(), "shutdown completed") + }) -func socketConfiguration(cfg interface{}) structure.SocketConfiguration { - appConfig := cfg.(*conf.Configuration) - - return structure.SocketConfiguration{ - Host: appConfig.ConfigServiceAddress.IP, - Port: appConfig.ConfigServiceAddress.Port, - Secure: false, - UrlParams: map[string]string{ - "module_name": appConfig.ModuleName, - }, - } -} - -func onShutdown(_ context.Context, _ os.Signal) { - backend.StopGrpcServer() - _ = model.DbClient.Close() - redis.Client.Close() -} - -func onRemoteConfigReceive(remoteConfig, oldConfig *conf.RemoteConfig) { - migrations.DatabaseConfig = remoteConfig.Database - redis.Client.ReceiveConfiguration(remoteConfig.Redis) - model.DbClient.ReceiveConfiguration(remoteConfig.Database) - metric.InitCollectors(remoteConfig.Metrics, oldConfig.Metrics) - metric.InitHttpServer(remoteConfig.Metrics) -} - -func onLocalConfigLoad(cfg *conf.Configuration) { - handlers := helper.GetAllHandlers() - service := backend.GetDefaultService(cfg.ModuleName, handlers...) - backend.StartBackendGrpcServer(cfg.GrpcInnerAddress, service) -} - -func routesData(localConfig interface{}) bootstrap.ModuleInfo { - cfg := localConfig.(*conf.Configuration) - - return bootstrap.ModuleInfo{ - ModuleName: cfg.ModuleName, - ModuleVersion: version, - GrpcOuterAddress: cfg.GrpcOuterAddress, - Handlers: helper.GetAllHandlers(), + err = app.Run() + if err != nil { + app.Shutdown() + logger.Fatal(app.Context(), err) } } From 1a90f502189b8f7895f73d05ded034e16d5b0fed Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 18:32:33 +0400 Subject: [PATCH 33/35] MSP-623 remove log code --- log_code/code.go | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 log_code/code.go diff --git a/log_code/code.go b/log_code/code.go deleted file mode 100644 index 2c7122f..0000000 --- a/log_code/code.go +++ /dev/null @@ -1,6 +0,0 @@ -package log_code - -const ( - ErrorDatabaseClient = 801 - ErrorRedisClient = 802 -) From ceeb2f03be99f0197a1cc2bdcf045503ff1f667f Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:22:58 +0400 Subject: [PATCH 34/35] MSP-623 update swagger --- docs/docs.go | 692 ++++++++++++++++++---------------------------- docs/swagger.yaml | 487 ++++++++++++++------------------ 2 files changed, 473 insertions(+), 706 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index b49ec60..37da07e 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,12 +1,8 @@ -// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// This file was generated by swaggo/swag at -// 2020-09-21 17:04:25.146581 +0300 MSK m=+89.051194375 - +// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT +// This file was generated by swaggo/swag package docs -import ( - "github.com/integration-system/isp-lib/v2/docs" -) +import "github.com/integration-system/isp-lib/v2/docs" var doc = `{ "schemes": {{ marshal .Schemes }}, @@ -83,14 +79,14 @@ var doc = `{ "tags": [ "accessList" ], - "summary": "Настройть доступность списка методов для приложения", + "summary": "Настроить доступность списка методов для приложения", "parameters": [ { "description": "объект настройки доступа", "name": "body", "in": "body", "schema": { - "$ref": "#/definitions/domain.SetListRequest" + "$ref": "#/definitions/domain.AccessListSetListRequest" } } ], @@ -121,7 +117,7 @@ var doc = `{ }, "/access_list/set_one": { "post": { - "description": "Возвращает количество изменных строк", + "description": "Возвращает количество измененных строк", "consumes": [ "application/json" ], @@ -138,7 +134,7 @@ var doc = `{ "name": "body", "in": "body", "schema": { - "$ref": "#/definitions/entity.AccessList" + "$ref": "#/definitions/domain.AccessListSetOneRequest" } } ], @@ -146,7 +142,7 @@ var doc = `{ "200": { "description": "количество измененных строк", "schema": { - "$ref": "#/definitions/domain.CountResponse" + "$ref": "#/definitions/domain.AccessListSetOneResponse" } }, "404": { @@ -184,7 +180,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/entity.Application" + "$ref": "#/definitions/domain.ApplicationCreateUpdateRequest" } } ], @@ -192,7 +188,7 @@ var doc = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.AppWithToken" + "$ref": "#/definitions/domain.ApplicationWithTokens" } }, "400": { @@ -298,7 +294,7 @@ var doc = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.AppWithToken" + "$ref": "#/definitions/domain.ApplicationWithTokens" } }, "400": { @@ -354,7 +350,7 @@ var doc = `{ "schema": { "type": "array", "items": { - "$ref": "#/definitions/domain.AppWithToken" + "$ref": "#/definitions/domain.ApplicationWithTokens" } } }, @@ -369,7 +365,7 @@ var doc = `{ }, "/application/get_applications_by_service_id": { "post": { - "description": "Возвращает список приложений по запрошенныму идентификатору сервиса", + "description": "Возвращает список приложений по запрошенному идентификатору сервиса", "consumes": [ "application/json" ], @@ -382,7 +378,7 @@ var doc = `{ "summary": "Получить список приложений по идентификатору сервиса", "parameters": [ { - "description": "Идентификатор серсиса", + "description": "Идентификатор сервиса", "name": "body", "in": "body", "required": true, @@ -397,7 +393,7 @@ var doc = `{ "schema": { "type": "array", "items": { - "$ref": "#/definitions/domain.AppWithToken" + "$ref": "#/definitions/domain.ApplicationWithTokens" } } }, @@ -429,7 +425,7 @@ var doc = `{ "schema": { "type": "array", "items": { - "$ref": "#/definitions/domain.DomainWithServices" + "$ref": "#/definitions/domain.DomainWithService" } } }, @@ -462,7 +458,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/entity.Domain" + "$ref": "#/definitions/domain.DomainCreateUpdateRequest" } } ], @@ -470,7 +466,7 @@ var doc = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/entity.Domain" + "$ref": "#/definitions/domain.Domain" } }, "500": { @@ -558,7 +554,7 @@ var doc = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/entity.Domain" + "$ref": "#/definitions/domain.Domain" } }, "404": { @@ -605,7 +601,7 @@ var doc = `{ "schema": { "type": "array", "items": { - "$ref": "#/definitions/entity.Domain" + "$ref": "#/definitions/domain.Domain" } } }, @@ -638,7 +634,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/entity.Service" + "$ref": "#/definitions/domain.ServiceCreateUpdateRequest" } } ], @@ -646,7 +642,7 @@ var doc = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/entity.Service" + "$ref": "#/definitions/domain.Service" } }, "400": { @@ -757,7 +753,7 @@ var doc = `{ "schema": { "type": "array", "items": { - "$ref": "#/definitions/entity.Service" + "$ref": "#/definitions/domain.Service" } } }, @@ -798,7 +794,7 @@ var doc = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/entity.Service" + "$ref": "#/definitions/domain.Service" } }, "404": { @@ -846,198 +842,7 @@ var doc = `{ "schema": { "type": "array", "items": { - "$ref": "#/definitions/entity.Service" - } - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/structure.GrpcError" - } - } - } - } - }, - "/system/create_update_system": { - "post": { - "description": "Если система с такими идентификатором существует, то обновляет данные, если нет, то добавляет данные в базу", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "system" - ], - "summary": "Создать/обновить систему", - "parameters": [ - { - "description": "Объект системы", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.System" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/entity.System" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/structure.GrpcError" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/structure.GrpcError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/structure.GrpcError" - } - } - } - } - }, - "/system/delete_systems": { - "post": { - "description": "Удаляет системы по списку их идентификаторов, возвращает количество удаленных систем", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "system" - ], - "summary": "Удалить системы", - "parameters": [ - { - "description": "Массив идентификаторов систем", - "name": "body", - "in": "body", - "schema": { - "type": "array", - "items": { - "type": "integer" - } - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.DeleteResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/structure.GrpcError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/structure.GrpcError" - } - } - } - } - }, - "/system/get_system_by_id": { - "post": { - "description": "Возвращает описание системы по ее идентификатору", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "system" - ], - "summary": "Получить систему по идентификатору", - "parameters": [ - { - "description": "Идентификатор системы", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/domain.Identity" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/entity.System" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/structure.GrpcError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/structure.GrpcError" - } - } - } - } - }, - "/system/get_systems": { - "post": { - "description": "Возвращает список систем по их идентификаторам", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "system" - ], - "summary": "Получить список систем", - "parameters": [ - { - "description": "Массив идентификаторов систем", - "name": "body", - "in": "body", - "schema": { - "type": "array", - "items": { - "type": "integer" - } - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.System" + "$ref": "#/definitions/domain.Service" } } }, @@ -1052,7 +857,7 @@ var doc = `{ }, "/token/create_token": { "post": { - "description": "Созддает токен и привязывает его к приложению", + "description": "Создает токен и привязывает его к приложению", "consumes": [ "application/json" ], @@ -1070,7 +875,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/domain.CreateTokenRequest" + "$ref": "#/definitions/domain.TokenCreateRequest" } } ], @@ -1078,7 +883,7 @@ var doc = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.AppWithToken" + "$ref": "#/definitions/domain.ApplicationWithTokens" } }, "500": { @@ -1102,7 +907,7 @@ var doc = `{ "tags": [ "token" ], - "summary": "Получить токены по идентификаотру приложения", + "summary": "Получить токены по идентификатору приложения", "parameters": [ { "description": "Идентификатор приложения", @@ -1135,7 +940,7 @@ var doc = `{ }, "/token/revoke_tokens": { "post": { - "description": "Отвязывает токены от приложений и удялет их", + "description": "Отвязывает токены от приложений и удаляет их", "consumes": [ "application/json" ], @@ -1153,7 +958,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/domain.RevokeTokensRequest" + "$ref": "#/definitions/domain.TokenRevokeRequest" } } ], @@ -1161,7 +966,7 @@ var doc = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.AppWithToken" + "$ref": "#/definitions/domain.ApplicationWithTokens" } }, "500": { @@ -1215,30 +1020,7 @@ var doc = `{ } }, "definitions": { - "domain.AppWithToken": { - "type": "object", - "properties": { - "app": { - "type": "object", - "$ref": "#/definitions/entity.Application" - }, - "tokens": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.Token" - } - } - } - }, - "domain.CountResponse": { - "type": "object", - "properties": { - "count": { - "type": "integer" - } - } - }, - "domain.CreateTokenRequest": { + "domain.AccessListSetListRequest": { "type": "object", "required": [ "appId" @@ -1247,8 +1029,132 @@ var doc = `{ "appId": { "type": "integer" }, - "expireTimeMs": { + "methods": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.MethodInfo" + } + }, + "removeOld": { + "type": "boolean" + } + } + }, + "domain.AccessListSetOneRequest": { + "type": "object", + "required": [ + "appId", + "method" + ], + "properties": { + "appId": { "type": "integer" + }, + "method": { + "type": "string" + }, + "value": { + "type": "boolean" + } + } + }, + "domain.AccessListSetOneResponse": { + "type": "object", + "properties": { + "count": { + "type": "integer" + } + } + }, + "domain.Application": { + "type": "object", + "properties": { + "createdAt": { + "type": "string" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "serviceId": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + } + }, + "domain.ApplicationCreateUpdateRequest": { + "type": "object", + "required": [ + "name", + "serviceId", + "type" + ], + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "serviceId": { + "type": "integer" + }, + "type": { + "type": "string", + "enum": [ + "SYSTEM", + "MOBILE" + ] + } + } + }, + "domain.ApplicationSimple": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "tokens": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Token" + } + }, + "type": { + "type": "string" + } + } + }, + "domain.ApplicationWithTokens": { + "type": "object", + "properties": { + "app": { + "$ref": "#/definitions/domain.Application" + }, + "tokens": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Token" + } } } }, @@ -1260,7 +1166,47 @@ var doc = `{ } } }, - "domain.DomainWithServices": { + "domain.Domain": { + "type": "object", + "properties": { + "createdAt": { + "type": "string" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "systemId": { + "type": "integer" + }, + "updatedAt": { + "type": "string" + } + } + }, + "domain.DomainCreateUpdateRequest": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "domain.DomainWithService": { "type": "object", "properties": { "description": { @@ -1302,164 +1248,8 @@ var doc = `{ } } }, - "domain.RevokeTokensRequest": { + "domain.Service": { "type": "object", - "required": [ - "appId" - ], - "properties": { - "appId": { - "type": "integer" - }, - "tokens": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "domain.ServiceWithApps": { - "type": "object", - "properties": { - "apps": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.SimpleApp" - } - }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - } - } - }, - "domain.SetListRequest": { - "type": "object", - "properties": { - "appId": { - "type": "integer" - }, - "methods": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.MethodInfo" - } - }, - "removeOld": { - "type": "boolean" - } - } - }, - "domain.SimpleApp": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "tokens": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.Token" - } - }, - "type": { - "type": "string" - } - } - }, - "entity.AccessList": { - "type": "object", - "properties": { - "appId": { - "type": "integer" - }, - "method": { - "type": "string" - }, - "value": { - "type": "boolean" - } - } - }, - "entity.Application": { - "type": "object", - "required": [ - "name", - "serviceId", - "type" - ], - "properties": { - "createdAt": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "serviceId": { - "type": "integer" - }, - "type": { - "type": "string", - "enum": [ - "SYSTEM", - "MOBILE" - ] - }, - "updatedAt": { - "type": "string" - } - } - }, - "entity.Domain": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "createdAt": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "systemId": { - "type": "integer" - }, - "updatedAt": { - "type": "string" - } - } - }, - "entity.Service": { - "type": "object", - "required": [ - "domainId", - "name" - ], "properties": { "createdAt": { "type": "string" @@ -1481,15 +1271,36 @@ var doc = `{ } } }, - "entity.System": { + "domain.ServiceCreateUpdateRequest": { "type": "object", "required": [ + "domainId", "name" ], "properties": { - "createdAt": { + "description": { "type": "string" }, + "domainId": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "domain.ServiceWithApps": { + "type": "object", + "properties": { + "apps": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ApplicationSimple" + } + }, "description": { "type": "string" }, @@ -1498,18 +1309,59 @@ var doc = `{ }, "name": { "type": "string" + } + } + }, + "domain.Token": { + "type": "object", + "properties": { + "appId": { + "type": "integer" }, - "updatedAt": { + "createdAt": { "type": "string" + }, + "expireTime": { + "type": "integer" + }, + "token": { + "type": "string" + } + } + }, + "domain.TokenCreateRequest": { + "type": "object", + "required": [ + "appId" + ], + "properties": { + "appId": { + "type": "integer" + }, + "expireTimeMs": { + "type": "integer" + } + } + }, + "domain.TokenRevokeRequest": { + "type": "object", + "required": [ + "appId" + ], + "properties": { + "appId": { + "type": "integer" + }, + "tokens": { + "type": "array", + "items": { + "type": "string" + } } } }, "entity.Token": { "type": "object", - "required": [ - "appId", - "token" - ], "properties": { "appId": { "type": "integer" @@ -1547,11 +1399,11 @@ var doc = `{ // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = docs.SwaggerInfo{ - Version: "1.1.2", - Host: "localhost:9003", + Version: "1.0.0", + Host: "localhost:9000", BasePath: "/api/system", Schemes: []string{}, - Title: "ISP system service", + Title: "isp-system-service", Description: "Сервис управления реестром внешних приложений и токенами аутентификации", } diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 31e9335..0360d05 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,35 +1,128 @@ basePath: /api/system definitions: - domain.AppWithToken: + domain.AccessListSetListRequest: properties: - app: - $ref: '#/definitions/entity.Application' - type: object - tokens: + appId: + type: integer + methods: items: - $ref: '#/definitions/entity.Token' + $ref: '#/definitions/domain.MethodInfo' type: array + removeOld: + type: boolean + required: + - appId type: object - domain.CountResponse: + domain.AccessListSetOneRequest: + properties: + appId: + type: integer + method: + type: string + value: + type: boolean + required: + - appId + - method + type: object + domain.AccessListSetOneResponse: properties: count: type: integer type: object - domain.CreateTokenRequest: + domain.Application: properties: - appId: + createdAt: + type: string + description: + type: string + id: type: integer - expireTimeMs: + name: + type: string + serviceId: type: integer + type: + type: string + updatedAt: + type: string + type: object + domain.ApplicationCreateUpdateRequest: + properties: + description: + type: string + id: + type: integer + name: + type: string + serviceId: + type: integer + type: + enum: + - SYSTEM + - MOBILE + type: string required: - - appId + - name + - serviceId + - type + type: object + domain.ApplicationSimple: + properties: + description: + type: string + id: + type: integer + name: + type: string + tokens: + items: + $ref: '#/definitions/domain.Token' + type: array + type: + type: string + type: object + domain.ApplicationWithTokens: + properties: + app: + $ref: '#/definitions/domain.Application' + tokens: + items: + $ref: '#/definitions/domain.Token' + type: array type: object domain.DeleteResponse: properties: deleted: type: integer type: object - domain.DomainWithServices: + domain.Domain: + properties: + createdAt: + type: string + description: + type: string + id: + type: integer + name: + type: string + systemId: + type: integer + updatedAt: + type: string + type: object + domain.DomainCreateUpdateRequest: + properties: + description: + type: string + id: + type: integer + name: + type: string + required: + - name + type: object + domain.DomainWithService: properties: description: type: string @@ -56,107 +149,7 @@ definitions: value: type: boolean type: object - domain.RevokeTokensRequest: - properties: - appId: - type: integer - tokens: - items: - type: string - type: array - required: - - appId - type: object - domain.ServiceWithApps: - properties: - apps: - items: - $ref: '#/definitions/domain.SimpleApp' - type: array - description: - type: string - id: - type: integer - name: - type: string - type: object - domain.SetListRequest: - properties: - appId: - type: integer - methods: - items: - $ref: '#/definitions/domain.MethodInfo' - type: array - removeOld: - type: boolean - type: object - domain.SimpleApp: - properties: - description: - type: string - id: - type: integer - name: - type: string - tokens: - items: - $ref: '#/definitions/entity.Token' - type: array - type: - type: string - type: object - entity.AccessList: - properties: - appId: - type: integer - method: - type: string - value: - type: boolean - type: object - entity.Application: - properties: - createdAt: - type: string - description: - type: string - id: - type: integer - name: - type: string - serviceId: - type: integer - type: - enum: - - SYSTEM - - MOBILE - type: string - updatedAt: - type: string - required: - - name - - serviceId - - type - type: object - entity.Domain: - properties: - createdAt: - type: string - description: - type: string - id: - type: integer - name: - type: string - systemId: - type: integer - updatedAt: - type: string - required: - - name - type: object - entity.Service: + domain.Service: properties: createdAt: type: string @@ -170,24 +163,64 @@ definitions: type: string updatedAt: type: string + type: object + domain.ServiceCreateUpdateRequest: + properties: + description: + type: string + domainId: + type: integer + id: + type: integer + name: + type: string required: - domainId - name type: object - entity.System: + domain.ServiceWithApps: properties: - createdAt: - type: string + apps: + items: + $ref: '#/definitions/domain.ApplicationSimple' + type: array description: type: string id: type: integer name: type: string - updatedAt: + type: object + domain.Token: + properties: + appId: + type: integer + createdAt: type: string + expireTime: + type: integer + token: + type: string + type: object + domain.TokenCreateRequest: + properties: + appId: + type: integer + expireTimeMs: + type: integer required: - - name + - appId + type: object + domain.TokenRevokeRequest: + properties: + appId: + type: integer + tokens: + items: + type: string + type: array + required: + - appId type: object entity.Token: properties: @@ -199,9 +232,6 @@ definitions: type: integer token: type: string - required: - - appId - - token type: object structure.GrpcError: properties: @@ -214,20 +244,21 @@ definitions: errorMessage: type: string type: object -host: localhost:9003 +host: localhost:9000 info: contact: {} description: Сервис управления реестром внешних приложений и токенами аутентификации license: name: GNU GPL v3.0 - title: ISP system service - version: 1.1.2 + title: isp-system-service + version: 1.0.0 paths: /access_list/get_by_id: post: consumes: - application/json - description: Возвращает список методов для приложения, для которых заданы настройки доступа + description: Возвращает список методов для приложения, для которых заданы настройки + доступа parameters: - description: идентификатор приложения in: body @@ -258,13 +289,14 @@ paths: post: consumes: - application/json - description: Возвращает список методов для приложения, для которых заданы настройки доступа + description: Возвращает список методов для приложения, для которых заданы настройки + доступа parameters: - description: объект настройки доступа in: body name: body schema: - $ref: '#/definitions/domain.SetListRequest' + $ref: '#/definitions/domain.AccessListSetListRequest' produces: - application/json responses: @@ -282,27 +314,27 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/structure.GrpcError' - summary: Настройть доступность списка методов для приложения + summary: Настроить доступность списка методов для приложения tags: - accessList /access_list/set_one: post: consumes: - application/json - description: Возвращает количество изменных строк + description: Возвращает количество измененных строк parameters: - description: объект для настройки доступа in: body name: body schema: - $ref: '#/definitions/entity.AccessList' + $ref: '#/definitions/domain.AccessListSetOneRequest' produces: - application/json responses: "200": description: количество измененных строк schema: - $ref: '#/definitions/domain.CountResponse' + $ref: '#/definitions/domain.AccessListSetOneResponse' "404": description: Not Found schema: @@ -318,21 +350,22 @@ paths: post: consumes: - application/json - description: Если приложение с такими идентификатором существует, то обновляет данные, если нет, то добавляет данные в базу + description: Если приложение с такими идентификатором существует, то обновляет + данные, если нет, то добавляет данные в базу parameters: - description: Объект приложения in: body name: body required: true schema: - $ref: '#/definitions/entity.Application' + $ref: '#/definitions/domain.ApplicationCreateUpdateRequest' produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/domain.AppWithToken' + $ref: '#/definitions/domain.ApplicationWithTokens' "400": description: Bad Request schema: @@ -356,7 +389,8 @@ paths: post: consumes: - application/json - description: Удаляет приложения по списку их идентификаторов, возвращает количество удаленных приложений + description: Удаляет приложения по списку их идентификаторов, возвращает количество + удаленных приложений parameters: - description: Массив идентификаторов приложений in: body @@ -401,7 +435,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.AppWithToken' + $ref: '#/definitions/domain.ApplicationWithTokens' "400": description: Bad Request schema: @@ -437,7 +471,7 @@ paths: description: OK schema: items: - $ref: '#/definitions/domain.AppWithToken' + $ref: '#/definitions/domain.ApplicationWithTokens' type: array "500": description: Internal Server Error @@ -450,9 +484,9 @@ paths: post: consumes: - application/json - description: Возвращает список приложений по запрошенныму идентификатору сервиса + description: Возвращает список приложений по запрошенному идентификатору сервиса parameters: - - description: Идентификатор серсиса + - description: Идентификатор сервиса in: body name: body required: true @@ -465,7 +499,7 @@ paths: description: OK schema: items: - $ref: '#/definitions/domain.AppWithToken' + $ref: '#/definitions/domain.ApplicationWithTokens' type: array "500": description: Internal Server Error @@ -486,7 +520,7 @@ paths: description: OK schema: items: - $ref: '#/definitions/domain.DomainWithServices' + $ref: '#/definitions/domain.DomainWithService' type: array "500": description: Internal Server Error @@ -499,21 +533,22 @@ paths: post: consumes: - application/json - description: Если домен с такими идентификатором существует, то обновляет данные, если нет, то добавляет данные в базу + description: Если домен с такими идентификатором существует, то обновляет данные, + если нет, то добавляет данные в базу parameters: - description: Объект домена in: body name: body required: true schema: - $ref: '#/definitions/entity.Domain' + $ref: '#/definitions/domain.DomainCreateUpdateRequest' produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/entity.Domain' + $ref: '#/definitions/domain.Domain' "500": description: Internal Server Error schema: @@ -525,7 +560,8 @@ paths: post: consumes: - application/json - description: Удаляет домены по списку их идентификаторов, возвращает количество удаленных доменов + description: Удаляет домены по списку их идентификаторов, возвращает количество + удаленных доменов parameters: - description: Массив идентификаторов доменов in: body @@ -570,7 +606,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/entity.Domain' + $ref: '#/definitions/domain.Domain' "404": description: Not Found schema: @@ -600,7 +636,7 @@ paths: description: OK schema: items: - $ref: '#/definitions/entity.Domain' + $ref: '#/definitions/domain.Domain' type: array "500": description: Internal Server Error @@ -613,21 +649,22 @@ paths: post: consumes: - application/json - description: Если сервис с такими идентификатором существует, то обновляет данные, если нет, то добавляет данные в базу + description: Если сервис с такими идентификатором существует, то обновляет данные, + если нет, то добавляет данные в базу parameters: - description: Объект сервиса in: body name: body required: true schema: - $ref: '#/definitions/entity.Service' + $ref: '#/definitions/domain.ServiceCreateUpdateRequest' produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/entity.Service' + $ref: '#/definitions/domain.Service' "400": description: Bad Request schema: @@ -651,7 +688,8 @@ paths: post: consumes: - application/json - description: Удаляет сервисов по списку их идентификаторов, возвращает количество удаленных сервисов + description: Удаляет сервисов по списку их идентификаторов, возвращает количество + удаленных сервисов parameters: - description: Массив идентификаторов сервисов in: body @@ -699,7 +737,7 @@ paths: description: OK schema: items: - $ref: '#/definitions/entity.Service' + $ref: '#/definitions/domain.Service' type: array "500": description: Internal Server Error @@ -726,7 +764,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/entity.Service' + $ref: '#/definitions/domain.Service' "404": description: Not Found schema: @@ -757,7 +795,7 @@ paths: description: OK schema: items: - $ref: '#/definitions/entity.Service' + $ref: '#/definitions/domain.Service' type: array "500": description: Internal Server Error @@ -766,149 +804,25 @@ paths: summary: Получить список сервисов по идентификатору домена tags: - service - /system/create_update_system: - post: - consumes: - - application/json - description: Если система с такими идентификатором существует, то обновляет данные, если нет, то добавляет данные в базу - parameters: - - description: Объект системы - in: body - name: body - required: true - schema: - $ref: '#/definitions/entity.System' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/entity.System' - "404": - description: Not Found - schema: - $ref: '#/definitions/structure.GrpcError' - "409": - description: Conflict - schema: - $ref: '#/definitions/structure.GrpcError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/structure.GrpcError' - summary: Создать/обновить систему - tags: - - system - /system/delete_systems: - post: - consumes: - - application/json - description: Удаляет системы по списку их идентификаторов, возвращает количество удаленных систем - parameters: - - description: Массив идентификаторов систем - in: body - name: body - schema: - items: - type: integer - type: array - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/domain.DeleteResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/structure.GrpcError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/structure.GrpcError' - summary: Удалить системы - tags: - - system - /system/get_system_by_id: - post: - consumes: - - application/json - description: Возвращает описание системы по ее идентификатору - parameters: - - description: Идентификатор системы - in: body - name: body - required: true - schema: - $ref: '#/definitions/domain.Identity' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/entity.System' - "404": - description: Not Found - schema: - $ref: '#/definitions/structure.GrpcError' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/structure.GrpcError' - summary: Получить систему по идентификатору - tags: - - system - /system/get_systems: - post: - consumes: - - application/json - description: Возвращает список систем по их идентификаторам - parameters: - - description: Массив идентификаторов систем - in: body - name: body - schema: - items: - type: integer - type: array - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/entity.System' - type: array - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/structure.GrpcError' - summary: Получить список систем - tags: - - system /token/create_token: post: consumes: - application/json - description: Созддает токен и привязывает его к приложению + description: Создает токен и привязывает его к приложению parameters: - description: Объект создания токена in: body name: body required: true schema: - $ref: '#/definitions/domain.CreateTokenRequest' + $ref: '#/definitions/domain.TokenCreateRequest' produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/domain.AppWithToken' + $ref: '#/definitions/domain.ApplicationWithTokens' "500": description: Internal Server Error schema: @@ -941,28 +855,28 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/structure.GrpcError' - summary: Получить токены по идентификаотру приложения + summary: Получить токены по идентификатору приложения tags: - token /token/revoke_tokens: post: consumes: - application/json - description: Отвязывает токены от приложений и удялет их + description: Отвязывает токены от приложений и удаляет их parameters: - description: Объект отзыва токенов in: body name: body required: true schema: - $ref: '#/definitions/domain.RevokeTokensRequest' + $ref: '#/definitions/domain.TokenRevokeRequest' produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/domain.AppWithToken' + $ref: '#/definitions/domain.ApplicationWithTokens' "500": description: Internal Server Error schema: @@ -974,7 +888,8 @@ paths: post: consumes: - application/json - description: Отвязывает токены от приложений и удаляет их по идентификатору приложения + description: Отвязывает токены от приложений и удаляет их по идентификатору + приложения parameters: - description: Идентификатор приложения in: body From b139590408effef3bc2db4c893fc169031b5112c Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Fri, 22 Apr 2022 17:23:21 +0400 Subject: [PATCH 35/35] MSP-623 up version --- .version | 2 +- CHANGELOG.md | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.version b/.version index b539ade..56fea8a 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.2.7 \ No newline at end of file +3.0.0 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f4fa64f..ebe96c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +### v3.0.0 +* migrate to isp-kit +* split domain and entity structs +* prepare to remove system block + * remove CRUD for system + * use default system_id +* remove migration initializing city_module +* unite requests to redis into one directory + * prepare to remove redis +* update go to 1.17 ### v2.2.7 * updated dependencies * migrated to common local config