From ba1d51b1699f0a83b5d24ad1cf263b3ac1de4398 Mon Sep 17 00:00:00 2001 From: nirav-rafay Date: Thu, 24 Mar 2022 23:28:13 +0530 Subject: [PATCH 1/3] rebasing with fixes for ui --- .../proto/rpc/system/metro.swagger.json | 4 +- .../proto/rpc/system/partner.swagger.json | 31 ++ .../proto/rpc/system/project.swagger.json | 61 ++++ gen/openapi/proto/rpc/user/group.swagger.json | 5 + gen/openapi/proto/rpc/user/user.swagger.json | 5 + internal/dao/group.go | 9 +- internal/dao/project.go | 53 ++++ internal/dao/user.go | 2 +- main.go | 17 +- pkg/service/apikey.go | 4 +- pkg/service/cluster.go | 5 +- pkg/service/partner.go | 44 +++ pkg/service/project.go | 263 +++++++++++++++- pkg/service/project_test.go | 42 +++ pkg/service/user.go | 91 +++++- pkg/sso/saml/middleware.go | 5 +- pkg/sso/saml/saml.go | 5 +- proto/rpc/sentry/bootstrap.pb.gw.go | 38 +-- proto/rpc/system/metro.pb.go | 158 +++++----- proto/rpc/system/metro.pb.gw.go | 30 +- proto/rpc/system/metro.proto | 10 +- proto/rpc/system/partner.pb.go | 106 ++++++- proto/rpc/system/partner.pb.gw.go | 65 ++++ proto/rpc/system/partner.proto | 9 + proto/rpc/system/partner_grpc.pb.go | 36 +++ .../commonpb/v3/rafayconditionstatus.enum.go | 41 +++ proto/types/systempb/v3/project.pb.go | 289 ++++++++++-------- proto/types/systempb/v3/project.proto | 12 + proto/types/userpb/v3/group.pb.go | 151 ++++----- proto/types/userpb/v3/group.proto | 5 + proto/types/userpb/v3/user.pb.go | 129 ++++++-- proto/types/userpb/v3/user.proto | 19 ++ scripts/initialize/main.go | 10 +- server/bootstrap.go | 6 + server/kubeconfig.go | 1 + server/partner.go | 9 + 36 files changed, 1376 insertions(+), 394 deletions(-) create mode 100644 internal/dao/project.go create mode 100644 proto/types/commonpb/v3/rafayconditionstatus.enum.go diff --git a/gen/openapi/proto/rpc/system/metro.swagger.json b/gen/openapi/proto/rpc/system/metro.swagger.json index ecf4d40..09575d3 100644 --- a/gen/openapi/proto/rpc/system/metro.swagger.json +++ b/gen/openapi/proto/rpc/system/metro.swagger.json @@ -24,7 +24,7 @@ "application/yaml" ], "paths": { - "/v3/partner/{metadata.partner}/location": { + "/infra/v3/partner/{metadata.partner}/location": { "get": { "operationId": "Location_GetLocations", "responses": { @@ -294,7 +294,7 @@ ] } }, - "/v3/partner/{metadata.partner}/location/{metadata.name}": { + "/infra/v3/partner/{metadata.partner}/location/{metadata.name}": { "get": { "operationId": "Location_GetLocation", "responses": { diff --git a/gen/openapi/proto/rpc/system/partner.swagger.json b/gen/openapi/proto/rpc/system/partner.swagger.json index d476047..ffae535 100644 --- a/gen/openapi/proto/rpc/system/partner.swagger.json +++ b/gen/openapi/proto/rpc/system/partner.swagger.json @@ -25,6 +25,37 @@ ], "paths": { "/auth/v3/partner": { + "get": { + "operationId": "Partner_GetInitPartner", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Partner" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "tags": [ + "Partner" + ] + }, "post": { "operationId": "Partner_CreatePartner", "responses": { diff --git a/gen/openapi/proto/rpc/system/project.swagger.json b/gen/openapi/proto/rpc/system/project.swagger.json index f7a608c..ad86cea 100644 --- a/gen/openapi/proto/rpc/system/project.swagger.json +++ b/gen/openapi/proto/rpc/system/project.swagger.json @@ -864,6 +864,34 @@ "description": "Project list", "title": "ProjectList" }, + "v3ProjectNamespaceRole": { + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "Project", + "title": "Project" + }, + "namespace": { + "type": "string", + "format": "int64", + "description": "Namespace", + "title": "Namespace" + }, + "role": { + "type": "string", + "description": "Role", + "title": "Role" + }, + "group": { + "type": "string", + "description": "Group", + "title": "Group" + } + }, + "description": "Project, role and namespace pairing for permission", + "title": "ProjectNamespaceRole" + }, "v3ProjectSpec": { "type": "object", "properties": { @@ -871,10 +899,43 @@ "type": "boolean", "description": "flag to indicate if this is the default project in the organization", "title": "Default" + }, + "projectNamespaceRoles": { + "type": "array", + "items": { + "$ref": "#/definitions/v3ProjectNamespaceRole" + }, + "description": "Project, namespace, role associations with groups", + "title": "ProjectNamespaceRoles" + }, + "userRoles": { + "type": "array", + "items": { + "$ref": "#/definitions/v3UserRole" + }, + "description": "List of users with roles assigned to projects", + "title": "UserRoles" } }, "description": "project specification", "title": "Project Specification" + }, + "v3UserRole": { + "type": "object", + "properties": { + "user": { + "type": "string", + "description": "User", + "title": "User" + }, + "role": { + "type": "string", + "description": "Role", + "title": "Role" + } + }, + "description": "User, role pairing for permission", + "title": "UserRole" } }, "securityDefinitions": { diff --git a/gen/openapi/proto/rpc/user/group.swagger.json b/gen/openapi/proto/rpc/user/group.swagger.json index ba6a43d..e3670fc 100644 --- a/gen/openapi/proto/rpc/user/group.swagger.json +++ b/gen/openapi/proto/rpc/user/group.swagger.json @@ -938,6 +938,11 @@ "type": "string", "description": "Role", "title": "Role" + }, + "group": { + "type": "string", + "description": "Group", + "title": "Group" } }, "description": "Project, role and namespace pairing for permission", diff --git a/gen/openapi/proto/rpc/user/user.swagger.json b/gen/openapi/proto/rpc/user/user.swagger.json index 0345d43..8a2a5fa 100644 --- a/gen/openapi/proto/rpc/user/user.swagger.json +++ b/gen/openapi/proto/rpc/user/user.swagger.json @@ -1089,6 +1089,11 @@ "type": "string", "description": "Role", "title": "Role" + }, + "group": { + "type": "string", + "description": "Group", + "title": "Group" } }, "description": "Project, role and namespace pairing for permission", diff --git a/internal/dao/group.go b/internal/dao/group.go index 30eca1d..8532c96 100644 --- a/internal/dao/group.go +++ b/internal/dao/group.go @@ -24,8 +24,9 @@ func GetGroupRoles(ctx context.Context, db bun.IDB, id uuid.UUID) ([]*userv3.Pro // Could possibly union them later for some speedup var r = []*userv3.ProjectNamespaceRole{} err := db.NewSelect().Table("authsrv_grouprole"). - ColumnExpr("authsrv_resourcerole.name as role"). + ColumnExpr("authsrv_resourcerole.name as role, authsrv_group.name as group"). Join(`JOIN authsrv_resourcerole ON authsrv_resourcerole.id=authsrv_grouprole.role_id`). + Join(`JOIN authsrv_group ON authsrv_group.id=authsrv_grouprole.group_id`). Where("authsrv_grouprole.group_id = ?", id). Where("authsrv_resourcerole.trash = ?", false). Where("authsrv_grouprole.trash = ?", false). @@ -36,9 +37,10 @@ func GetGroupRoles(ctx context.Context, db bun.IDB, id uuid.UUID) ([]*userv3.Pro var pr = []*userv3.ProjectNamespaceRole{} err = db.NewSelect().Table("authsrv_projectgrouprole"). - ColumnExpr("authsrv_resourcerole.name as role, authsrv_project.name as project"). + ColumnExpr("authsrv_resourcerole.name as role, authsrv_project.name as project, authsrv_group.name as group"). Join(`JOIN authsrv_resourcerole ON authsrv_resourcerole.id=authsrv_projectgrouprole.role_id`). Join(`JOIN authsrv_project ON authsrv_project.id=authsrv_projectgrouprole.project_id`). + Join(`JOIN authsrv_group ON authsrv_group.id=authsrv_projectgrouprole.group_id`). Where("authsrv_projectgrouprole.group_id = ?", id). Where("authsrv_project.trash = ?", false). Where("authsrv_projectgrouprole.trash = ?", false). @@ -50,9 +52,10 @@ func GetGroupRoles(ctx context.Context, db bun.IDB, id uuid.UUID) ([]*userv3.Pro var pnr = []*userv3.ProjectNamespaceRole{} err = db.NewSelect().Table("authsrv_projectgroupnamespacerole"). - ColumnExpr("authsrv_resourcerole.name as role, authsrv_project.name as project, namespace_id as namespace"). + ColumnExpr("authsrv_resourcerole.name as role, authsrv_project.name as project, namespace_id as namespace, authsrv_group.name as group"). Join(`JOIN authsrv_resourcerole ON authsrv_resourcerole.id=authsrv_projectgroupnamespacerole.role_id`). Join(`JOIN authsrv_project ON authsrv_project.id=authsrv_projectgroupnamespacerole.project_id`). // also need a namespace join + Join(`JOIN authsrv_group ON authsrv_group.id=authsrv_projectgroupnamespacerole.group_id`). Where("authsrv_projectgroupnamespacerole.group_id = ?", id). Where("authsrv_project.trash = ?", false). Where("authsrv_projectgroupnamespacerole.trash = ?", false). diff --git a/internal/dao/project.go b/internal/dao/project.go new file mode 100644 index 0000000..71ff813 --- /dev/null +++ b/internal/dao/project.go @@ -0,0 +1,53 @@ +package dao + +import ( + "context" + + userv3 "github.com/RafayLabs/rcloud-base/proto/types/userpb/v3" + "github.com/google/uuid" + "github.com/uptrace/bun" +) + +func GetProjectGroupRoles(ctx context.Context, db bun.IDB, id uuid.UUID) ([]*userv3.ProjectNamespaceRole, error) { + var pr = []*userv3.ProjectNamespaceRole{} + err := db.NewSelect().Table("authsrv_projectgrouprole"). + ColumnExpr("authsrv_resourcerole.name as role, authsrv_project.name as project, authsrv_group.name as group"). + Join(`JOIN authsrv_resourcerole ON authsrv_resourcerole.id=authsrv_projectgrouprole.role_id`). + Join(`JOIN authsrv_group ON authsrv_group.id=authsrv_projectgrouprole.group_id`). + Join(`JOIN authsrv_project ON authsrv_project.id=authsrv_projectgrouprole.project_id`). + Where("authsrv_projectgrouprole.project_id = ?", id). + Scan(ctx, &pr) + if err != nil { + return nil, err + } + + var pnr = []*userv3.ProjectNamespaceRole{} + err = db.NewSelect().Table("authsrv_projectgroupnamespacerole"). + ColumnExpr("authsrv_resourcerole.name as role, authsrv_project.name as project, authsrv_group.name as group, namespace_id as namespace"). + Join(`JOIN authsrv_resourcerole ON authsrv_resourcerole.id=authsrv_projectgroupnamespacerole.role_id`). + Join(`JOIN authsrv_project ON authsrv_project.id=authsrv_projectgroupnamespacerole.project_id`). + Join(`JOIN authsrv_group ON authsrv_group.id=authsrv_projectgroupnamespacerole.group_id`). // also need a namespace join + Where("authsrv_projectgroupnamespacerole.project_id = ?", id). + Scan(ctx, &pnr) + if err != nil { + return nil, err + } + + return append(pr, pnr...), err +} + +func GetProjectUserRoles(ctx context.Context, db bun.IDB, id uuid.UUID) ([]*userv3.UserRole, error) { + + var pr = []*userv3.UserRole{} + err := db.NewSelect().Table("authsrv_projectaccountresourcerole"). + ColumnExpr("distinct authsrv_resourcerole.name as role, identities.traits ->> 'email' as user"). + Join(`JOIN authsrv_resourcerole ON authsrv_resourcerole.id=authsrv_projectaccountresourcerole.role_id`). + Join(`JOIN identities ON identities.id=authsrv_projectaccountresourcerole.account_id`). + Where("authsrv_projectaccountresourcerole.project_id = ?", id). + Scan(ctx, &pr) + if err != nil { + return nil, err + } + + return pr, err +} diff --git a/internal/dao/user.go b/internal/dao/user.go index 90b1abb..d74a1b2 100644 --- a/internal/dao/user.go +++ b/internal/dao/user.go @@ -35,7 +35,7 @@ func GetUserRoles(ctx context.Context, db bun.IDB, id uuid.UUID) ([]*userv3.Proj var pr = []*userv3.ProjectNamespaceRole{} err = db.NewSelect().Table("authsrv_projectaccountresourcerole"). - ColumnExpr("authsrv_resourcerole.name as role, authsrv_project.name as project"). + ColumnExpr("distinct authsrv_resourcerole.name as role, authsrv_project.name as project"). Join(`JOIN authsrv_resourcerole ON authsrv_resourcerole.id=authsrv_projectaccountresourcerole.role_id`). Join(`JOIN authsrv_project ON authsrv_project.id=authsrv_projectaccountresourcerole.project_id`). Where("authsrv_projectaccountresourcerole.account_id = ?", id). diff --git a/main.go b/main.go index 1b3a816..1b8fe91 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,6 @@ import ( "net" "net/http" goruntime "runtime" - "strings" "sync" "time" @@ -274,12 +273,6 @@ func setup() { _log.Infow("printing db", "db", db) - schedulerPool = schedulerrpc.NewSchedulerPool(schedulerAddr, 5*goruntime.NumCPU()) - - ps = service.NewPartnerService(db) - os = service.NewOrganizationService(db) - pps = service.NewProjectService(db) - // authz services gormDb, err := gorm.Open(postgres.New(postgres.Config{ Conn: sqldb, @@ -293,6 +286,12 @@ func setup() { } as = service.NewAuthzService(db, enforcer) + schedulerPool = schedulerrpc.NewSchedulerPool(schedulerAddr, 5*goruntime.NumCPU()) + + ps = service.NewPartnerService(db) + os = service.NewOrganizationService(db) + pps = service.NewProjectService(db, as) + // users and role management services cc := common.CliConfigDownloadData{ RestEndpoint: apiAddr, @@ -319,7 +318,7 @@ func setup() { aps = service.NewAccountPermissionService(db) gps = service.NewGroupPermissionService(db) - // audit services + /*// audit services aus, err = service.NewAuditLogService(elasticSearchUrl, esIndexPrefix+"-*", "AuditLog API: ") if err != nil { if dev && strings.Contains(err.Error(), "connect: connection refused") { @@ -347,7 +346,7 @@ func setup() { } else { _log.Fatalw("unable to create auditLog service", "error", err) } - } + }*/ // cluster bootstrap downloadData = &common.DownloadData{ diff --git a/pkg/service/apikey.go b/pkg/service/apikey.go index ec9410a..b01de25 100644 --- a/pkg/service/apikey.go +++ b/pkg/service/apikey.go @@ -59,14 +59,14 @@ func (s *apiKeyService) Create(ctx context.Context, req *rpcv3.ApiKeyRequest) (* func (s *apiKeyService) Delete(ctx context.Context, req *rpcv3.ApiKeyRequest) (*rpcv3.DeleteUserResponse, error) { _, err := s.db.NewUpdate().Model(&models.ApiKey{}). Set("trash = ?", true). - Where("name = ?", req.Username). + Where("account_id = ?", req.Username). Where("key = ?", req.Id).Exec(ctx) return nil, err } func (s *apiKeyService) List(ctx context.Context, req *rpcv3.ApiKeyRequest) (*rpcv3.ApiKeyResponseList, error) { var apikeys []models.ApiKey - resp, err := dao.GetByName(ctx, s.db, req.Username, &apikeys) + resp, err := dao.GetX(ctx, s.db, "account_id", req.Username, &apikeys) if err == sql.ErrNoRows { return nil, nil } diff --git a/pkg/service/cluster.go b/pkg/service/cluster.go index 3174afe..983383b 100644 --- a/pkg/service/cluster.go +++ b/pkg/service/cluster.go @@ -309,7 +309,7 @@ func (es *clusterService) Create(ctx context.Context, cluster *infrav3.Cluster) h.OnChange(ev) } - return cluster, nil + return clusterResp, nil } func (s *clusterService) Select(ctx context.Context, cluster *infrav3.Cluster, isExtended bool) (*infrav3.Cluster, error) { @@ -416,6 +416,7 @@ func (s *clusterService) prepareClusterResponse(ctx context.Context, clstr *infr json.Unmarshal(c.Annotations, &ann) } clstr.Metadata = &commonv3.Metadata{ + Id: c.ID.String(), Name: c.Name, Description: c.DisplayName, Labels: lbls, @@ -442,7 +443,7 @@ func (s *clusterService) prepareClusterResponse(ctx context.Context, clstr *infr } } var conditions []*infrav3.ClusterCondition - if isExtended && c.Conditions != nil { + if c.Conditions != nil { json.Unmarshal(c.Conditions, &conditions) } clstr.Spec = &infrav3.ClusterSpec{ diff --git a/pkg/service/partner.go b/pkg/service/partner.go index 990d8dd..37f16a2 100644 --- a/pkg/service/partner.go +++ b/pkg/service/partner.go @@ -26,6 +26,8 @@ type PartnerService interface { Update(ctx context.Context, partner *systemv3.Partner) (*systemv3.Partner, error) // delete partner Delete(ctx context.Context, partner *systemv3.Partner) (*systemv3.Partner, error) + // list partner + GetOnlyPartner(ctx context.Context) (*systemv3.Partner, error) } // partnerService implements PartnerService @@ -262,3 +264,45 @@ func (s *partnerService) Delete(ctx context.Context, partner *systemv3.Partner) return partner, nil } + +func (s *partnerService) GetOnlyPartner(ctx context.Context) (partner *systemv3.Partner, err error) { + var partners []models.Partner + entities, err := dao.ListAll(ctx, s.db, &partners) + if err != nil { + return nil, err + } + if pts, ok := entities.(*[]models.Partner); ok { + for _, part := range *pts { + partner = &systemv3.Partner{ + Metadata: &v3.Metadata{ + Name: part.Name, + Id: part.ID.String(), + Description: part.Description, + ModifiedAt: timestamppb.New(part.ModifiedAt), + }, + Spec: &systemv3.PartnerSpec{ + Host: part.Host, + Domain: part.Domain, + TosLink: part.TosLink, + LogoLink: part.LogoLink, + NotificationEmail: part.NotificationEmail, + HelpdeskEmail: part.HelpdeskEmail, + ProductName: part.ProductName, + SupportTeamName: part.SupportTeamName, + OpsHost: part.OpsHost, + FavIconLink: part.FavIconLink, + IsTOTPEnabled: part.IsTOTPEnabled, + Settings: nil, + }, + Status: &v3.Status{ + ConditionType: "Describe", + ConditionStatus: v3.ConditionStatus_StatusOK, + LastUpdated: timestamppb.New(part.ModifiedAt), + }, + } + + return partner, nil + } + } + return partner, err +} diff --git a/pkg/service/project.go b/pkg/service/project.go index e37620b..e876c8c 100644 --- a/pkg/service/project.go +++ b/pkg/service/project.go @@ -7,6 +7,7 @@ import ( "github.com/RafayLabs/rcloud-base/internal/dao" "github.com/RafayLabs/rcloud-base/internal/models" + authzv1 "github.com/RafayLabs/rcloud-base/proto/types/authz" v3 "github.com/RafayLabs/rcloud-base/proto/types/commonpb/v3" systemv3 "github.com/RafayLabs/rcloud-base/proto/types/systempb/v3" "github.com/google/uuid" @@ -38,12 +39,13 @@ type ProjectService interface { // projectService implements ProjectService type projectService struct { - db *bun.DB + db *bun.DB + azc AuthzService } // NewProjectService return new project service -func NewProjectService(db *bun.DB) ProjectService { - return &projectService{db} +func NewProjectService(db *bun.DB, azc AuthzService) ProjectService { + return &projectService{db: db, azc: azc} } func (s *projectService) Create(ctx context.Context, project *systemv3.Project) (*systemv3.Project, error) { @@ -76,6 +78,17 @@ func (s *projectService) Create(ctx context.Context, project *systemv3.Project) //update v3 spec if createdProject, ok := entity.(*models.Project); ok { + + project, err = s.createGroupRoleRelations(ctx, project, parsedIds{Id: createdProject.ID, Partner: createdProject.PartnerId, Organization: createdProject.OrganizationId}) + if err != nil { + return &systemv3.Project{}, err + } + + project, err = s.createProjectAccountRelations(ctx, createdProject.ID, project) + if err != nil { + return &systemv3.Project{}, err + } + project.Metadata.Id = createdProject.ID.String() project.Spec = &systemv3.ProjectSpec{ Default: createdProject.Default, @@ -154,6 +167,16 @@ func (s *projectService) GetByName(ctx context.Context, name string) (*systemv3. return nil, err } + pnr, err := dao.GetProjectGroupRoles(ctx, s.db, proj.ID) + if err != nil { + return nil, err + } + + ur, err := dao.GetProjectUserRoles(ctx, s.db, proj.ID) + if err != nil { + return nil, err + } + project.Metadata = &v3.Metadata{ Name: proj.Name, Description: proj.Description, @@ -162,7 +185,9 @@ func (s *projectService) GetByName(ctx context.Context, name string) (*systemv3. ModifiedAt: timestamppb.New(proj.ModifiedAt), } project.Spec = &systemv3.ProjectSpec{ - Default: proj.Default, + Default: proj.Default, + ProjectNamespaceRoles: pnr, + UserRoles: ur, } return project, nil @@ -184,14 +209,44 @@ func (s *projectService) Update(ctx context.Context, project *systemv3.Project) proj.Default = project.Spec.Default proj.ModifiedAt = time.Now() + project, err = s.deleteGroupRoleRelaitons(ctx, proj.ID, project) + if err != nil { + return &systemv3.Project{}, err + } + project, err = s.createGroupRoleRelations(ctx, project, parsedIds{Id: proj.ID, Partner: proj.PartnerId, Organization: proj.OrganizationId}) + if err != nil { + return &systemv3.Project{}, err + } + + project, err = s.deleteProjectAccountRelations(ctx, proj.ID, project) + if err != nil { + return &systemv3.Project{}, err + } + project, err = s.createProjectAccountRelations(ctx, proj.ID, project) + if err != nil { + return &systemv3.Project{}, err + } + _, err = dao.Update(ctx, s.db, proj.ID, proj) if err != nil { return &systemv3.Project{}, err } + pnr, err := dao.GetProjectGroupRoles(ctx, s.db, proj.ID) + if err != nil { + return nil, err + } + + ur, err := dao.GetProjectUserRoles(ctx, s.db, proj.ID) + if err != nil { + return nil, err + } + //update spec and status project.Spec = &systemv3.ProjectSpec{ - Default: proj.Default, + Default: proj.Default, + ProjectNamespaceRoles: pnr, + UserRoles: ur, } } @@ -204,6 +259,17 @@ func (s *projectService) Delete(ctx context.Context, project *systemv3.Project) return &systemv3.Project{}, err } if proj, ok := entity.(*models.Project); ok { + + project, err = s.deleteGroupRoleRelaitons(ctx, proj.ID, project) + if err != nil { + return &systemv3.Project{}, err + } + + project, err = s.deleteProjectAccountRelations(ctx, proj.ID, project) + if err != nil { + return &systemv3.Project{}, err + } + err := dao.Delete(ctx, s.db, proj.ID, proj) if err != nil { return &systemv3.Project{}, err @@ -248,17 +314,29 @@ func (s *projectService) List(ctx context.Context, project *systemv3.Project) (* labels["organization"] = proj.OrganizationId.String() labels["partner"] = proj.PartnerId.String() - project.Metadata = &v3.Metadata{ - Name: proj.Name, - Description: proj.Description, - Id: proj.ID.String(), - Organization: proj.OrganizationId.String(), - Partner: proj.PartnerId.String(), - Labels: labels, - ModifiedAt: timestamppb.New(proj.ModifiedAt), + pnr, err := dao.GetProjectGroupRoles(ctx, s.db, proj.ID) + if err != nil { + return nil, err } - project.Spec = &systemv3.ProjectSpec{ - Default: proj.Default, + ur, err := dao.GetProjectUserRoles(ctx, s.db, proj.ID) + if err != nil { + return nil, err + } + project := &systemv3.Project{ + Metadata: &v3.Metadata{ + Name: proj.Name, + Description: proj.Description, + Id: proj.ID.String(), + Organization: proj.OrganizationId.String(), + Partner: proj.PartnerId.String(), + Labels: labels, + ModifiedAt: timestamppb.New(proj.ModifiedAt), + }, + Spec: &systemv3.ProjectSpec{ + Default: proj.Default, + ProjectNamespaceRoles: pnr, + UserRoles: ur, + }, } projects = append(projects, project) } @@ -275,3 +353,158 @@ func (s *projectService) List(ctx context.Context, project *systemv3.Project) (* } return projectList, nil } + +// Map roles to groups +func (s *projectService) createGroupRoleRelations(ctx context.Context, project *systemv3.Project, ids parsedIds) (*systemv3.Project, error) { + projectNamespaceRoles := project.GetSpec().GetProjectNamespaceRoles() + + var pgrs []models.ProjectGroupRole + var ps []*authzv1.Policy + for _, pnr := range projectNamespaceRoles { + role := pnr.GetRole() + entity, err := dao.GetIdByName(ctx, s.db, role, &models.Role{}) + if err != nil { + return &systemv3.Project{}, fmt.Errorf("unable to find role '%v'", role) + } + var roleId uuid.UUID + if rle, ok := entity.(*models.Role); ok { + roleId = rle.ID + } else { + return &systemv3.Project{}, fmt.Errorf("unable to find role '%v'", role) + } + + grp := pnr.GetGroup() + entity, err = dao.GetIdByName(ctx, s.db, grp, &models.Group{}) + if err != nil { + return &systemv3.Project{}, fmt.Errorf("unable to find group '%v'", grp) + } + var grpId uuid.UUID + var grpName string + if g, ok := entity.(*models.Group); ok { + grpId = g.ID + grpName = g.Name + } else { + return &systemv3.Project{}, fmt.Errorf("unable to find group '%v'", grp) + } + + org := project.Metadata.Organization + pgr := models.ProjectGroupRole{ + Trash: false, + RoleId: roleId, + PartnerId: ids.Partner, + OrganizationId: ids.Organization, + GroupId: grpId, + ProjectId: ids.Id, + Active: true, + } + pgrs = append(pgrs, pgr) + + ps = append(ps, &authzv1.Policy{ + Sub: "g:" + grpName, + Ns: "*", + Proj: project.Metadata.Name, + Org: org, + Obj: role, + }) + } + if len(pgrs) > 0 { + _, err := dao.Create(ctx, s.db, &pgrs) + if err != nil { + return &systemv3.Project{}, err + } + } + + if len(ps) > 0 { + success, err := s.azc.CreatePolicies(ctx, &authzv1.Policies{Policies: ps}) + if err != nil || !success.Res { + return &systemv3.Project{}, fmt.Errorf("unable to create mapping in authz; %v", err) + } + } + + return project, nil +} + +func (s *projectService) deleteGroupRoleRelaitons(ctx context.Context, projectId uuid.UUID, project *systemv3.Project) (*systemv3.Project, error) { + // delete previous entries + err := dao.DeleteX(ctx, s.db, "project_id", projectId, &models.ProjectGroupRole{}) + if err != nil { + return &systemv3.Project{}, err + } + + _, err = s.azc.DeletePolicies(ctx, &authzv1.Policy{Proj: project.GetMetadata().GetName()}) + if err != nil { + return &systemv3.Project{}, fmt.Errorf("unable to delete project group-role relations from authz; %v", err) + } + return project, nil +} + +func (s *projectService) deleteProjectAccountRelations(ctx context.Context, projectId uuid.UUID, project *systemv3.Project) (*systemv3.Project, error) { + err := dao.DeleteX(ctx, s.db, "project_id", projectId, &models.ProjectAccountResourcerole{}) + if err != nil { + return &systemv3.Project{}, fmt.Errorf("unable to delete project; %v", err) + } + + _, err = s.azc.DeletePolicies(ctx, &authzv1.Policy{Proj: project.GetMetadata().GetName()}) + if err != nil { + return &systemv3.Project{}, fmt.Errorf("unable to delete project user-role relations from authz; %v", err) + } + return project, nil +} + +// Update the users(account) mapped to each project +func (s *projectService) createProjectAccountRelations(ctx context.Context, projectId uuid.UUID, project *systemv3.Project) (*systemv3.Project, error) { + var parrs []models.ProjectAccountResourcerole + var ugs []*authzv1.Policy + + for _, ur := range project.Spec.UserRoles { + // FIXME: do combined lookup + entity, err := dao.GetIdByTraits(ctx, s.db, ur.User, &models.KratosIdentities{}) + if err != nil { + return &systemv3.Project{}, fmt.Errorf("unable to find user '%v'", ur.User) + } + rentity, err := dao.GetByName(ctx, s.db, ur.Role, &models.Role{}) + if err != nil { + return &systemv3.Project{}, fmt.Errorf("unable to find user '%v'", ur.User) + } + + if acc, ok := entity.(*models.KratosIdentities); ok { + if role, ok := rentity.(*models.Role); ok { + parr := models.ProjectAccountResourcerole{ + CreatedAt: time.Now(), + ModifiedAt: time.Now(), + Trash: false, + AccountId: acc.ID, + ProjectId: projectId, + RoleId: role.ID, + OrganizationId: role.OrganizationId, + PartnerId: role.PartnerId, + Active: true, + } + parrs = append(parrs, parr) + ugs = append(ugs, &authzv1.Policy{ + Sub: "u:" + ur.User, + Proj: project.Metadata.Name, + Org: project.Metadata.Organization, + Ns: "*", + Obj: role.Name, + }) + } + } + } + if len(parrs) == 0 { + return project, nil + } + _, err := dao.Create(ctx, s.db, &parrs) + if err != nil { + return &systemv3.Project{}, err + } + + // TODO: revert our db inserts if this fails + // Just FYI, the succcess can be false if we delete the db directly but casbin has it available internally + _, err = s.azc.CreatePolicies(ctx, &authzv1.Policies{Policies: ugs}) + if err != nil { + return &systemv3.Project{}, fmt.Errorf("unable to create mapping in authz; %v", err) + } + + return project, nil +} diff --git a/pkg/service/project_test.go b/pkg/service/project_test.go index 500df16..fab3d23 100644 --- a/pkg/service/project_test.go +++ b/pkg/service/project_test.go @@ -21,7 +21,13 @@ func TestCreateProject(t *testing.T) { db, mock := getDB(t) defer db.Close() +<<<<<<< Updated upstream ps := NewProjectService(db) +======= + mazc := mockAuthzClient{} + ps := NewProjectService(db, &mazc) + defer ps.Close() +>>>>>>> Stashed changes puuid := uuid.New().String() ouuid := uuid.New().String() @@ -47,7 +53,13 @@ func TestCreateProjectDuplicate(t *testing.T) { db, mock := getDB(t) defer db.Close() +<<<<<<< Updated upstream gs := NewProjectService(db) +======= + mazc := mockAuthzClient{} + gs := NewProjectService(db, &mazc) + defer gs.Close() +>>>>>>> Stashed changes puuid := uuid.New().String() @@ -69,7 +81,13 @@ func TestProjectDelete(t *testing.T) { db, mock := getDB(t) defer db.Close() +<<<<<<< Updated upstream ps := NewProjectService(db) +======= + mazc := mockAuthzClient{} + ps := NewProjectService(db, &mazc) + defer ps.Close() +>>>>>>> Stashed changes puuid := uuid.New().String() @@ -92,7 +110,13 @@ func TestProjectDeleteNonExist(t *testing.T) { db, mock := getDB(t) defer db.Close() +<<<<<<< Updated upstream ps := NewProjectService(db) +======= + mazc := mockAuthzClient{} + ps := NewProjectService(db, &mazc) + defer ps.Close() +>>>>>>> Stashed changes puuid := uuid.New().String() @@ -112,7 +136,13 @@ func TestProjectGetByName(t *testing.T) { db, mock := getDB(t) defer db.Close() +<<<<<<< Updated upstream ps := NewProjectService(db) +======= + mazc := mockAuthzClient{} + ps := NewProjectService(db, &mazc) + defer ps.Close() +>>>>>>> Stashed changes partuuid := uuid.New().String() ouuid := uuid.New().String() @@ -140,7 +170,13 @@ func TestProjectGetById(t *testing.T) { db, mock := getDB(t) defer db.Close() +<<<<<<< Updated upstream ps := NewProjectService(db) +======= + mazc := mockAuthzClient{} + ps := NewProjectService(db, &mazc) + defer ps.Close() +>>>>>>> Stashed changes puuid := uuid.New().String() @@ -161,7 +197,13 @@ func TestProjectUpdate(t *testing.T) { db, mock := getDB(t) defer db.Close() +<<<<<<< Updated upstream ps := NewProjectService(db) +======= + mazc := mockAuthzClient{} + ps := NewProjectService(db, &mazc) + defer ps.Close() +>>>>>>> Stashed changes puuid := uuid.New().String() diff --git a/pkg/service/user.go b/pkg/service/user.go index 0e9f944..7ef3752 100644 --- a/pkg/service/user.go +++ b/pkg/service/user.go @@ -228,6 +228,64 @@ func (s *userService) createUserRoleRelations(ctx context.Context, db bun.IDB, u return user, nil } +// Update the groups mapped to each user(account) +func (s *userService) createGroupAccountRelations(ctx context.Context, db bun.IDB, userId uuid.UUID, usr *userv3.User) (*userv3.User, error) { + // TODO: add transactions + var grpaccs []models.GroupAccount + var ugs []*authzv1.UserGroup + for _, group := range unique(usr.GetSpec().GetGroups()) { + // FIXME: do combined lookup + entity, err := dao.GetByName(ctx, s.db, group, &models.Group{}) + if err != nil { + return &userv3.User{}, fmt.Errorf("unable to find group '%v'", group) + } + if grp, ok := entity.(*models.Group); ok { + grp := models.GroupAccount{ + CreatedAt: time.Now(), + ModifiedAt: time.Now(), + Trash: false, + AccountId: userId, + GroupId: grp.ID, + Active: true, + } + grpaccs = append(grpaccs, grp) + ugs = append(ugs, &authzv1.UserGroup{ + Grp: "g:" + grp.Name, + User: "u:" + usr.Metadata.Name, + }) + } + } + if len(grpaccs) == 0 { + return usr, nil + } + _, err := dao.Create(ctx, db, &grpaccs) + if err != nil { + return &userv3.User{}, err + } + + // TODO: revert our db inserts if this fails + // Just FYI, the succcess can be false if we delete the db directly but casbin has it available internally + _, err = s.azc.CreateUserGroups(ctx, &authzv1.UserGroups{UserGroups: ugs}) + if err != nil { + return &userv3.User{}, fmt.Errorf("unable to create mapping in authz; %v", err) + } + + return usr, nil +} + +func (s *userService) deleteGroupAccountRelations(ctx context.Context, db bun.IDB, userId uuid.UUID, usr *userv3.User) (*userv3.User, error) { + err := dao.DeleteX(ctx, db, "account_id", userId, &models.GroupAccount{}) + if err != nil { + return &userv3.User{}, fmt.Errorf("unable to delete user; %v", err) + } + + _, err = s.azc.DeleteUserGroups(ctx, &authzv1.UserGroup{Grp: "u:" + usr.GetMetadata().GetName()}) + if err != nil { + return &userv3.User{}, fmt.Errorf("unable to delete group-user relations from authz; %v", err) + } + return usr, nil +} + // FIXME: make this generic func (s *userService) getPartnerOrganization(ctx context.Context, db bun.IDB, user *userv3.User) (uuid.UUID, uuid.UUID, error) { partner := user.GetMetadata().GetPartner() @@ -274,6 +332,13 @@ func (s *userService) Create(ctx context.Context, user *userv3.User) (*userv3.Us tx.Rollback() return &userv3.User{}, err } + + user, err = s.createGroupAccountRelations(ctx, tx, uuid.MustParse(id), user) + if err != nil { + tx.Rollback() + return &userv3.User{}, err + } + err = tx.Commit() if err != nil { tx.Rollback() @@ -296,8 +361,16 @@ func (s *userService) identitiesModelToUser(ctx context.Context, db bun.IDB, use return &userv3.User{}, err } groupNames := []string{} + allAssociatedRoles := []*userv3.ProjectNamespaceRole{} for _, g := range groups { groupNames = append(groupNames, g.Name) + + //group roles + groupRoles, err := dao.GetGroupRoles(ctx, db, g.ID) + if err != nil { + return &userv3.User{}, err + } + allAssociatedRoles = append(allAssociatedRoles, groupRoles...) } labels := make(map[string]string) @@ -306,6 +379,7 @@ func (s *userService) identitiesModelToUser(ctx context.Context, db bun.IDB, use if err != nil { return &userv3.User{}, err } + roles = append(roles, allAssociatedRoles...) user.ApiVersion = apiVersion user.Kind = userKind @@ -314,6 +388,7 @@ func (s *userService) identitiesModelToUser(ctx context.Context, db bun.IDB, use Description: traits.Description, Labels: labels, ModifiedAt: timestamppb.New(usr.UpdatedAt), + Id: usr.ID.String(), } user.Spec = &userv3.UserSpec{ FirstName: traits.FirstName, @@ -363,7 +438,6 @@ func (s *userService) GetByName(ctx context.Context, user *userv3.User) (*userv3 return user, nil } - fmt.Println("user:", user) return user, nil } @@ -422,18 +496,33 @@ func (s *userService) Update(ctx context.Context, user *userv3.User) (*userv3.Us return &userv3.User{}, err } + user, err = s.deleteGroupAccountRelations(ctx, tx, usr.ID, user) + if err != nil { + tx.Rollback() + return &userv3.User{}, err + } + user, err = s.createUserRoleRelations(ctx, tx, user, parsedIds{Id: usr.ID, Partner: partnerId, Organization: organizationId}) if err != nil { tx.Rollback() return &userv3.User{}, err } + user, err = s.createGroupAccountRelations(ctx, tx, usr.ID, user) + if err != nil { + tx.Rollback() + return &userv3.User{}, err + } + err = tx.Commit() if err != nil { tx.Rollback() _log.Warn("unable to commit changes", err) } return user, nil + + } else { + return &userv3.User{}, fmt.Errorf("unable to update user '%v'", name) } return &userv3.User{}, fmt.Errorf("unable to update user '%v'", name) diff --git a/pkg/sso/saml/middleware.go b/pkg/sso/saml/middleware.go index 00a8fed..e95b3c3 100644 --- a/pkg/sso/saml/middleware.go +++ b/pkg/sso/saml/middleware.go @@ -11,6 +11,7 @@ import ( "os" "strings" + "github.com/RafayLabs/rcloud-base/internal/dao" "github.com/RafayLabs/rcloud-base/internal/models" "github.com/crewjam/saml" "github.com/crewjam/saml/samlsp" @@ -93,7 +94,7 @@ func (s *SAMLService) SAMLAuth(handler http.Handler) http.Handler { } domain := strings.SplitN(username, "@", 2)[1] - entity, err := s.EntityDAO.GetX(context.Background(), "domain", domain, &models.Idp{}) + entity, err := dao.GetX(context.Background(), s.db, "domain", domain, &models.Idp{}) if err != nil { http.Error(w, "No idp found for domain", http.StatusInternalServerError) return @@ -132,7 +133,7 @@ func (s *SAMLService) ServeACS(w http.ResponseWriter, r *http.Request) { base, _ := url.Parse(os.Getenv("APP_HOST_HTTP")) acsURL := base.ResolveReference(r.URL) - entity, err := s.EntityDAO.GetX(context.Background(), "acs_url", acsURL.String(), &models.Idp{}) + entity, err := dao.GetX(context.Background(), s.db, "acs_url", acsURL.String(), &models.Idp{}) if err != nil { http.Error(w, "No Idp for ACS URL", http.StatusInternalServerError) return diff --git a/pkg/sso/saml/saml.go b/pkg/sso/saml/saml.go index abde744..0335981 100644 --- a/pkg/sso/saml/saml.go +++ b/pkg/sso/saml/saml.go @@ -1,7 +1,6 @@ package saml import ( - pg "github.com/RafayLabs/rcloud-base/internal/persistence/provider/pg" "github.com/crewjam/saml/samlsp" "github.com/uptrace/bun" ) @@ -11,11 +10,11 @@ type SAMLMiddleware struct { } type SAMLService struct { - EntityDAO pg.EntityDAO + db *bun.DB } func NewSAMLService(db *bun.DB) *SAMLService { return &SAMLService{ - EntityDAO: pg.NewEntityDAO(db), + db: db, } } diff --git a/proto/rpc/sentry/bootstrap.pb.gw.go b/proto/rpc/sentry/bootstrap.pb.gw.go index 3a4efe1..fda7e7c 100644 --- a/proto/rpc/sentry/bootstrap.pb.gw.go +++ b/proto/rpc/sentry/bootstrap.pb.gw.go @@ -14,7 +14,7 @@ import ( "net/http" "github.com/RafayLabs/rcloud-base/proto/types/commonpb/v3" - sentry_0 "github.com/RafayLabs/rcloud-base/proto/types/sentry" + "github.com/RafayLabs/rcloud-base/proto/types/sentry" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" @@ -34,7 +34,7 @@ var _ = utilities.NewDoubleArray var _ = metadata.Join func request_Bootstrap_PatchBootstrapInfra_0(ctx context.Context, marshaler runtime.Marshaler, client BootstrapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapInfra + var protoReq sentry.BootstrapInfra var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -68,7 +68,7 @@ func request_Bootstrap_PatchBootstrapInfra_0(ctx context.Context, marshaler runt } func local_request_Bootstrap_PatchBootstrapInfra_0(ctx context.Context, marshaler runtime.Marshaler, server BootstrapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapInfra + var protoReq sentry.BootstrapInfra var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -106,7 +106,7 @@ var ( ) func request_Bootstrap_GetBootstrapInfra_0(ctx context.Context, marshaler runtime.Marshaler, client BootstrapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapInfra + var protoReq sentry.BootstrapInfra var metadata runtime.ServerMetadata var ( @@ -139,7 +139,7 @@ func request_Bootstrap_GetBootstrapInfra_0(ctx context.Context, marshaler runtim } func local_request_Bootstrap_GetBootstrapInfra_0(ctx context.Context, marshaler runtime.Marshaler, server BootstrapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapInfra + var protoReq sentry.BootstrapInfra var metadata runtime.ServerMetadata var ( @@ -172,7 +172,7 @@ func local_request_Bootstrap_GetBootstrapInfra_0(ctx context.Context, marshaler } func request_Bootstrap_PatchBootstrapAgentTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client BootstrapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapAgentTemplate + var protoReq sentry.BootstrapAgentTemplate var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -206,7 +206,7 @@ func request_Bootstrap_PatchBootstrapAgentTemplate_0(ctx context.Context, marsha } func local_request_Bootstrap_PatchBootstrapAgentTemplate_0(ctx context.Context, marshaler runtime.Marshaler, server BootstrapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapAgentTemplate + var protoReq sentry.BootstrapAgentTemplate var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -244,7 +244,7 @@ var ( ) func request_Bootstrap_GetBootstrapAgentTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client BootstrapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapAgentTemplate + var protoReq sentry.BootstrapAgentTemplate var metadata runtime.ServerMetadata var ( @@ -277,7 +277,7 @@ func request_Bootstrap_GetBootstrapAgentTemplate_0(ctx context.Context, marshale } func local_request_Bootstrap_GetBootstrapAgentTemplate_0(ctx context.Context, marshaler runtime.Marshaler, server BootstrapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapAgentTemplate + var protoReq sentry.BootstrapAgentTemplate var metadata runtime.ServerMetadata var ( @@ -418,7 +418,7 @@ var ( ) func request_Bootstrap_GetBootstrapAgentConfig_0(ctx context.Context, marshaler runtime.Marshaler, client BootstrapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapAgent + var protoReq sentry.BootstrapAgent var metadata runtime.ServerMetadata var ( @@ -461,7 +461,7 @@ func request_Bootstrap_GetBootstrapAgentConfig_0(ctx context.Context, marshaler } func local_request_Bootstrap_GetBootstrapAgentConfig_0(ctx context.Context, marshaler runtime.Marshaler, server BootstrapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapAgent + var protoReq sentry.BootstrapAgent var metadata runtime.ServerMetadata var ( @@ -504,7 +504,7 @@ func local_request_Bootstrap_GetBootstrapAgentConfig_0(ctx context.Context, mars } func request_Bootstrap_CreateBootstrapAgent_0(ctx context.Context, marshaler runtime.Marshaler, client BootstrapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapAgent + var protoReq sentry.BootstrapAgent var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -538,7 +538,7 @@ func request_Bootstrap_CreateBootstrapAgent_0(ctx context.Context, marshaler run } func local_request_Bootstrap_CreateBootstrapAgent_0(ctx context.Context, marshaler runtime.Marshaler, server BootstrapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapAgent + var protoReq sentry.BootstrapAgent var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -576,7 +576,7 @@ var ( ) func request_Bootstrap_GetBootstrapAgent_0(ctx context.Context, marshaler runtime.Marshaler, client BootstrapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapAgent + var protoReq sentry.BootstrapAgent var metadata runtime.ServerMetadata var ( @@ -619,7 +619,7 @@ func request_Bootstrap_GetBootstrapAgent_0(ctx context.Context, marshaler runtim } func local_request_Bootstrap_GetBootstrapAgent_0(ctx context.Context, marshaler runtime.Marshaler, server BootstrapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapAgent + var protoReq sentry.BootstrapAgent var metadata runtime.ServerMetadata var ( @@ -736,7 +736,7 @@ var ( ) func request_Bootstrap_DeleteBootstrapAgent_0(ctx context.Context, marshaler runtime.Marshaler, client BootstrapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapAgent + var protoReq sentry.BootstrapAgent var metadata runtime.ServerMetadata var ( @@ -779,7 +779,7 @@ func request_Bootstrap_DeleteBootstrapAgent_0(ctx context.Context, marshaler run } func local_request_Bootstrap_DeleteBootstrapAgent_0(ctx context.Context, marshaler runtime.Marshaler, server BootstrapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapAgent + var protoReq sentry.BootstrapAgent var metadata runtime.ServerMetadata var ( @@ -822,7 +822,7 @@ func local_request_Bootstrap_DeleteBootstrapAgent_0(ctx context.Context, marshal } func request_Bootstrap_UpdateBootstrapAgent_0(ctx context.Context, marshaler runtime.Marshaler, client BootstrapClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapAgent + var protoReq sentry.BootstrapAgent var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -866,7 +866,7 @@ func request_Bootstrap_UpdateBootstrapAgent_0(ctx context.Context, marshaler run } func local_request_Bootstrap_UpdateBootstrapAgent_0(ctx context.Context, marshaler runtime.Marshaler, server BootstrapServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq sentry_0.BootstrapAgent + var protoReq sentry.BootstrapAgent var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) diff --git a/proto/rpc/system/metro.pb.go b/proto/rpc/system/metro.pb.go index a8cc99d..b2dc36b 100644 --- a/proto/rpc/system/metro.pb.go +++ b/proto/rpc/system/metro.pb.go @@ -35,97 +35,99 @@ var file_proto_rpc_system_metro_proto_rawDesc = []byte{ 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xfa, 0x06, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0xc9, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x63, 0x61, + 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x98, 0x07, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0xcf, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, - 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x6f, 0x92, 0x41, + 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x75, 0x92, 0x41, 0x3a, 0x4a, 0x38, 0x0a, 0x03, 0x32, 0x30, 0x31, 0x12, 0x31, 0x0a, 0x2f, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x2c, 0x22, 0x27, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, - 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x01, 0x2a, 0x12, 0x8b, 0x01, - 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x22, - 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x1a, 0x26, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, - 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, - 0x72, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x96, 0x01, 0x0a, 0x0b, - 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x72, 0x61, - 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x69, 0x6e, - 0x66, 0x72, 0x61, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, - 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0x3f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x12, 0x37, 0x2f, 0x76, 0x33, - 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, - 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x9c, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, + 0x32, 0x22, 0x2d, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, + 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, + 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x3a, 0x01, 0x2a, 0x12, 0x91, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x76, 0x33, 0x2e, + 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x26, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, + 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, + 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, + 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6c, + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x9c, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x42, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3c, 0x1a, 0x37, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, - 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, - 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, - 0x3a, 0x01, 0x2a, 0x12, 0xdb, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, - 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x76, - 0x33, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x22, 0x2e, 0x72, 0x61, 0x66, - 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x66, - 0x72, 0x61, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x80, - 0x01, 0x92, 0x41, 0x3e, 0x4a, 0x3c, 0x0a, 0x03, 0x32, 0x30, 0x34, 0x12, 0x35, 0x0a, 0x33, 0x52, - 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x6f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x64, 0x20, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x6c, - 0x79, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x2a, 0x37, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, - 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, - 0x7d, 0x42, 0xa0, 0x04, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, - 0x64, 0x65, 0x76, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x33, 0x42, 0x0a, 0x4d, 0x65, 0x74, 0x72, - 0x6f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x73, 0x2f, 0x72, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x3b, 0x72, - 0x70, 0x63, 0x76, 0x33, 0xa2, 0x02, 0x03, 0x52, 0x44, 0x52, 0xaa, 0x02, 0x10, 0x52, 0x61, 0x66, - 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x52, 0x70, 0x63, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x10, - 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x56, 0x33, - 0xe2, 0x02, 0x1c, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x70, 0x63, - 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x13, 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x52, 0x70, - 0x63, 0x3a, 0x3a, 0x56, 0x33, 0x92, 0x41, 0xdb, 0x02, 0x12, 0x24, 0x0a, 0x10, 0x4c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x0b, 0x0a, - 0x09, 0x52, 0x61, 0x66, 0x61, 0x79, 0x20, 0x44, 0x65, 0x76, 0x32, 0x03, 0x33, 0x2e, 0x30, 0x2a, - 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, - 0x6a, 0x73, 0x6f, 0x6e, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x79, 0x61, 0x6d, 0x6c, 0x52, 0x50, 0x0a, 0x03, 0x34, 0x30, - 0x33, 0x12, 0x49, 0x0a, 0x47, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, - 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x64, 0x6f, 0x65, 0x73, - 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x3b, 0x0a, 0x03, - 0x34, 0x30, 0x34, 0x12, 0x34, 0x0a, 0x2a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, - 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, - 0x2e, 0x12, 0x06, 0x0a, 0x04, 0x9a, 0x02, 0x01, 0x07, 0x5a, 0x38, 0x0a, 0x25, 0x0a, 0x0a, 0x41, - 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x17, 0x08, 0x02, 0x1a, 0x11, 0x58, - 0x2d, 0x52, 0x41, 0x46, 0x41, 0x59, 0x2d, 0x41, 0x50, 0x49, 0x2d, 0x4b, 0x45, 0x59, 0x49, 0x44, - 0x20, 0x02, 0x0a, 0x0f, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, - 0x02, 0x08, 0x01, 0x62, 0x1f, 0x0a, 0x0e, 0x0a, 0x0a, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, - 0x75, 0x74, 0x68, 0x12, 0x00, 0x0a, 0x0d, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, - 0x74, 0x68, 0x12, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x45, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3f, 0x12, 0x3d, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2f, + 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0xa2, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x72, + 0x61, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x22, 0x2e, + 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0x48, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x42, 0x1a, 0x3d, 0x2f, 0x69, 0x6e, 0x66, 0x72, + 0x61, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, + 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xe1, 0x01, 0x0a, 0x0e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, + 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x1a, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x86, 0x01, 0x92, 0x41, 0x3e, 0x4a, 0x3c, 0x0a, 0x03, + 0x32, 0x30, 0x34, 0x12, 0x35, 0x0a, 0x33, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, + 0x77, 0x68, 0x65, 0x6e, 0x20, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x20, 0x73, 0x75, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3f, + 0x2a, 0x3d, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, + 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, + 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, + 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x42, + 0xa0, 0x04, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, + 0x76, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x33, 0x42, 0x0a, 0x4d, 0x65, 0x74, 0x72, 0x6f, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, + 0x72, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x3b, 0x72, 0x70, 0x63, + 0x76, 0x33, 0xa2, 0x02, 0x03, 0x52, 0x44, 0x52, 0xaa, 0x02, 0x10, 0x52, 0x61, 0x66, 0x61, 0x79, + 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x52, 0x70, 0x63, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x10, 0x52, 0x61, + 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x56, 0x33, 0xe2, 0x02, + 0x1c, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x56, + 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, + 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x52, 0x70, 0x63, 0x3a, + 0x3a, 0x56, 0x33, 0x92, 0x41, 0xdb, 0x02, 0x12, 0x24, 0x0a, 0x10, 0x4c, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x0b, 0x0a, 0x09, 0x52, + 0x61, 0x66, 0x61, 0x79, 0x20, 0x44, 0x65, 0x76, 0x32, 0x03, 0x33, 0x2e, 0x30, 0x2a, 0x01, 0x02, + 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, + 0x6f, 0x6e, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, + 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x79, 0x61, 0x6d, 0x6c, 0x52, 0x50, 0x0a, 0x03, 0x34, 0x30, 0x33, 0x12, + 0x49, 0x0a, 0x47, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, + 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x3b, 0x0a, 0x03, 0x34, 0x30, + 0x34, 0x12, 0x34, 0x0a, 0x2a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, + 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, + 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x2e, 0x12, + 0x06, 0x0a, 0x04, 0x9a, 0x02, 0x01, 0x07, 0x5a, 0x38, 0x0a, 0x25, 0x0a, 0x0a, 0x41, 0x70, 0x69, + 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x17, 0x08, 0x02, 0x1a, 0x11, 0x58, 0x2d, 0x52, + 0x41, 0x46, 0x41, 0x59, 0x2d, 0x41, 0x50, 0x49, 0x2d, 0x4b, 0x45, 0x59, 0x49, 0x44, 0x20, 0x02, + 0x0a, 0x0f, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x02, 0x08, + 0x01, 0x62, 0x1f, 0x0a, 0x0e, 0x0a, 0x0a, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, + 0x68, 0x12, 0x00, 0x0a, 0x0d, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, + 0x12, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_proto_rpc_system_metro_proto_goTypes = []interface{}{ diff --git a/proto/rpc/system/metro.pb.gw.go b/proto/rpc/system/metro.pb.gw.go index db9c6df..5a24a02 100644 --- a/proto/rpc/system/metro.pb.gw.go +++ b/proto/rpc/system/metro.pb.gw.go @@ -450,7 +450,7 @@ func RegisterLocationHandlerServer(ctx context.Context, mux *runtime.ServeMux, s var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/CreateLocation", runtime.WithHTTPPathPattern("/v3/partner/{metadata.partner}/location")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/CreateLocation", runtime.WithHTTPPathPattern("/infra/v3/partner/{metadata.partner}/location")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -473,7 +473,7 @@ func RegisterLocationHandlerServer(ctx context.Context, mux *runtime.ServeMux, s var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/GetLocations", runtime.WithHTTPPathPattern("/v3/partner/{metadata.partner}/location")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/GetLocations", runtime.WithHTTPPathPattern("/infra/v3/partner/{metadata.partner}/location")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -496,7 +496,7 @@ func RegisterLocationHandlerServer(ctx context.Context, mux *runtime.ServeMux, s var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/GetLocation", runtime.WithHTTPPathPattern("/v3/partner/{metadata.partner}/location/{metadata.name}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/GetLocation", runtime.WithHTTPPathPattern("/infra/v3/partner/{metadata.partner}/location/{metadata.name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -519,7 +519,7 @@ func RegisterLocationHandlerServer(ctx context.Context, mux *runtime.ServeMux, s var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/UpdateLocation", runtime.WithHTTPPathPattern("/v3/partner/{metadata.partner}/location/{metadata.name}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/UpdateLocation", runtime.WithHTTPPathPattern("/infra/v3/partner/{metadata.partner}/location/{metadata.name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -542,7 +542,7 @@ func RegisterLocationHandlerServer(ctx context.Context, mux *runtime.ServeMux, s var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/DeleteLocation", runtime.WithHTTPPathPattern("/v3/partner/{metadata.partner}/location/{metadata.name}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/DeleteLocation", runtime.WithHTTPPathPattern("/infra/v3/partner/{metadata.partner}/location/{metadata.name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -604,7 +604,7 @@ func RegisterLocationHandlerClient(ctx context.Context, mux *runtime.ServeMux, c ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/CreateLocation", runtime.WithHTTPPathPattern("/v3/partner/{metadata.partner}/location")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/CreateLocation", runtime.WithHTTPPathPattern("/infra/v3/partner/{metadata.partner}/location")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -624,7 +624,7 @@ func RegisterLocationHandlerClient(ctx context.Context, mux *runtime.ServeMux, c ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/GetLocations", runtime.WithHTTPPathPattern("/v3/partner/{metadata.partner}/location")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/GetLocations", runtime.WithHTTPPathPattern("/infra/v3/partner/{metadata.partner}/location")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -644,7 +644,7 @@ func RegisterLocationHandlerClient(ctx context.Context, mux *runtime.ServeMux, c ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/GetLocation", runtime.WithHTTPPathPattern("/v3/partner/{metadata.partner}/location/{metadata.name}")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/GetLocation", runtime.WithHTTPPathPattern("/infra/v3/partner/{metadata.partner}/location/{metadata.name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -664,7 +664,7 @@ func RegisterLocationHandlerClient(ctx context.Context, mux *runtime.ServeMux, c ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/UpdateLocation", runtime.WithHTTPPathPattern("/v3/partner/{metadata.partner}/location/{metadata.name}")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/UpdateLocation", runtime.WithHTTPPathPattern("/infra/v3/partner/{metadata.partner}/location/{metadata.name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -684,7 +684,7 @@ func RegisterLocationHandlerClient(ctx context.Context, mux *runtime.ServeMux, c ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/DeleteLocation", runtime.WithHTTPPathPattern("/v3/partner/{metadata.partner}/location/{metadata.name}")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Location/DeleteLocation", runtime.WithHTTPPathPattern("/infra/v3/partner/{metadata.partner}/location/{metadata.name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -704,15 +704,15 @@ func RegisterLocationHandlerClient(ctx context.Context, mux *runtime.ServeMux, c } var ( - pattern_Location_CreateLocation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v3", "partner", "metadata.partner", "location"}, "")) + pattern_Location_CreateLocation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"infra", "v3", "partner", "metadata.partner", "location"}, "")) - pattern_Location_GetLocations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v3", "partner", "metadata.partner", "location"}, "")) + pattern_Location_GetLocations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"infra", "v3", "partner", "metadata.partner", "location"}, "")) - pattern_Location_GetLocation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v3", "partner", "metadata.partner", "location", "metadata.name"}, "")) + pattern_Location_GetLocation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"infra", "v3", "partner", "metadata.partner", "location", "metadata.name"}, "")) - pattern_Location_UpdateLocation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v3", "partner", "metadata.partner", "location", "metadata.name"}, "")) + pattern_Location_UpdateLocation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"infra", "v3", "partner", "metadata.partner", "location", "metadata.name"}, "")) - pattern_Location_DeleteLocation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v3", "partner", "metadata.partner", "location", "metadata.name"}, "")) + pattern_Location_DeleteLocation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"infra", "v3", "partner", "metadata.partner", "location", "metadata.name"}, "")) ) var ( diff --git a/proto/rpc/system/metro.proto b/proto/rpc/system/metro.proto index 7a9fa80..af4667e 100644 --- a/proto/rpc/system/metro.proto +++ b/proto/rpc/system/metro.proto @@ -55,7 +55,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { rpc CreateLocation(rafay.dev.types.infra.v3.Location) returns (rafay.dev.types.infra.v3.Location) { option (google.api.http) = { - post : "/v3/partner/{metadata.partner}/location" + post : "/infra/v3/partner/{metadata.partner}/location" body : "*" }; @@ -72,21 +72,21 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { rpc GetLocations(rafay.dev.types.infra.v3.Location) returns (rafay.dev.types.infra.v3.LocationList) { option (google.api.http) = { - get : "/v3/partner/{metadata.partner}/location" + get : "/infra/v3/partner/{metadata.partner}/location" }; }; rpc GetLocation(rafay.dev.types.infra.v3.Location) returns (rafay.dev.types.infra.v3.Location) { option (google.api.http) = { - get : "/v3/partner/{metadata.partner}/location/{metadata.name}" + get : "/infra/v3/partner/{metadata.partner}/location/{metadata.name}" }; }; rpc UpdateLocation(rafay.dev.types.infra.v3.Location) returns (rafay.dev.types.infra.v3.Location) { option (google.api.http) = { - put : "/v3/partner/{metadata.partner}/location/{metadata.name}" + put : "/infra/v3/partner/{metadata.partner}/location/{metadata.name}" body : "*" }; }; @@ -94,7 +94,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { rpc DeleteLocation(rafay.dev.types.infra.v3.Location) returns (rafay.dev.types.infra.v3.Location) { option (google.api.http) = { - delete : "/v3/partner/{metadata.partner}/location/{metadata.name}" + delete : "/infra/v3/partner/{metadata.partner}/location/{metadata.name}" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { diff --git a/proto/rpc/system/partner.pb.go b/proto/rpc/system/partner.pb.go index 9b10899..ca6edc0 100644 --- a/proto/rpc/system/partner.pb.go +++ b/proto/rpc/system/partner.pb.go @@ -13,6 +13,7 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" + sync "sync" ) const ( @@ -22,6 +23,44 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type EmptyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *EmptyRequest) Reset() { + *x = EmptyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rpc_system_partner_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EmptyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyRequest) ProtoMessage() {} + +func (x *EmptyRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_rpc_system_partner_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyRequest.ProtoReflect.Descriptor instead. +func (*EmptyRequest) Descriptor() ([]byte, []int) { + return file_proto_rpc_system_partner_proto_rawDescGZIP(), []int{0} +} + var File_proto_rpc_system_partner_proto protoreflect.FileDescriptor var file_proto_rpc_system_partner_proto_rawDesc = []byte{ @@ -35,7 +74,8 @@ var file_proto_rpc_system_partner_proto_rawDesc = []byte{ 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, - 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x83, 0x05, 0x0a, 0x07, 0x50, 0x61, 0x72, 0x74, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0xf3, 0x05, 0x0a, 0x07, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x12, 0xb0, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, @@ -55,7 +95,14 @@ var file_proto_rpc_system_partner_proto_rawDesc = []byte{ 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x84, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x6e, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x69, + 0x74, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x22, 0x18, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, + 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x12, 0x84, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x1a, 0x22, 0x2e, 0x72, @@ -113,20 +160,36 @@ var file_proto_rpc_system_partner_proto_rawDesc = []byte{ 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } +var ( + file_proto_rpc_system_partner_proto_rawDescOnce sync.Once + file_proto_rpc_system_partner_proto_rawDescData = file_proto_rpc_system_partner_proto_rawDesc +) + +func file_proto_rpc_system_partner_proto_rawDescGZIP() []byte { + file_proto_rpc_system_partner_proto_rawDescOnce.Do(func() { + file_proto_rpc_system_partner_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_rpc_system_partner_proto_rawDescData) + }) + return file_proto_rpc_system_partner_proto_rawDescData +} + +var file_proto_rpc_system_partner_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_proto_rpc_system_partner_proto_goTypes = []interface{}{ - (*v3.Partner)(nil), // 0: rafay.dev.types.system.v3.Partner + (*EmptyRequest)(nil), // 0: rafay.dev.rpc.v3.EmptyRequest + (*v3.Partner)(nil), // 1: rafay.dev.types.system.v3.Partner } var file_proto_rpc_system_partner_proto_depIdxs = []int32{ - 0, // 0: rafay.dev.rpc.v3.Partner.CreatePartner:input_type -> rafay.dev.types.system.v3.Partner - 0, // 1: rafay.dev.rpc.v3.Partner.GetPartner:input_type -> rafay.dev.types.system.v3.Partner - 0, // 2: rafay.dev.rpc.v3.Partner.UpdatePartner:input_type -> rafay.dev.types.system.v3.Partner - 0, // 3: rafay.dev.rpc.v3.Partner.DeletePartner:input_type -> rafay.dev.types.system.v3.Partner - 0, // 4: rafay.dev.rpc.v3.Partner.CreatePartner:output_type -> rafay.dev.types.system.v3.Partner - 0, // 5: rafay.dev.rpc.v3.Partner.GetPartner:output_type -> rafay.dev.types.system.v3.Partner - 0, // 6: rafay.dev.rpc.v3.Partner.UpdatePartner:output_type -> rafay.dev.types.system.v3.Partner - 0, // 7: rafay.dev.rpc.v3.Partner.DeletePartner:output_type -> rafay.dev.types.system.v3.Partner - 4, // [4:8] is the sub-list for method output_type - 0, // [0:4] is the sub-list for method input_type + 1, // 0: rafay.dev.rpc.v3.Partner.CreatePartner:input_type -> rafay.dev.types.system.v3.Partner + 1, // 1: rafay.dev.rpc.v3.Partner.GetPartner:input_type -> rafay.dev.types.system.v3.Partner + 0, // 2: rafay.dev.rpc.v3.Partner.GetInitPartner:input_type -> rafay.dev.rpc.v3.EmptyRequest + 1, // 3: rafay.dev.rpc.v3.Partner.UpdatePartner:input_type -> rafay.dev.types.system.v3.Partner + 1, // 4: rafay.dev.rpc.v3.Partner.DeletePartner:input_type -> rafay.dev.types.system.v3.Partner + 1, // 5: rafay.dev.rpc.v3.Partner.CreatePartner:output_type -> rafay.dev.types.system.v3.Partner + 1, // 6: rafay.dev.rpc.v3.Partner.GetPartner:output_type -> rafay.dev.types.system.v3.Partner + 1, // 7: rafay.dev.rpc.v3.Partner.GetInitPartner:output_type -> rafay.dev.types.system.v3.Partner + 1, // 8: rafay.dev.rpc.v3.Partner.UpdatePartner:output_type -> rafay.dev.types.system.v3.Partner + 1, // 9: rafay.dev.rpc.v3.Partner.DeletePartner:output_type -> rafay.dev.types.system.v3.Partner + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -137,18 +200,33 @@ func file_proto_rpc_system_partner_proto_init() { if File_proto_rpc_system_partner_proto != nil { return } + if !protoimpl.UnsafeEnabled { + file_proto_rpc_system_partner_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EmptyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_rpc_system_partner_proto_rawDesc, NumEnums: 0, - NumMessages: 0, + NumMessages: 1, NumExtensions: 0, NumServices: 1, }, GoTypes: file_proto_rpc_system_partner_proto_goTypes, DependencyIndexes: file_proto_rpc_system_partner_proto_depIdxs, + MessageInfos: file_proto_rpc_system_partner_proto_msgTypes, }.Build() File_proto_rpc_system_partner_proto = out.File file_proto_rpc_system_partner_proto_rawDesc = nil diff --git a/proto/rpc/system/partner.pb.gw.go b/proto/rpc/system/partner.pb.gw.go index 69f9f63..ba9cba7 100644 --- a/proto/rpc/system/partner.pb.gw.go +++ b/proto/rpc/system/partner.pb.gw.go @@ -136,6 +136,24 @@ func local_request_Partner_GetPartner_0(ctx context.Context, marshaler runtime.M } +func request_Partner_GetInitPartner_0(ctx context.Context, marshaler runtime.Marshaler, client PartnerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EmptyRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetInitPartner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Partner_GetInitPartner_0(ctx context.Context, marshaler runtime.Marshaler, server PartnerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EmptyRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetInitPartner(ctx, &protoReq) + return msg, metadata, err + +} + func request_Partner_UpdatePartner_0(ctx context.Context, marshaler runtime.Marshaler, client PartnerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq systemv3.Partner var metadata runtime.ServerMetadata @@ -326,6 +344,29 @@ func RegisterPartnerHandlerServer(ctx context.Context, mux *runtime.ServeMux, se }) + mux.Handle("GET", pattern_Partner_GetInitPartner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/GetInitPartner", runtime.WithHTTPPathPattern("/auth/v3/partner")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Partner_GetInitPartner_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_GetInitPartner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("PUT", pattern_Partner_UpdatePartner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -453,6 +494,26 @@ func RegisterPartnerHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl }) + mux.Handle("GET", pattern_Partner_GetInitPartner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/GetInitPartner", runtime.WithHTTPPathPattern("/auth/v3/partner")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Partner_GetInitPartner_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_GetInitPartner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("PUT", pattern_Partner_UpdatePartner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -501,6 +562,8 @@ var ( pattern_Partner_GetPartner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"auth", "v3", "partner", "metadata.name"}, "")) + pattern_Partner_GetInitPartner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"auth", "v3", "partner"}, "")) + pattern_Partner_UpdatePartner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"auth", "v3", "partner", "metadata.name"}, "")) pattern_Partner_DeletePartner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"auth", "v3", "partner", "metadata.name"}, "")) @@ -511,6 +574,8 @@ var ( forward_Partner_GetPartner_0 = runtime.ForwardResponseMessage + forward_Partner_GetInitPartner_0 = runtime.ForwardResponseMessage + forward_Partner_UpdatePartner_0 = runtime.ForwardResponseMessage forward_Partner_DeletePartner_0 = runtime.ForwardResponseMessage diff --git a/proto/rpc/system/partner.proto b/proto/rpc/system/partner.proto index 3e7f3a9..5cf5b05 100644 --- a/proto/rpc/system/partner.proto +++ b/proto/rpc/system/partner.proto @@ -51,6 +51,8 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { } }; +message EmptyRequest {} + service Partner { rpc CreatePartner(rafay.dev.types.system.v3.Partner) returns (rafay.dev.types.system.v3.Partner) { @@ -76,6 +78,13 @@ service Partner { }; }; + rpc GetInitPartner(EmptyRequest) + returns (rafay.dev.types.system.v3.Partner) { + option (google.api.http) = { + get : "/auth/v3/partner" + }; + }; + rpc UpdatePartner(rafay.dev.types.system.v3.Partner) returns (rafay.dev.types.system.v3.Partner) { option (google.api.http) = { diff --git a/proto/rpc/system/partner_grpc.pb.go b/proto/rpc/system/partner_grpc.pb.go index fa2ebc8..f2a0f11 100644 --- a/proto/rpc/system/partner_grpc.pb.go +++ b/proto/rpc/system/partner_grpc.pb.go @@ -21,6 +21,7 @@ const _ = grpc.SupportPackageIsVersion7 type PartnerClient interface { CreatePartner(ctx context.Context, in *v3.Partner, opts ...grpc.CallOption) (*v3.Partner, error) GetPartner(ctx context.Context, in *v3.Partner, opts ...grpc.CallOption) (*v3.Partner, error) + GetInitPartner(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*v3.Partner, error) UpdatePartner(ctx context.Context, in *v3.Partner, opts ...grpc.CallOption) (*v3.Partner, error) DeletePartner(ctx context.Context, in *v3.Partner, opts ...grpc.CallOption) (*v3.Partner, error) } @@ -51,6 +52,15 @@ func (c *partnerClient) GetPartner(ctx context.Context, in *v3.Partner, opts ... return out, nil } +func (c *partnerClient) GetInitPartner(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*v3.Partner, error) { + out := new(v3.Partner) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Partner/GetInitPartner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *partnerClient) UpdatePartner(ctx context.Context, in *v3.Partner, opts ...grpc.CallOption) (*v3.Partner, error) { out := new(v3.Partner) err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Partner/UpdatePartner", in, out, opts...) @@ -75,6 +85,7 @@ func (c *partnerClient) DeletePartner(ctx context.Context, in *v3.Partner, opts type PartnerServer interface { CreatePartner(context.Context, *v3.Partner) (*v3.Partner, error) GetPartner(context.Context, *v3.Partner) (*v3.Partner, error) + GetInitPartner(context.Context, *EmptyRequest) (*v3.Partner, error) UpdatePartner(context.Context, *v3.Partner) (*v3.Partner, error) DeletePartner(context.Context, *v3.Partner) (*v3.Partner, error) } @@ -89,6 +100,9 @@ func (UnimplementedPartnerServer) CreatePartner(context.Context, *v3.Partner) (* func (UnimplementedPartnerServer) GetPartner(context.Context, *v3.Partner) (*v3.Partner, error) { return nil, status.Errorf(codes.Unimplemented, "method GetPartner not implemented") } +func (UnimplementedPartnerServer) GetInitPartner(context.Context, *EmptyRequest) (*v3.Partner, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInitPartner not implemented") +} func (UnimplementedPartnerServer) UpdatePartner(context.Context, *v3.Partner) (*v3.Partner, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdatePartner not implemented") } @@ -143,6 +157,24 @@ func _Partner_GetPartner_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Partner_GetInitPartner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PartnerServer).GetInitPartner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Partner/GetInitPartner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PartnerServer).GetInitPartner(ctx, req.(*EmptyRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Partner_UpdatePartner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(v3.Partner) if err := dec(in); err != nil { @@ -194,6 +226,10 @@ var Partner_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetPartner", Handler: _Partner_GetPartner_Handler, }, + { + MethodName: "GetInitPartner", + Handler: _Partner_GetInitPartner_Handler, + }, { MethodName: "UpdatePartner", Handler: _Partner_UpdatePartner_Handler, diff --git a/proto/types/commonpb/v3/rafayconditionstatus.enum.go b/proto/types/commonpb/v3/rafayconditionstatus.enum.go new file mode 100644 index 0000000..24a1272 --- /dev/null +++ b/proto/types/commonpb/v3/rafayconditionstatus.enum.go @@ -0,0 +1,41 @@ +// Code generated by go generate; DO NOT EDIT. +package commonv3 + +import ( + bytes "bytes" + driver "database/sql/driver" +) + +// Scan converts database string to RafayConditionStatus +func (e *RafayConditionStatus) Scan(value interface{}) error { + s := value.([]byte) + *e = RafayConditionStatus(RafayConditionStatus_value[string(s)]) + return nil +} + +// Value converts RafayConditionStatus into database string +func (e RafayConditionStatus) Value() (driver.Value, error) { + return RafayConditionStatus_name[int32(e)], nil +} + +// MarshalJSON converts RafayConditionStatus to JSON +func (e RafayConditionStatus) MarshalJSON() ([]byte, error) { + buffer := bytes.NewBufferString("\"") + buffer.WriteString(e.String()) + buffer.WriteString("\"") + return buffer.Bytes(), nil +} + +// UnmarshalJSON converts RafayConditionStatus from JSON +func (e *RafayConditionStatus) UnmarshalJSON(b []byte) error { + if b != nil { + var length int + if len(b) > 1 { length = len(b) - 1 } else { length = len(b) } + *e = RafayConditionStatus(RafayConditionStatus_value[string(b[1:length])]) + } + return nil +} + +// implement proto enum interface +func (e RafayConditionStatus) IsEnum() { +} diff --git a/proto/types/systempb/v3/project.pb.go b/proto/types/systempb/v3/project.pb.go index 4c1af2f..7437090 100644 --- a/proto/types/systempb/v3/project.pb.go +++ b/proto/types/systempb/v3/project.pb.go @@ -7,7 +7,8 @@ package systemv3 import ( - v3 "github.com/RafayLabs/rcloud-base/proto/types/commonpb/v3" + v31 "github.com/RafayLabs/rcloud-base/proto/types/commonpb/v3" + v3 "github.com/RafayLabs/rcloud-base/proto/types/userpb/v3" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -28,7 +29,9 @@ type ProjectSpec struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Default bool `protobuf:"varint,1,opt,name=default,proto3" json:"default,omitempty"` + Default bool `protobuf:"varint,1,opt,name=default,proto3" json:"default,omitempty"` + ProjectNamespaceRoles []*v3.ProjectNamespaceRole `protobuf:"bytes,2,rep,name=projectNamespaceRoles,proto3" json:"projectNamespaceRoles,omitempty"` + UserRoles []*v3.UserRole `protobuf:"bytes,3,rep,name=userRoles,proto3" json:"userRoles,omitempty"` } func (x *ProjectSpec) Reset() { @@ -70,16 +73,30 @@ func (x *ProjectSpec) GetDefault() bool { return false } +func (x *ProjectSpec) GetProjectNamespaceRoles() []*v3.ProjectNamespaceRole { + if x != nil { + return x.ProjectNamespaceRoles + } + return nil +} + +func (x *ProjectSpec) GetUserRoles() []*v3.UserRole { + if x != nil { + return x.UserRoles + } + return nil +} + type Project struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ApiVersion string `protobuf:"bytes,1,opt,name=apiVersion,proto3" json:"apiVersion,omitempty"` - Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` - Metadata *v3.Metadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - Spec *ProjectSpec `protobuf:"bytes,4,opt,name=spec,proto3" json:"spec,omitempty"` - Status *v3.Status `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` + ApiVersion string `protobuf:"bytes,1,opt,name=apiVersion,proto3" json:"apiVersion,omitempty"` + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + Metadata *v31.Metadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Spec *ProjectSpec `protobuf:"bytes,4,opt,name=spec,proto3" json:"spec,omitempty"` + Status *v31.Status `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` } func (x *Project) Reset() { @@ -128,7 +145,7 @@ func (x *Project) GetKind() string { return "" } -func (x *Project) GetMetadata() *v3.Metadata { +func (x *Project) GetMetadata() *v31.Metadata { if x != nil { return x.Metadata } @@ -142,7 +159,7 @@ func (x *Project) GetSpec() *ProjectSpec { return nil } -func (x *Project) GetStatus() *v3.Status { +func (x *Project) GetStatus() *v31.Status { if x != nil { return x.Status } @@ -154,10 +171,10 @@ type ProjectList struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ApiVersion string `protobuf:"bytes,1,opt,name=apiVersion,proto3" json:"apiVersion,omitempty"` - Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` - Metadata *v3.ListMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - Items []*Project `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"` + ApiVersion string `protobuf:"bytes,1,opt,name=apiVersion,proto3" json:"apiVersion,omitempty"` + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + Metadata *v31.ListMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Items []*Project `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"` } func (x *ProjectList) Reset() { @@ -206,7 +223,7 @@ func (x *ProjectList) GetKind() string { return "" } -func (x *ProjectList) GetMetadata() *v3.ListMetadata { +func (x *ProjectList) GetMetadata() *v31.ListMetadata { if x != nil { return x.Metadata } @@ -232,98 +249,122 @@ var file_proto_types_systempb_v3_project_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, - 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaf, 0x01, 0x0a, 0x0b, 0x50, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x6b, 0x0a, 0x07, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x51, 0x92, 0x41, 0x4e, 0x2a, - 0x07, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x32, 0x43, 0x66, 0x6c, 0x61, 0x67, 0x20, 0x74, - 0x6f, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, - 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x33, 0x92, 0x41, 0x30, 0x0a, 0x2e, 0x2a, 0x15, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x15, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x73, 0x70, - 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x98, 0x04, 0x0a, 0x07, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x65, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x45, 0x92, 0x41, 0x42, - 0x2a, 0x0b, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x1b, 0x41, - 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x14, 0x73, 0x79, 0x73, 0x74, - 0x65, 0x6d, 0x2e, 0x6b, 0x38, 0x73, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x33, - 0x40, 0x01, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, - 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2a, 0x92, 0x41, - 0x27, 0x2a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x32, 0x14, 0x4b, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x66, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x07, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x40, 0x01, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x68, - 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x27, 0x92, 0x41, 0x24, 0x2a, 0x08, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x32, 0x18, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, - 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x5b, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, - 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, - 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x42, 0x1f, - 0x92, 0x41, 0x1c, 0x2a, 0x04, 0x53, 0x70, 0x65, 0x63, 0x32, 0x14, 0x53, 0x70, 0x65, 0x63, 0x20, - 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x60, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, - 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, - 0x33, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x25, 0x92, 0x41, 0x22, 0x2a, 0x06, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x16, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x20, 0x6f, 0x66, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x3d, 0x92, 0x41, 0x3a, 0x0a, 0x38, 0x2a, 0x07, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x32, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0xd2, 0x01, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0xd2, 0x01, 0x04, - 0x6b, 0x69, 0x6e, 0x64, 0xd2, 0x01, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xd2, - 0x01, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0xb8, 0x03, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x6a, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x4a, 0x92, 0x41, 0x47, 0x2a, - 0x0b, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x20, 0x41, 0x50, - 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x14, - 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x6b, 0x38, 0x73, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x69, - 0x6f, 0x2f, 0x76, 0x33, 0x40, 0x01, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x2f, 0x92, 0x41, 0x2c, 0x2a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x32, 0x19, 0x4b, 0x69, 0x6e, - 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x40, - 0x01, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x77, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x72, 0x61, 0x66, 0x61, - 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x42, 0x32, 0x92, 0x41, 0x2f, 0x2a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0x1d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, - 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x5d, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x42, 0x23, 0x92, 0x41, 0x20, 0x2a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x32, - 0x15, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x40, 0x01, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x3a, - 0x20, 0x92, 0x41, 0x1d, 0x0a, 0x1b, 0x2a, 0x0b, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4c, - 0x69, 0x73, 0x74, 0x32, 0x0c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x6c, 0x69, 0x73, - 0x74, 0x42, 0xfc, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, - 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x2e, 0x76, 0x33, 0x42, 0x0c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x72, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x70, 0x62, 0x2f, 0x76, 0x33, - 0x3b, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x76, 0x33, 0xa2, 0x02, 0x04, 0x52, 0x44, 0x54, 0x53, - 0xaa, 0x02, 0x19, 0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x54, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x19, 0x52, - 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x53, - 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x25, 0x52, 0x61, 0x66, 0x61, 0x79, - 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x53, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x1d, 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x54, - 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x3a, 0x3a, 0x56, 0x33, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2f, + 0x76, 0x33, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, + 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe4, + 0x03, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x6b, + 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, + 0x51, 0x92, 0x41, 0x4e, 0x2a, 0x07, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x32, 0x43, 0x66, + 0x6c, 0x61, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, + 0x69, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x69, + 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0xb2, 0x01, 0x0a, 0x15, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, + 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x4d, 0x92, 0x41, 0x4a, 0x2a, + 0x15, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x32, 0x31, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2c, + 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2c, 0x20, 0x72, 0x6f, 0x6c, 0x65, + 0x20, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x69, + 0x74, 0x68, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x15, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, + 0x12, 0x7e, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x3d, 0x92, 0x41, 0x3a, 0x2a, 0x09, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x32, 0x2d, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x73, + 0x20, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x73, + 0x3a, 0x33, 0x92, 0x41, 0x30, 0x0a, 0x2e, 0x2a, 0x15, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x15, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x98, 0x04, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x12, 0x65, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x45, 0x92, 0x41, 0x42, 0x2a, 0x0b, 0x41, 0x50, 0x49, 0x20, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x1b, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x3a, 0x14, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x6b, 0x38, 0x73, + 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x33, 0x40, 0x01, 0x52, 0x0a, 0x61, 0x70, + 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2a, 0x92, 0x41, 0x27, 0x2a, 0x04, 0x4b, 0x69, 0x6e, + 0x64, 0x32, 0x14, 0x4b, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x40, 0x01, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x68, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x72, 0x61, 0x66, + 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, + 0x27, 0x92, 0x41, 0x24, 0x2a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0x18, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x5b, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x42, 0x1f, 0x92, 0x41, 0x1c, 0x2a, 0x04, 0x53, + 0x70, 0x65, 0x63, 0x32, 0x14, 0x53, 0x70, 0x65, 0x63, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, + 0x60, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x42, 0x25, 0x92, 0x41, 0x22, 0x2a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, + 0x16, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x3a, 0x3d, 0x92, 0x41, 0x3a, 0x0a, 0x38, 0x2a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x32, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0xd2, 0x01, 0x0a, 0x61, 0x70, 0x69, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0xd2, 0x01, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0xd2, 0x01, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xd2, 0x01, 0x04, 0x73, 0x70, 0x65, 0x63, + 0x22, 0xb8, 0x03, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x6a, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x4a, 0x92, 0x41, 0x47, 0x2a, 0x0b, 0x41, 0x50, 0x49, 0x20, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x20, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x14, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x2e, 0x6b, 0x38, 0x73, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x33, 0x40, 0x01, + 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x04, + 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0x92, 0x41, 0x2c, 0x2a, + 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x32, 0x19, 0x4b, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x3a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x40, 0x01, 0x52, 0x04, 0x6b, 0x69, 0x6e, + 0x64, 0x12, 0x77, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x32, 0x92, 0x41, + 0x2f, 0x2a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, + 0x1d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x40, 0x01, + 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x5d, 0x0a, 0x05, 0x69, 0x74, + 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x23, 0x92, + 0x41, 0x20, 0x2a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x32, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x20, + 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x40, 0x01, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x3a, 0x20, 0x92, 0x41, 0x1d, 0x0a, 0x1b, + 0x2a, 0x0b, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x32, 0x0c, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x42, 0xfc, 0x01, 0x0a, 0x1d, + 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x42, 0x0c, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x44, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x72, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, + 0x73, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x73, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x3b, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x76, 0x33, 0xa2, 0x02, 0x04, 0x52, 0x44, 0x54, 0x53, 0xaa, 0x02, 0x19, 0x52, 0x61, 0x66, + 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x19, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, + 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5c, + 0x56, 0x33, 0xe2, 0x02, 0x25, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, + 0x79, 0x70, 0x65, 0x73, 0x5c, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5c, 0x56, 0x33, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x52, 0x61, 0x66, + 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -340,24 +381,28 @@ func file_proto_types_systempb_v3_project_proto_rawDescGZIP() []byte { var file_proto_types_systempb_v3_project_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_proto_types_systempb_v3_project_proto_goTypes = []interface{}{ - (*ProjectSpec)(nil), // 0: rafay.dev.types.system.v3.ProjectSpec - (*Project)(nil), // 1: rafay.dev.types.system.v3.Project - (*ProjectList)(nil), // 2: rafay.dev.types.system.v3.ProjectList - (*v3.Metadata)(nil), // 3: rafay.dev.types.common.v3.Metadata - (*v3.Status)(nil), // 4: rafay.dev.types.common.v3.Status - (*v3.ListMetadata)(nil), // 5: rafay.dev.types.common.v3.ListMetadata + (*ProjectSpec)(nil), // 0: rafay.dev.types.system.v3.ProjectSpec + (*Project)(nil), // 1: rafay.dev.types.system.v3.Project + (*ProjectList)(nil), // 2: rafay.dev.types.system.v3.ProjectList + (*v3.ProjectNamespaceRole)(nil), // 3: rafay.dev.types.user.v3.ProjectNamespaceRole + (*v3.UserRole)(nil), // 4: rafay.dev.types.user.v3.UserRole + (*v31.Metadata)(nil), // 5: rafay.dev.types.common.v3.Metadata + (*v31.Status)(nil), // 6: rafay.dev.types.common.v3.Status + (*v31.ListMetadata)(nil), // 7: rafay.dev.types.common.v3.ListMetadata } var file_proto_types_systempb_v3_project_proto_depIdxs = []int32{ - 3, // 0: rafay.dev.types.system.v3.Project.metadata:type_name -> rafay.dev.types.common.v3.Metadata - 0, // 1: rafay.dev.types.system.v3.Project.spec:type_name -> rafay.dev.types.system.v3.ProjectSpec - 4, // 2: rafay.dev.types.system.v3.Project.status:type_name -> rafay.dev.types.common.v3.Status - 5, // 3: rafay.dev.types.system.v3.ProjectList.metadata:type_name -> rafay.dev.types.common.v3.ListMetadata - 1, // 4: rafay.dev.types.system.v3.ProjectList.items:type_name -> rafay.dev.types.system.v3.Project - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 3, // 0: rafay.dev.types.system.v3.ProjectSpec.projectNamespaceRoles:type_name -> rafay.dev.types.user.v3.ProjectNamespaceRole + 4, // 1: rafay.dev.types.system.v3.ProjectSpec.userRoles:type_name -> rafay.dev.types.user.v3.UserRole + 5, // 2: rafay.dev.types.system.v3.Project.metadata:type_name -> rafay.dev.types.common.v3.Metadata + 0, // 3: rafay.dev.types.system.v3.Project.spec:type_name -> rafay.dev.types.system.v3.ProjectSpec + 6, // 4: rafay.dev.types.system.v3.Project.status:type_name -> rafay.dev.types.common.v3.Status + 7, // 5: rafay.dev.types.system.v3.ProjectList.metadata:type_name -> rafay.dev.types.common.v3.ListMetadata + 1, // 6: rafay.dev.types.system.v3.ProjectList.items:type_name -> rafay.dev.types.system.v3.Project + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_proto_types_systempb_v3_project_proto_init() } diff --git a/proto/types/systempb/v3/project.proto b/proto/types/systempb/v3/project.proto index 0d20851..51648cb 100644 --- a/proto/types/systempb/v3/project.proto +++ b/proto/types/systempb/v3/project.proto @@ -3,6 +3,8 @@ package rafay.dev.types.system.v3; import "proto/types/commonpb/v3/common.proto"; import "protoc-gen-openapiv2/options/annotations.proto"; +import "proto/types/userpb/v3/group.proto"; +import "proto/types/userpb/v3/user.proto"; import "google/api/field_behavior.proto"; message ProjectSpec { @@ -19,6 +21,16 @@ message ProjectSpec { description : "flag to indicate if this is the default project in the " "organization" } ]; + repeated rafay.dev.types.user.v3.ProjectNamespaceRole projectNamespaceRoles = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "ProjectNamespaceRoles" + description : "Project, namespace, role associations with groups" + } ]; + repeated rafay.dev.types.user.v3.UserRole userRoles = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "UserRoles" + description : "List of users with roles assigned to projects" + } ]; } message Project { diff --git a/proto/types/userpb/v3/group.pb.go b/proto/types/userpb/v3/group.pb.go index 7b35f26..6fba445 100644 --- a/proto/types/userpb/v3/group.pb.go +++ b/proto/types/userpb/v3/group.pb.go @@ -110,6 +110,7 @@ type ProjectNamespaceRole struct { Project *string `protobuf:"bytes,1,opt,name=project,proto3,oneof" json:"project,omitempty"` Namespace *int64 `protobuf:"varint,2,opt,name=namespace,proto3,oneof" json:"namespace,omitempty"` Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` + Group *string `protobuf:"bytes,4,opt,name=group,proto3,oneof" json:"group,omitempty"` } func (x *ProjectNamespaceRole) Reset() { @@ -165,6 +166,13 @@ func (x *ProjectNamespaceRole) GetRole() string { return "" } +func (x *ProjectNamespaceRole) GetGroup() string { + if x != nil && x.Group != nil { + return *x.Group + } + return "" +} + type GroupSpec struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -348,7 +356,7 @@ var file_proto_types_userpb_v3_group_proto_rawDesc = []byte{ 0x75, 0x70, 0x32, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0xd2, 0x01, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0xd2, 0x01, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0xd2, 0x01, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xd2, 0x01, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, - 0x9a, 0x02, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, + 0xd2, 0x02, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0x92, 0x41, 0x12, 0x2a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x32, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, @@ -359,77 +367,80 @@ var file_proto_types_userpb_v3_group_proto_rawDesc = []byte{ 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0f, 0x92, 0x41, 0x0c, 0x2a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x32, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, - 0x65, 0x3a, 0x4f, 0x92, 0x41, 0x4c, 0x0a, 0x4a, 0x2a, 0x14, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x32, 0x32, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, 0x61, 0x6e, - 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x70, 0x61, 0x69, 0x72, - 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x0c, - 0x0a, 0x0a, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0xd8, 0x02, 0x0a, - 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x70, 0x65, 0x63, 0x12, 0xb0, 0x01, 0x0a, 0x15, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, - 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x72, 0x61, 0x66, - 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, - 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x4b, 0x92, 0x41, 0x48, 0x2a, 0x15, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x32, 0x2f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x20, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2c, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, - 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72, - 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x15, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x0a, - 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x23, 0x92, 0x41, - 0x20, 0x2a, 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, 0x32, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, - 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x2c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0x92, 0x41, 0x15, 0x2a, 0x04, 0x54, 0x79, 0x70, - 0x65, 0x32, 0x0d, 0x54, 0x79, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x2f, 0x92, 0x41, 0x2c, 0x0a, 0x2a, 0x2a, 0x13, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x32, 0x13, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa5, 0x03, 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x5a, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3a, 0x92, 0x41, 0x37, 0x2a, 0x0b, - 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x26, 0x41, 0x50, 0x49, - 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x40, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x2c, 0x92, 0x41, 0x29, 0x2a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x32, 0x1f, 0x4b, 0x69, 0x6e, 0x64, + 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x11, 0x92, 0x41, 0x0e, 0x2a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x32, 0x05, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x48, 0x02, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x88, 0x01, 0x01, 0x3a, + 0x4f, 0x92, 0x41, 0x4c, 0x0a, 0x4a, 0x2a, 0x14, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x32, 0x32, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x70, 0x61, 0x69, 0x72, 0x69, 0x6e, + 0x67, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x0c, 0x0a, 0x0a, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x22, 0xd8, 0x02, 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x70, + 0x65, 0x63, 0x12, 0xb0, 0x01, 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x6f, 0x6c, + 0x65, 0x42, 0x4b, 0x92, 0x41, 0x48, 0x2a, 0x15, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x32, 0x2f, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x2c, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x15, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x09, 0x42, 0x23, 0x92, 0x41, 0x20, 0x2a, 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, + 0x32, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x73, 0x20, + 0x66, 0x6f, 0x72, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x12, 0x2c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0x92, 0x41, 0x15, 0x2a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x32, 0x0d, 0x54, 0x79, 0x70, 0x65, 0x20, + 0x6f, 0x66, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x2f, + 0x92, 0x41, 0x2c, 0x0a, 0x2a, 0x2a, 0x13, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x53, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x13, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0xa5, 0x03, 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x5a, 0x0a, + 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x3a, 0x92, 0x41, 0x37, 0x2a, 0x0b, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x32, 0x26, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x6c, 0x69, - 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, 0x04, 0x6b, - 0x69, 0x6e, 0x64, 0x12, 0x79, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, - 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, - 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x34, - 0x92, 0x41, 0x31, 0x2a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0x23, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x40, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x5f, - 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, 0x0a, 0x61, + 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x04, 0x6b, 0x69, 0x6e, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2c, 0x92, 0x41, 0x29, 0x2a, 0x04, 0x4b, 0x69, + 0x6e, 0x64, 0x32, 0x1f, 0x4b, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x79, 0x0a, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x29, 0x92, - 0x41, 0x26, 0x2a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x32, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x20, - 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x40, 0x01, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x3a, - 0x1e, 0x92, 0x41, 0x1b, 0x0a, 0x19, 0x2a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, - 0x74, 0x32, 0x0a, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x40, 0x01, 0x42, - 0xec, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, - 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, - 0x0a, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, - 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x72, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, - 0x73, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, - 0x73, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x76, 0x33, 0xa2, - 0x02, 0x04, 0x52, 0x44, 0x54, 0x55, 0xaa, 0x02, 0x17, 0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, - 0x65, 0x76, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x2e, 0x56, 0x33, - 0xca, 0x02, 0x17, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, - 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x23, 0x52, 0x61, 0x66, - 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, - 0x72, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x1b, 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x54, - 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x55, 0x73, 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x34, 0x92, 0x41, 0x31, 0x2a, 0x08, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0x23, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, + 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x6c, 0x69, 0x73, + 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x5f, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, + 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x29, 0x92, 0x41, 0x26, 0x2a, 0x05, 0x49, 0x74, 0x65, 0x6d, + 0x73, 0x32, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x40, 0x01, + 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x3a, 0x1e, 0x92, 0x41, 0x1b, 0x0a, 0x19, 0x2a, 0x09, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x32, 0x0a, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x20, 0x6c, 0x69, 0x73, 0x74, 0x40, 0x01, 0x42, 0xec, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, + 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0a, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x72, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, + 0x3b, 0x75, 0x73, 0x65, 0x72, 0x76, 0x33, 0xa2, 0x02, 0x04, 0x52, 0x44, 0x54, 0x55, 0xaa, 0x02, + 0x17, 0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x17, 0x52, 0x61, 0x66, 0x61, 0x79, + 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x5c, + 0x56, 0x33, 0xe2, 0x02, 0x23, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, + 0x79, 0x70, 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x52, 0x61, 0x66, 0x61, 0x79, + 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x55, 0x73, + 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/types/userpb/v3/group.proto b/proto/types/userpb/v3/group.proto index 569321b..620bacb 100644 --- a/proto/types/userpb/v3/group.proto +++ b/proto/types/userpb/v3/group.proto @@ -65,6 +65,11 @@ message ProjectNamespaceRole { title : "Role" description : "Role" } ]; + optional string group = 4 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Group" + description : "Group" + } ]; } message GroupSpec { diff --git a/proto/types/userpb/v3/user.pb.go b/proto/types/userpb/v3/user.pb.go index 7d83870..2dd3655 100644 --- a/proto/types/userpb/v3/user.pb.go +++ b/proto/types/userpb/v3/user.pb.go @@ -276,6 +276,61 @@ func (x *UserList) GetItems() []*User { return nil } +type UserRole struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` +} + +func (x *UserRole) Reset() { + *x = UserRole{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_userpb_v3_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserRole) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserRole) ProtoMessage() {} + +func (x *UserRole) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_userpb_v3_user_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserRole.ProtoReflect.Descriptor instead. +func (*UserRole) Descriptor() ([]byte, []int) { + return file_proto_types_userpb_v3_user_proto_rawDescGZIP(), []int{3} +} + +func (x *UserRole) GetUser() string { + if x != nil { + return x.User + } + return "" +} + +func (x *UserRole) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + var File_proto_types_userpb_v3_user_proto protoreflect.FileDescriptor var file_proto_types_userpb_v3_user_proto_rawDesc = []byte{ @@ -406,22 +461,31 @@ var file_proto_types_userpb_v3_user_proto_rawDesc = []byte{ 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x40, 0x01, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x3a, 0x1c, 0x92, 0x41, 0x19, 0x0a, 0x17, 0x2a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x32, 0x09, 0x55, 0x73, 0x65, 0x72, 0x20, - 0x6c, 0x69, 0x73, 0x74, 0x40, 0x01, 0x42, 0xeb, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x72, - 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, - 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x09, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x72, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x3b, 0x75, - 0x73, 0x65, 0x72, 0x76, 0x33, 0xa2, 0x02, 0x04, 0x52, 0x44, 0x54, 0x55, 0xaa, 0x02, 0x17, 0x52, - 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x17, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, - 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x56, 0x33, - 0xe2, 0x02, 0x23, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, - 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, 0x3a, - 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x55, 0x73, 0x65, 0x72, - 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x69, 0x73, 0x74, 0x40, 0x01, 0x22, 0x88, 0x01, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x6f, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x0f, 0x92, 0x41, 0x0c, 0x2a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x32, 0x04, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0f, 0x92, 0x41, 0x0c, 0x2a, 0x04, 0x52, 0x6f, 0x6c, + 0x65, 0x32, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x3a, 0x32, 0x92, + 0x41, 0x2f, 0x0a, 0x2d, 0x2a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x32, 0x21, + 0x55, 0x73, 0x65, 0x72, 0x2c, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, 0x70, 0x61, 0x69, 0x72, 0x69, + 0x6e, 0x67, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x42, 0xeb, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, + 0x33, 0x42, 0x09, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x61, 0x66, 0x61, 0x79, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x72, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x62, + 0x61, 0x73, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x76, 0x33, + 0xa2, 0x02, 0x04, 0x52, 0x44, 0x54, 0x55, 0xaa, 0x02, 0x17, 0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, + 0x44, 0x65, 0x76, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x2e, 0x56, + 0x33, 0xca, 0x02, 0x17, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, + 0x70, 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x23, 0x52, 0x61, + 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x55, 0x73, + 0x65, 0x72, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x1b, 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, + 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x55, 0x73, 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x33, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -436,22 +500,23 @@ func file_proto_types_userpb_v3_user_proto_rawDescGZIP() []byte { return file_proto_types_userpb_v3_user_proto_rawDescData } -var file_proto_types_userpb_v3_user_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_proto_types_userpb_v3_user_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_proto_types_userpb_v3_user_proto_goTypes = []interface{}{ (*User)(nil), // 0: rafay.dev.types.user.v3.User (*UserSpec)(nil), // 1: rafay.dev.types.user.v3.UserSpec (*UserList)(nil), // 2: rafay.dev.types.user.v3.UserList - (*v3.Metadata)(nil), // 3: rafay.dev.types.common.v3.Metadata - (*v3.Status)(nil), // 4: rafay.dev.types.common.v3.Status - (*ProjectNamespaceRole)(nil), // 5: rafay.dev.types.user.v3.ProjectNamespaceRole - (*v3.ListMetadata)(nil), // 6: rafay.dev.types.common.v3.ListMetadata + (*UserRole)(nil), // 3: rafay.dev.types.user.v3.UserRole + (*v3.Metadata)(nil), // 4: rafay.dev.types.common.v3.Metadata + (*v3.Status)(nil), // 5: rafay.dev.types.common.v3.Status + (*ProjectNamespaceRole)(nil), // 6: rafay.dev.types.user.v3.ProjectNamespaceRole + (*v3.ListMetadata)(nil), // 7: rafay.dev.types.common.v3.ListMetadata } var file_proto_types_userpb_v3_user_proto_depIdxs = []int32{ - 3, // 0: rafay.dev.types.user.v3.User.metadata:type_name -> rafay.dev.types.common.v3.Metadata + 4, // 0: rafay.dev.types.user.v3.User.metadata:type_name -> rafay.dev.types.common.v3.Metadata 1, // 1: rafay.dev.types.user.v3.User.spec:type_name -> rafay.dev.types.user.v3.UserSpec - 4, // 2: rafay.dev.types.user.v3.User.status:type_name -> rafay.dev.types.common.v3.Status - 5, // 3: rafay.dev.types.user.v3.UserSpec.projectNamespaceRoles:type_name -> rafay.dev.types.user.v3.ProjectNamespaceRole - 6, // 4: rafay.dev.types.user.v3.UserList.metadata:type_name -> rafay.dev.types.common.v3.ListMetadata + 5, // 2: rafay.dev.types.user.v3.User.status:type_name -> rafay.dev.types.common.v3.Status + 6, // 3: rafay.dev.types.user.v3.UserSpec.projectNamespaceRoles:type_name -> rafay.dev.types.user.v3.ProjectNamespaceRole + 7, // 4: rafay.dev.types.user.v3.UserList.metadata:type_name -> rafay.dev.types.common.v3.ListMetadata 0, // 5: rafay.dev.types.user.v3.UserList.items:type_name -> rafay.dev.types.user.v3.User 6, // [6:6] is the sub-list for method output_type 6, // [6:6] is the sub-list for method input_type @@ -503,6 +568,18 @@ func file_proto_types_userpb_v3_user_proto_init() { return nil } } + file_proto_types_userpb_v3_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserRole); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -510,7 +587,7 @@ func file_proto_types_userpb_v3_user_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_types_userpb_v3_user_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/types/userpb/v3/user.proto b/proto/types/userpb/v3/user.proto index 1719080..215d4f7 100644 --- a/proto/types/userpb/v3/user.proto +++ b/proto/types/userpb/v3/user.proto @@ -134,3 +134,22 @@ message UserList { read_only : true } ]; } + +message UserRole { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "UserRole" + description : "User, role pairing for permission" + } + }; + string user = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "User" + description : "User" + } ]; + string role = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Role" + description : "Role" + } ]; +} diff --git a/scripts/initialize/main.go b/scripts/initialize/main.go index ec2e132..fad1776 100644 --- a/scripts/initialize/main.go +++ b/scripts/initialize/main.go @@ -11,9 +11,9 @@ import ( "os" "path" + "github.com/RafayLabs/rcloud-base/internal/dao" "github.com/RafayLabs/rcloud-base/internal/models" - providers "github.com/RafayLabs/rcloud-base/internal/persistence/provider/kratos" - "github.com/RafayLabs/rcloud-base/internal/persistence/provider/pg" + providers "github.com/RafayLabs/rcloud-base/internal/provider/kratos" "github.com/RafayLabs/rcloud-base/pkg/common" "github.com/RafayLabs/rcloud-base/pkg/enforcer" "github.com/RafayLabs/rcloud-base/pkg/service" @@ -77,7 +77,7 @@ func addResourcePermissions(db *bun.DB, basePath string) error { } fmt.Println("Adding", len(items), "resource permissions") - _, err = pg.Create(context.Background(), db, &items) + _, err = dao.Create(context.Background(), db, &items) return err } @@ -151,14 +151,14 @@ func main() { if err != nil { log.Fatal("unable to init enforcer", "error", err) } - as := service.NewAuthzService(gormDb, enforcer) + as := service.NewAuthzService(db, enforcer) ps := service.NewPartnerService(db) os := service.NewOrganizationService(db) rs := service.NewRoleService(db, as) us := service.NewUserService(providers.NewKratosAuthProvider(kc), db, as, nil, common.CliConfigDownloadData{}) - err = pg.HardDeleteAll(context.Background(), db, &models.ResourcePermission{}) + err = dao.HardDeleteAll(context.Background(), db, &models.ResourcePermission{}) if err != nil { log.Fatal(err) } diff --git a/server/bootstrap.go b/server/bootstrap.go index 83a907d..a198ced 100644 --- a/server/bootstrap.go +++ b/server/bootstrap.go @@ -276,6 +276,12 @@ func (s *bootstrapServer) updateClusterStatus(ctx context.Context, clusterID str LastUpdated: timestamppb.Now(), Reason: "Relay agent established connection.", }, + { + Type: infrav3.ClusterConditionType_ClusterReady, + Status: commonv3.RafayConditionStatus_Success, + LastUpdated: timestamppb.Now(), + Reason: "Relay agent established connection.", + }, }, }, }, diff --git a/server/kubeconfig.go b/server/kubeconfig.go index 8d7bec4..99f7cdd 100644 --- a/server/kubeconfig.go +++ b/server/kubeconfig.go @@ -136,6 +136,7 @@ func (s *kubeConfigServer) GetUserSetting(ctx context.Context, req *sentryrpc.Ge } ks, err := s.kss.Get(ctx, opts.Organization, accountID, false) if err == constants.ErrNotFound { + req.Opts.UrlScope = "organization/" + opts.Organization return s.GetOrganizationSetting(ctx, req) } else if err != nil { return nil, err diff --git a/server/partner.go b/server/partner.go index 2876635..ef09fc5 100644 --- a/server/partner.go +++ b/server/partner.go @@ -46,6 +46,15 @@ func (s *partnerServer) DeletePartner(ctx context.Context, req *systempbv3.Partn return updatePartnerStatus(req, resp, err), err } +func (s *partnerServer) GetInitPartner(ctx context.Context, req *systemrpc.EmptyRequest) (*systempbv3.Partner, error) { + + partner, err := s.GetOnlyPartner(ctx) + if err != nil { + return nil, err + } + return partner, nil +} + func (s *partnerServer) UpdatePartner(ctx context.Context, req *systempbv3.Partner) (*systempbv3.Partner, error) { resp, err := s.Update(ctx, req) return updatePartnerStatus(req, resp, err), err From 2e159502ad59c74d5e680e1bc0efec7b691b3382 Mon Sep 17 00:00:00 2001 From: nirav-rafay Date: Thu, 24 Mar 2022 23:32:45 +0530 Subject: [PATCH 2/3] fixed test file --- pkg/service/project_test.go | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/pkg/service/project_test.go b/pkg/service/project_test.go index fab3d23..f99ec11 100644 --- a/pkg/service/project_test.go +++ b/pkg/service/project_test.go @@ -21,13 +21,8 @@ func TestCreateProject(t *testing.T) { db, mock := getDB(t) defer db.Close() -<<<<<<< Updated upstream - ps := NewProjectService(db) -======= mazc := mockAuthzClient{} ps := NewProjectService(db, &mazc) - defer ps.Close() ->>>>>>> Stashed changes puuid := uuid.New().String() ouuid := uuid.New().String() @@ -53,13 +48,8 @@ func TestCreateProjectDuplicate(t *testing.T) { db, mock := getDB(t) defer db.Close() -<<<<<<< Updated upstream - gs := NewProjectService(db) -======= mazc := mockAuthzClient{} gs := NewProjectService(db, &mazc) - defer gs.Close() ->>>>>>> Stashed changes puuid := uuid.New().String() @@ -81,13 +71,8 @@ func TestProjectDelete(t *testing.T) { db, mock := getDB(t) defer db.Close() -<<<<<<< Updated upstream - ps := NewProjectService(db) -======= mazc := mockAuthzClient{} ps := NewProjectService(db, &mazc) - defer ps.Close() ->>>>>>> Stashed changes puuid := uuid.New().String() @@ -110,13 +95,8 @@ func TestProjectDeleteNonExist(t *testing.T) { db, mock := getDB(t) defer db.Close() -<<<<<<< Updated upstream - ps := NewProjectService(db) -======= mazc := mockAuthzClient{} ps := NewProjectService(db, &mazc) - defer ps.Close() ->>>>>>> Stashed changes puuid := uuid.New().String() @@ -136,13 +116,8 @@ func TestProjectGetByName(t *testing.T) { db, mock := getDB(t) defer db.Close() -<<<<<<< Updated upstream - ps := NewProjectService(db) -======= mazc := mockAuthzClient{} ps := NewProjectService(db, &mazc) - defer ps.Close() ->>>>>>> Stashed changes partuuid := uuid.New().String() ouuid := uuid.New().String() @@ -170,13 +145,8 @@ func TestProjectGetById(t *testing.T) { db, mock := getDB(t) defer db.Close() -<<<<<<< Updated upstream - ps := NewProjectService(db) -======= mazc := mockAuthzClient{} ps := NewProjectService(db, &mazc) - defer ps.Close() ->>>>>>> Stashed changes puuid := uuid.New().String() @@ -197,13 +167,8 @@ func TestProjectUpdate(t *testing.T) { db, mock := getDB(t) defer db.Close() -<<<<<<< Updated upstream - ps := NewProjectService(db) -======= mazc := mockAuthzClient{} ps := NewProjectService(db, &mazc) - defer ps.Close() ->>>>>>> Stashed changes puuid := uuid.New().String() From f33a7e7a692fe8dfac87639d73677d03500368cb Mon Sep 17 00:00:00 2001 From: nirav-rafay Date: Fri, 25 Mar 2022 15:33:38 +0530 Subject: [PATCH 3/3] fix table reference --- internal/dao/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/dao/user.go b/internal/dao/user.go index d74a1b2..56530ee 100644 --- a/internal/dao/user.go +++ b/internal/dao/user.go @@ -55,7 +55,7 @@ func GetUserRoles(ctx context.Context, db bun.IDB, id uuid.UUID) ([]*userv3.Proj Where("authsrv_projectaccountnamespacerole.account_id = ?", id). Where("authsrv_project.trash = ?", false). Where("authsrv_resourcerole.trash = ?", false). - Where("authsrv_projectaccountresourcerole.trash = ?", false). + Where("authsrv_projectaccountnamespacerole.trash = ?", false). Scan(ctx, &pnr) if err != nil { return nil, err