diff --git a/components/authz/main.go b/components/authz/main.go index bbe3d44..5e6dc79 100644 --- a/components/authz/main.go +++ b/components/authz/main.go @@ -11,13 +11,12 @@ import ( log "github.com/RafaySystems/rcloud-base/components/common/pkg/log/v2" "github.com/spf13/viper" "google.golang.org/grpc" - "google.golang.org/grpc/reflection" "gorm.io/driver/postgres" "gorm.io/gorm" ) const ( - serverPortEnv = "SERVER_PORT" + serverPortEnv = "AUTHZ_SERVER_PORT" ) var ( @@ -43,9 +42,6 @@ func setup() { } func start() { - // TODO: check auth context - // ac := authctx.NewAuthContext(db, rc, cryptoCoreHost, cryptoCorePost) - listener, err := net.Listen("tcp", fmt.Sprintf("0.0.0.0:%d", serverPort)) if err != nil { _log.Errorw("unable to listen on server address", "error", err) @@ -54,7 +50,7 @@ func start() { authServer := grpc.NewServer() pb.RegisterAuthzServer(authServer, server.NewAuthzServer(as)) - reflection.Register(authServer) + // reflection.Register(authServer) _log.Info("starting auth service") authServer.Serve(listener) } @@ -63,19 +59,3 @@ func main() { setup() start() } - -// TODO: check authPool, interceptors implementation. Usage: -// if !dev { -// opts = append(opts, _grpc.UnaryInterceptor( -// interceptors.NewAuthInterceptorWithOptions( -// interceptors.WithLogRequest(), -// interceptors.WithAuthPool(authPool), -// interceptors.WithExclude("POST", "/v2/sentry/bootstrap/:templateToken/register"), -// ), -// )) -// defer authPool.Close() -// } else { -// opts = append(opts, _grpc.UnaryInterceptor( -// interceptors.NewAuthInterceptorWithOptions(interceptors.WithDummy())), -// ) -// } diff --git a/components/authz/pkg/server/authz.go b/components/authz/pkg/server/authz.go index e916dab..3705855 100644 --- a/components/authz/pkg/server/authz.go +++ b/components/authz/pkg/server/authz.go @@ -24,19 +24,11 @@ func (s *authzServer) ListPolicies(ctx context.Context, p *authzpbv1.Policy) (*a return s.as.ListPolicies(ctx, p) } -// func (s *authzServer) ListGroupSubPolicies(ctx context.Context, p *authzpbv1.Policy) (*authzpbv1.Policies, error) { -// return s.ListGroupSubPolicies(ctx, p) -// } - func (s *authzServer) CreatePolicies(ctx context.Context, p *authzpbv1.Policies) (*authzpbv1.BoolReply, error) { return s.as.CreatePolicies(ctx, p) } -// func (s *authzServer) CreateGroupSubPolicies(ctx context.Context, p *authzpbv1.Policies) (*authzpbv1.BoolReply, error) { -// return &authzpbv1.BoolReply{}, nil -// } - -func (s *authzServer) DeletePolicies(ctx context.Context, p *authzpbv1.Policies) (*authzpbv1.BoolReply, error) { +func (s *authzServer) DeletePolicies(ctx context.Context, p *authzpbv1.Policy) (*authzpbv1.BoolReply, error) { return s.as.DeletePolicies(ctx, p) } @@ -48,7 +40,7 @@ func (s *authzServer) CreateUserGroups(ctx context.Context, p *authzpbv1.UserGro return s.as.CreateUserGroups(ctx, p) } -func (s *authzServer) DeleteUserGroups(ctx context.Context, p *authzpbv1.UserGroups) (*authzpbv1.BoolReply, error) { +func (s *authzServer) DeleteUserGroups(ctx context.Context, p *authzpbv1.UserGroup) (*authzpbv1.BoolReply, error) { return s.as.DeleteUserGroups(ctx, p) } diff --git a/components/authz/pkg/service/authz.go b/components/authz/pkg/service/authz.go index 8bc932c..a0321b2 100644 --- a/components/authz/pkg/service/authz.go +++ b/components/authz/pkg/service/authz.go @@ -15,13 +15,11 @@ import ( type AuthzService interface { Enforce(context.Context, *authzpbv1.EnforceRequest) (*authzpbv1.BoolReply, error) ListPolicies(context.Context, *authzpbv1.Policy) (*authzpbv1.Policies, error) - // ListGroupSubPolicies(context.Context, *authzpbv1.Policy) (*authzpbv1.Policies, error) CreatePolicies(context.Context, *authzpbv1.Policies) (*authzpbv1.BoolReply, error) - // CreateGroupSubPolicies(context.Context, *authzpbv1.Policies) (*authzpbv1.BoolReply, error) - DeletePolicies(context.Context, *authzpbv1.Policies) (*authzpbv1.BoolReply, error) + DeletePolicies(context.Context, *authzpbv1.Policy) (*authzpbv1.BoolReply, error) ListUserGroups(context.Context, *authzpbv1.UserGroup) (*authzpbv1.UserGroups, error) CreateUserGroups(ctx context.Context, p *authzpbv1.UserGroups) (*authzpbv1.BoolReply, error) - DeleteUserGroups(ctx context.Context, p *authzpbv1.UserGroups) (*authzpbv1.BoolReply, error) + DeleteUserGroups(ctx context.Context, p *authzpbv1.UserGroup) (*authzpbv1.BoolReply, error) ListRolePermissionMappings(ctx context.Context, p *authzpbv1.FilteredRolePermissionMapping) (*authzpbv1.RolePermissionMappingList, error) CreateRolePermissionMappings(ctx context.Context, p *authzpbv1.RolePermissionMappingList) (*authzpbv1.BoolReply, error) DeleteRolePermissionMappings(ctx context.Context, p *authzpbv1.FilteredRolePermissionMapping) (*authzpbv1.BoolReply, error) @@ -39,39 +37,12 @@ func NewAuthzService(db *gorm.DB, en *casbin.CachedEnforcer) AuthzService { } } -// TODO: remove static string conversions -// const ( -// subTypeUser = iota -// subTypeGroup = iota -// ) - -// const ( -// userPrefix = "user:" -// groupPrefix = "group:" -// ) - -// func (s *authzService) addPolicyFieldTags(subType int, p *authzpbv1.Policy) { -// if subType == subTypeUser { -// p.Sub = userPrefix + p.Sub -// } else if subType == subTypeGroup { -// p.Sub = groupPrefix + p.Sub -// } -// } - -// func (s *authzService) removePolicyFieldTags(subType int, p *authzpbv1.Policy) { -// if subType == subTypeUser { -// p.Sub = strings.Replace(p.Sub, userPrefix, "", 1) -// } else if subType == subTypeGroup { -// p.Sub = strings.Replace(p.Sub, groupPrefix, "", 1) -// } -// } - const ( groupGtype = "g2" roleGtype = "g" ) -func (s *authzService) toPolicies( /*subType int,*/ policies [][]string) *authzpbv1.Policies { +func (s *authzService) toPolicies(policies [][]string) *authzpbv1.Policies { if len(policies) == 0 { return &authzpbv1.Policies{} } @@ -87,15 +58,13 @@ func (s *authzService) toPolicies( /*subType int,*/ policies [][]string) *authzp Obj: policies[i][4], Act: policies[i][5], } - // s.removePolicyFieldTags(subType, res.Policies[i]) } return res } -func (s *authzService) fromPolicies( /* subType int, */ policies *authzpbv1.Policies) ([][]string, error) { +func (s *authzService) fromPolicies(policies *authzpbv1.Policies) ([][]string, error) { res := [][]string{} for i, p := range policies.GetPolicies() { - // s.addPolicyFieldTags() rule := []string{p.GetSub(), p.GetNs(), p.GetProj(), p.GetOrg(), p.GetObj(), p.GetAct()} for _, field := range rule { if field == "" { @@ -197,20 +166,14 @@ func (s *authzService) Enforce(ctx context.Context, req *authzpbv1.EnforceReques } func (s *authzService) ListPolicies(ctx context.Context, p *authzpbv1.Policy) (*authzpbv1.Policies, error) { - // s.addPolicyFieldTags(subTypeUser, p) - return s.toPolicies( /* subTypeUser, */ s.enforcer.GetFilteredPolicy(0, p.GetSub(), p.GetNs(), p.GetProj(), p.GetOrg(), p.GetObj(), p.GetAct())), nil + return s.toPolicies(s.enforcer.GetFilteredPolicy(0, p.GetSub(), p.GetNs(), p.GetProj(), p.GetOrg(), p.GetObj(), p.GetAct())), nil } -// func (s *authzService) ListGroupSubPolicies(ctx context.Context, p *authzpbv1.Policy) (*authzpbv1.Policies, error) { -// s.addPolicyFieldTags(subTypeGroup, p) -// return s.toPolicies(subTypeGroup, s.enforcer.GetFilteredPolicy(0, p.GetSub(), p.GetNs(), p.GetProj(), p.GetOrg(), p.GetObj(), p.GetAct())), nil -// } - func (s *authzService) CreatePolicies(ctx context.Context, p *authzpbv1.Policies) (*authzpbv1.BoolReply, error) { if len(p.GetPolicies()) == 0 { return &authzpbv1.BoolReply{Res: false}, nil } - policies, err := s.fromPolicies( /* subTypeUser, */ p) + policies, err := s.fromPolicies(p) if err != nil { return nil, status.Errorf(codes.InvalidArgument, err.Error()) } @@ -223,21 +186,9 @@ func (s *authzService) CreatePolicies(ctx context.Context, p *authzpbv1.Policies return &authzpbv1.BoolReply{Res: res}, nil } -// func (s *authzService) CreateGroupSubPolicies(ctx context.Context, p *authzpbv1.Policies) (*authzpbv1.BoolReply, error) { -// return &authzpbv1.BoolReply{}, nil -// } - -func (s *authzService) DeletePolicies(ctx context.Context, p *authzpbv1.Policies) (*authzpbv1.BoolReply, error) { - if len(p.GetPolicies()) == 0 { - return &authzpbv1.BoolReply{Res: false}, nil - } - policies, err := s.fromPolicies( /* subTypeUser, */ p) - if err != nil { - return nil, status.Errorf(codes.InvalidArgument, err.Error()) - } - +func (s *authzService) DeletePolicies(ctx context.Context, p *authzpbv1.Policy) (*authzpbv1.BoolReply, error) { // err could be from db, policy assertions, cache; dispatcher, watcher updates (not pertinent) - res, err := s.enforcer.RemovePolicies(policies) + res, err := s.enforcer.RemoveFilteredPolicy(0, p.GetSub(), p.GetNs(), p.GetProj(), p.GetOrg(), p.GetObj(), p.GetAct()) if err != nil { return nil, status.Errorf(codes.Internal, err.Error()) } @@ -267,18 +218,9 @@ func (s *authzService) CreateUserGroups(ctx context.Context, p *authzpbv1.UserGr return &authzpbv1.BoolReply{Res: res}, nil } -func (s *authzService) DeleteUserGroups(ctx context.Context, p *authzpbv1.UserGroups) (*authzpbv1.BoolReply, error) { - if len(p.GetUserGroups()) == 0 { - return &authzpbv1.BoolReply{Res: false}, nil - } - - ugs, err := s.fromUserGroups(p) - if err != nil { - return nil, status.Errorf(codes.InvalidArgument, err.Error()) - } - +func (s *authzService) DeleteUserGroups(ctx context.Context, p *authzpbv1.UserGroup) (*authzpbv1.BoolReply, error) { // err could be from db, policy assertions, cache; dispatcher, watcher updates (not pertinent) - res, err := s.enforcer.RemoveNamedGroupingPolicies(groupGtype, ugs) + res, err := s.enforcer.RemoveFilteredNamedGroupingPolicy(groupGtype, 0, p.GetUser(), p.GetGrp()) if err != nil { return nil, status.Errorf(codes.Internal, err.Error()) } diff --git a/components/authz/proto/rpc/v1/authz.pb.go b/components/authz/proto/rpc/v1/authz.pb.go index f012a4e..f22c4a5 100644 --- a/components/authz/proto/rpc/v1/authz.pb.go +++ b/components/authz/proto/rpc/v1/authz.pb.go @@ -30,7 +30,7 @@ var file_proto_rpc_v1_authz_proto_rawDesc = []byte{ 0x76, 0x31, 0x1a, 0x17, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x32, 0xa1, 0x08, 0x0a, 0x05, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x12, 0x5a, 0x0a, 0x07, 0x45, + 0x6f, 0x32, 0x9e, 0x08, 0x0a, 0x05, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x12, 0x5a, 0x0a, 0x07, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x12, 0x28, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, @@ -47,73 +47,73 @@ var file_proto_rpc_v1_authz_proto_rawDesc = []byte{ 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x1a, 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, - 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x0e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x22, + 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x59, 0x0a, 0x0e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, - 0x65, 0x73, 0x1a, 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, - 0x6f, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x0e, 0x4c, 0x69, 0x73, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x23, 0x2e, 0x72, 0x61, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x1a, 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, + 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x1a, 0x24, + 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x73, 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x24, 0x2e, 0x72, 0x61, 0x66, + 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, + 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, + 0x1a, 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x1a, 0x24, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x24, 0x2e, 0x72, - 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x73, 0x1a, 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, - 0x6f, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x10, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x24, 0x2e, - 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x73, 0x1a, 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x42, - 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x8c, 0x01, 0x0a, 0x1a, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x37, 0x2e, 0x72, 0x61, 0x66, 0x61, - 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, - 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x52, 0x6f, 0x6c, - 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x1a, 0x33, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, - 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x12, 0x7a, 0x0a, 0x1c, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x33, 0x2e, 0x72, 0x61, 0x66, 0x61, - 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, - 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x23, - 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x52, 0x65, - 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, - 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x37, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, - 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, - 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, - 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x1a, 0x23, - 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x52, 0x65, - 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x84, 0x02, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, - 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x75, 0x74, 0x68, - 0x7a, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x49, 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, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, - 0x74, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, - 0x70, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x76, 0x31, 0xa2, 0x02, 0x04, - 0x52, 0x44, 0x52, 0x41, 0xaa, 0x02, 0x16, 0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, - 0x2e, 0x52, 0x70, 0x63, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, - 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x41, 0x75, - 0x74, 0x68, 0x7a, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x22, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, - 0x65, 0x76, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x52, 0x61, - 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x52, 0x70, 0x63, 0x3a, 0x3a, 0x41, - 0x75, 0x74, 0x68, 0x7a, 0x3a, 0x3a, 0x56, 0x31, 0xc8, 0xe2, 0x1e, 0x01, 0xd0, 0xe2, 0x1e, 0x01, - 0xe0, 0xe2, 0x1e, 0x01, 0xc0, 0xe3, 0x1e, 0x01, 0xc8, 0xe3, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x1a, 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x8c, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x37, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, + 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, + 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x1a, + 0x33, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x50, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, + 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x12, 0x7a, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x33, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, + 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, + 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, + 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, + 0x67, 0x73, 0x12, 0x37, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x1a, 0x23, 0x2e, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x61, 0x75, + 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x22, 0x00, 0x42, 0x84, 0x02, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, + 0x31, 0x42, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x49, 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, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, + 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, + 0x76, 0x31, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x52, 0x44, 0x52, + 0x41, 0xaa, 0x02, 0x16, 0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x52, 0x70, + 0x63, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x52, 0x61, 0x66, + 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x7a, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x22, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, + 0x52, 0x70, 0x63, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x52, 0x61, 0x66, 0x61, 0x79, + 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x52, 0x70, 0x63, 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x68, + 0x7a, 0x3a, 0x3a, 0x56, 0x31, 0xc8, 0xe2, 0x1e, 0x01, 0xd0, 0xe2, 0x1e, 0x01, 0xe0, 0xe2, 0x1e, + 0x01, 0xc0, 0xe3, 0x1e, 0x01, 0xc8, 0xe3, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var file_proto_rpc_v1_authz_proto_goTypes = []interface{}{ @@ -130,10 +130,10 @@ var file_proto_rpc_v1_authz_proto_depIdxs = []int32{ 0, // 0: rafay.dev.rpc.authz.v1.Authz.Enforce:input_type -> rafay.dev.types.authz.v1.EnforceRequest 1, // 1: rafay.dev.rpc.authz.v1.Authz.ListPolicies:input_type -> rafay.dev.types.authz.v1.Policy 2, // 2: rafay.dev.rpc.authz.v1.Authz.CreatePolicies:input_type -> rafay.dev.types.authz.v1.Policies - 2, // 3: rafay.dev.rpc.authz.v1.Authz.DeletePolicies:input_type -> rafay.dev.types.authz.v1.Policies + 1, // 3: rafay.dev.rpc.authz.v1.Authz.DeletePolicies:input_type -> rafay.dev.types.authz.v1.Policy 3, // 4: rafay.dev.rpc.authz.v1.Authz.ListUserGroups:input_type -> rafay.dev.types.authz.v1.UserGroup 4, // 5: rafay.dev.rpc.authz.v1.Authz.CreateUserGroups:input_type -> rafay.dev.types.authz.v1.UserGroups - 4, // 6: rafay.dev.rpc.authz.v1.Authz.DeleteUserGroups:input_type -> rafay.dev.types.authz.v1.UserGroups + 3, // 6: rafay.dev.rpc.authz.v1.Authz.DeleteUserGroups:input_type -> rafay.dev.types.authz.v1.UserGroup 5, // 7: rafay.dev.rpc.authz.v1.Authz.ListRolePermissionMappings:input_type -> rafay.dev.types.authz.v1.FilteredRolePermissionMapping 6, // 8: rafay.dev.rpc.authz.v1.Authz.CreateRolePermissionMappings:input_type -> rafay.dev.types.authz.v1.RolePermissionMappingList 5, // 9: rafay.dev.rpc.authz.v1.Authz.DeleteRolePermissionMappings:input_type -> rafay.dev.types.authz.v1.FilteredRolePermissionMapping diff --git a/components/authz/proto/rpc/v1/authz.proto b/components/authz/proto/rpc/v1/authz.proto index 3b772dd..80acc3a 100644 --- a/components/authz/proto/rpc/v1/authz.proto +++ b/components/authz/proto/rpc/v1/authz.proto @@ -42,7 +42,7 @@ service Authz { /* rpc CreateGroupSubPolicies (rafay.dev.types.authz.v1.Policies) */ /* returns (rafay.dev.types.authz.v1.BoolReply) {}; */ - rpc DeletePolicies (rafay.dev.types.authz.v1.Policies) + rpc DeletePolicies (rafay.dev.types.authz.v1.Policy) returns (rafay.dev.types.authz.v1.BoolReply) {}; rpc ListUserGroups (rafay.dev.types.authz.v1.UserGroup) @@ -51,7 +51,7 @@ service Authz { rpc CreateUserGroups (rafay.dev.types.authz.v1.UserGroups) returns (rafay.dev.types.authz.v1.BoolReply) {}; - rpc DeleteUserGroups (rafay.dev.types.authz.v1.UserGroups) + rpc DeleteUserGroups (rafay.dev.types.authz.v1.UserGroup) returns (rafay.dev.types.authz.v1.BoolReply) {}; rpc ListRolePermissionMappings (rafay.dev.types.authz.v1.FilteredRolePermissionMapping) diff --git a/components/authz/proto/rpc/v1/authz_grpc.pb.go b/components/authz/proto/rpc/v1/authz_grpc.pb.go index c0e17c6..0ae3862 100644 --- a/components/authz/proto/rpc/v1/authz_grpc.pb.go +++ b/components/authz/proto/rpc/v1/authz_grpc.pb.go @@ -33,10 +33,10 @@ type AuthzClient interface { // Returns policies related to project1 and org1 (Empty string matches all) ListPolicies(ctx context.Context, in *types.Policy, opts ...grpc.CallOption) (*types.Policies, error) CreatePolicies(ctx context.Context, in *types.Policies, opts ...grpc.CallOption) (*types.BoolReply, error) - DeletePolicies(ctx context.Context, in *types.Policies, opts ...grpc.CallOption) (*types.BoolReply, error) + DeletePolicies(ctx context.Context, in *types.Policy, opts ...grpc.CallOption) (*types.BoolReply, error) ListUserGroups(ctx context.Context, in *types.UserGroup, opts ...grpc.CallOption) (*types.UserGroups, error) CreateUserGroups(ctx context.Context, in *types.UserGroups, opts ...grpc.CallOption) (*types.BoolReply, error) - DeleteUserGroups(ctx context.Context, in *types.UserGroups, opts ...grpc.CallOption) (*types.BoolReply, error) + DeleteUserGroups(ctx context.Context, in *types.UserGroup, opts ...grpc.CallOption) (*types.BoolReply, error) ListRolePermissionMappings(ctx context.Context, in *types.FilteredRolePermissionMapping, opts ...grpc.CallOption) (*types.RolePermissionMappingList, error) CreateRolePermissionMappings(ctx context.Context, in *types.RolePermissionMappingList, opts ...grpc.CallOption) (*types.BoolReply, error) DeleteRolePermissionMappings(ctx context.Context, in *types.FilteredRolePermissionMapping, opts ...grpc.CallOption) (*types.BoolReply, error) @@ -77,7 +77,7 @@ func (c *authzClient) CreatePolicies(ctx context.Context, in *types.Policies, op return out, nil } -func (c *authzClient) DeletePolicies(ctx context.Context, in *types.Policies, opts ...grpc.CallOption) (*types.BoolReply, error) { +func (c *authzClient) DeletePolicies(ctx context.Context, in *types.Policy, opts ...grpc.CallOption) (*types.BoolReply, error) { out := new(types.BoolReply) err := c.cc.Invoke(ctx, "/rafay.dev.rpc.authz.v1.Authz/DeletePolicies", in, out, opts...) if err != nil { @@ -104,7 +104,7 @@ func (c *authzClient) CreateUserGroups(ctx context.Context, in *types.UserGroups return out, nil } -func (c *authzClient) DeleteUserGroups(ctx context.Context, in *types.UserGroups, opts ...grpc.CallOption) (*types.BoolReply, error) { +func (c *authzClient) DeleteUserGroups(ctx context.Context, in *types.UserGroup, opts ...grpc.CallOption) (*types.BoolReply, error) { out := new(types.BoolReply) err := c.cc.Invoke(ctx, "/rafay.dev.rpc.authz.v1.Authz/DeleteUserGroups", in, out, opts...) if err != nil { @@ -158,10 +158,10 @@ type AuthzServer interface { // Returns policies related to project1 and org1 (Empty string matches all) ListPolicies(context.Context, *types.Policy) (*types.Policies, error) CreatePolicies(context.Context, *types.Policies) (*types.BoolReply, error) - DeletePolicies(context.Context, *types.Policies) (*types.BoolReply, error) + DeletePolicies(context.Context, *types.Policy) (*types.BoolReply, error) ListUserGroups(context.Context, *types.UserGroup) (*types.UserGroups, error) CreateUserGroups(context.Context, *types.UserGroups) (*types.BoolReply, error) - DeleteUserGroups(context.Context, *types.UserGroups) (*types.BoolReply, error) + DeleteUserGroups(context.Context, *types.UserGroup) (*types.BoolReply, error) ListRolePermissionMappings(context.Context, *types.FilteredRolePermissionMapping) (*types.RolePermissionMappingList, error) CreateRolePermissionMappings(context.Context, *types.RolePermissionMappingList) (*types.BoolReply, error) DeleteRolePermissionMappings(context.Context, *types.FilteredRolePermissionMapping) (*types.BoolReply, error) @@ -180,7 +180,7 @@ func (UnimplementedAuthzServer) ListPolicies(context.Context, *types.Policy) (*t func (UnimplementedAuthzServer) CreatePolicies(context.Context, *types.Policies) (*types.BoolReply, error) { return nil, status.Errorf(codes.Unimplemented, "method CreatePolicies not implemented") } -func (UnimplementedAuthzServer) DeletePolicies(context.Context, *types.Policies) (*types.BoolReply, error) { +func (UnimplementedAuthzServer) DeletePolicies(context.Context, *types.Policy) (*types.BoolReply, error) { return nil, status.Errorf(codes.Unimplemented, "method DeletePolicies not implemented") } func (UnimplementedAuthzServer) ListUserGroups(context.Context, *types.UserGroup) (*types.UserGroups, error) { @@ -189,7 +189,7 @@ func (UnimplementedAuthzServer) ListUserGroups(context.Context, *types.UserGroup func (UnimplementedAuthzServer) CreateUserGroups(context.Context, *types.UserGroups) (*types.BoolReply, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateUserGroups not implemented") } -func (UnimplementedAuthzServer) DeleteUserGroups(context.Context, *types.UserGroups) (*types.BoolReply, error) { +func (UnimplementedAuthzServer) DeleteUserGroups(context.Context, *types.UserGroup) (*types.BoolReply, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteUserGroups not implemented") } func (UnimplementedAuthzServer) ListRolePermissionMappings(context.Context, *types.FilteredRolePermissionMapping) (*types.RolePermissionMappingList, error) { @@ -268,7 +268,7 @@ func _Authz_CreatePolicies_Handler(srv interface{}, ctx context.Context, dec fun } func _Authz_DeletePolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.Policies) + in := new(types.Policy) if err := dec(in); err != nil { return nil, err } @@ -280,7 +280,7 @@ func _Authz_DeletePolicies_Handler(srv interface{}, ctx context.Context, dec fun FullMethod: "/rafay.dev.rpc.authz.v1.Authz/DeletePolicies", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthzServer).DeletePolicies(ctx, req.(*types.Policies)) + return srv.(AuthzServer).DeletePolicies(ctx, req.(*types.Policy)) } return interceptor(ctx, in, info, handler) } @@ -322,7 +322,7 @@ func _Authz_CreateUserGroups_Handler(srv interface{}, ctx context.Context, dec f } func _Authz_DeleteUserGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.UserGroups) + in := new(types.UserGroup) if err := dec(in); err != nil { return nil, err } @@ -334,7 +334,7 @@ func _Authz_DeleteUserGroups_Handler(srv interface{}, ctx context.Context, dec f FullMethod: "/rafay.dev.rpc.authz.v1.Authz/DeleteUserGroups", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthzServer).DeleteUserGroups(ctx, req.(*types.UserGroups)) + return srv.(AuthzServer).DeleteUserGroups(ctx, req.(*types.UserGroup)) } return interceptor(ctx, in, info, handler) }