Skip to content

Commit

Permalink
Revert "feat: add create service data (#47)" (#52)
Browse files Browse the repository at this point in the history
This reverts commit 5ca455c.
  • Loading branch information
mabdh authored May 20, 2024
1 parent 60be8be commit 99904f5
Show file tree
Hide file tree
Showing 34 changed files with 713 additions and 2,579 deletions.
3 changes: 0 additions & 3 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ packages:
RuleService:
config:
filename: "rule_service.go"
ServiceDataService:
config:
filename: "servicedata_service.go"
UserService:
config:
filename: "user_service.go"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ GOVERSION := $(shell go version | cut -d ' ' -f 3 | cut -d '.' -f 2)

.PHONY: build check fmt lint test test-race vet test-cover-html help install proto
.DEFAULT_GOAL := build
PROTON_COMMIT := "7e380e055d82cd8378989354785f6434d8615d70"
PROTON_COMMIT := "8a9467fbc5539da13276eb858b4d91245fb43edd"

install:
@echo "Clean up imports..."
Expand Down
31 changes: 13 additions & 18 deletions cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/goto/shield/core/relation"
"github.com/goto/shield/core/resource"
"github.com/goto/shield/core/role"
"github.com/goto/shield/core/servicedata"
"github.com/goto/shield/core/user"
"github.com/goto/shield/internal/adapter"
"github.com/goto/shield/internal/api"
Expand Down Expand Up @@ -93,7 +92,7 @@ func StartServer(logger *log.Zap, cfg *config.Shield) error {
return err
}

schemaMigrationConfig := schema.NewSchemaMigrationConfig(cfg.App.DefaultSystemEmail, cfg.App.BootstrapServiceDataKey)
schemaMigrationConfig := schema.NewSchemaMigrationConfig(cfg.App.DefaultSystemEmail)

appConfig := activity.AppConfig{Version: config.Version}
var activityRepository activity.Repository
Expand Down Expand Up @@ -221,25 +220,21 @@ func BuildAPIDependencies(
resourceService := resource.NewService(
logger, resourcePGRepository, resourceBlobRepository, relationService, userService, projectService, organizationService, groupService, activityService)

serviceDataRepository := postgres.NewServiceDataRepository(dbc)
serviceDataService := servicedata.NewService(serviceDataRepository, resourceService, relationService, projectService, userService)

relationAdapter := adapter.NewRelation(groupService, userService, relationService)

dependencies := api.Deps{
OrgService: organizationService,
UserService: userService,
ProjectService: projectService,
GroupService: groupService,
RelationService: relationService,
ResourceService: resourceService,
RoleService: roleService,
PolicyService: policyService,
ActionService: actionService,
NamespaceService: namespaceService,
RelationAdapter: relationAdapter,
ActivityService: activityService,
ServiceDataService: serviceDataService,
OrgService: organizationService,
UserService: userService,
ProjectService: projectService,
GroupService: groupService,
RelationService: relationService,
ResourceService: resourceService,
RoleService: roleService,
PolicyService: policyService,
ActionService: actionService,
NamespaceService: namespaceService,
RelationAdapter: relationAdapter,
ActivityService: activityService,
}
return dependencies, nil
}
Expand Down
7 changes: 1 addition & 6 deletions core/namespace/definition.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package namespace

var systemIdsDefinition = []string{DefinitionTeam.ID, DefinitionUser.ID, DefinitionOrg.ID, DefinitionProject.ID, DefinitionServiceDataKey.ID}
var systemIdsDefinition = []string{DefinitionTeam.ID, DefinitionUser.ID, DefinitionOrg.ID, DefinitionProject.ID}

var DefinitionOrg = Namespace{
ID: "shield/organization",
Expand All @@ -21,8 +21,3 @@ var DefinitionUser = Namespace{
ID: "shield/user",
Name: "User",
}

var DefinitionServiceDataKey = Namespace{
ID: "shield/servicedata_key",
Name: "Service Data Key",
}
8 changes: 0 additions & 8 deletions core/servicedata/errors.go

This file was deleted.

110 changes: 0 additions & 110 deletions core/servicedata/service.go

This file was deleted.

23 changes: 0 additions & 23 deletions core/servicedata/servicedata.go

This file was deleted.

2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,6 @@ github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd3
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
Expand Down Expand Up @@ -1950,7 +1949,6 @@ github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9Nz
github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
Expand Down
28 changes: 13 additions & 15 deletions internal/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,22 @@ import (
"github.com/goto/shield/core/resource"
"github.com/goto/shield/core/role"
"github.com/goto/shield/core/rule"
"github.com/goto/shield/core/servicedata"
"github.com/goto/shield/core/user"
"github.com/goto/shield/internal/adapter"
)

type Deps struct {
OrgService *organization.Service
ProjectService *project.Service
GroupService *group.Service
RoleService *role.Service
PolicyService *policy.Service
UserService *user.Service
NamespaceService *namespace.Service
ActionService *action.Service
RelationService *relation.Service
RelationAdapter *adapter.Relation
ResourceService *resource.Service
RuleService *rule.Service
ActivityService *activity.Service
ServiceDataService *servicedata.Service
OrgService *organization.Service
ProjectService *project.Service
GroupService *group.Service
RoleService *role.Service
PolicyService *policy.Service
UserService *user.Service
NamespaceService *namespace.Service
ActionService *action.Service
RelationService *relation.Service
RelationAdapter *adapter.Relation
ResourceService *resource.Service
RuleService *rule.Service
ActivityService *activity.Service
}
94 changes: 0 additions & 94 deletions internal/api/v1beta1/mocks/servicedata_service.go

This file was deleted.

Loading

0 comments on commit 99904f5

Please sign in to comment.