Skip to content

Commit

Permalink
changing type to name in the ObjectType
Browse files Browse the repository at this point in the history
  • Loading branch information
akoserwal committed Jun 5, 2024
1 parent 887b966 commit 862644e
Show file tree
Hide file tree
Showing 18 changed files with 78 additions and 55 deletions.
2 changes: 1 addition & 1 deletion api/health/v1/health.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions api/health/v1/health_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/health/v1/health_http.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/relations/v0/check.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions api/relations/v0/check_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/relations/v0/check_http.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions api/relations/v0/common.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/relations/v0/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ message ObjectReference {

message ObjectType {
string namespace = 1;
string type = 2;
string name = 2;
}
2 changes: 1 addition & 1 deletion api/relations/v0/lookup.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions api/relations/v0/lookup_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/relations/v0/relation_tuples.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 28 additions & 9 deletions api/relations/v0/relation_tuples_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/relations/v0/relation_tuples_http.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/conf/conf.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions internal/data/spicedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,10 @@ func spicedbTypeToKesselType(spicedbType string) *apiV0.ObjectType {
parts := strings.Split(spicedbType, "/")
switch len(parts) {
case 1:
kesselType.Type = parts[0]
kesselType.Name = parts[0]
case 2:
kesselType.Namespace = parts[0]
kesselType.Type = parts[1]
kesselType.Name = parts[1]
default:
return nil //?? Error?
}
Expand All @@ -310,10 +310,10 @@ func spicedbTypeToKesselType(spicedbType string) *apiV0.ObjectType {

func kesselTypeToSpiceDBType(kesselType *apiV0.ObjectType) string {
if kesselType.Namespace != "" {
return fmt.Sprintf("%s/%s", kesselType.Namespace, kesselType.Type)
return fmt.Sprintf("%s/%s", kesselType.Namespace, kesselType.Name)
}

return kesselType.Type
return kesselType.Name
}

func optionalStringToStringPointer(optional string) *string {
Expand Down
2 changes: 1 addition & 1 deletion internal/data/spicedb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ func TestSpiceDbRepository_CheckPermission(t *testing.T) {
}

func simple_type(typename string) *apiV0.ObjectType {
return &apiV0.ObjectType{Type: typename}
return &apiV0.ObjectType{Name: typename}
}

func pointerize(value string) *string { //Used to turn string literals into pointers
Expand Down
Loading

0 comments on commit 862644e

Please sign in to comment.