forked from raystack/frontier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: user service data to serve metadata * fix: should not return error if user email is missing * chore: remove unwanted imports * feat: get group metadata from servicedata * feat: update APIs to use servicedata (#74) * feat: update user API to use servicedata * feat: update group metadata using servicedata service * refactor: user servicedata service to serve metadata (#82) * feat: use servicedata service to serve metadata * feat: change value to jsonb * refactor * fix: e2e-test, user, group and servicedat tests * test: fix * test: fix * test: fix * lint: fix * fix: field name * lint: format * fix: check permission on keys before create/update * lint: formatting * fix: check permission on keys before create/update * refactor: change field name * fix: add consistency to lookup resource * feat: make servicedata key public (#86) * feat: make servicedata key public * fix: schema generator test * test: spicedb image tab * test: fix image repo * test: fix image version * test: fix command * test: remove command flag * test: add e2e-tests * refactor: wildcard role check * test: fix * test: fix * test: fix * test: fix wrong response * fix: self API * test * test * test: update create group test * test: update update group test
- Loading branch information
1 parent
1ba6c1e
commit 7986573
Showing
54 changed files
with
2,140 additions
and
1,061 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
package group | ||
|
||
type Filter struct { | ||
OrganizationID string | ||
OrganizationID string | ||
ProjectID string | ||
ServicedataKeyResourceIDs []string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,9 @@ import ( | |
"github.com/goto/shield/core/servicedata/mocks" | ||
"github.com/goto/shield/core/user" | ||
"github.com/goto/shield/internal/schema" | ||
errorsPkg "github.com/goto/shield/pkg/errors" | ||
"github.com/goto/shield/pkg/logger" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/mock" | ||
) | ||
|
@@ -30,21 +32,21 @@ var ( | |
testProjectSlug = "test-project-slug" | ||
testKey = servicedata.Key{ | ||
ProjectID: "test-project-slug", | ||
Key: "test-key", | ||
Name: "test-key", | ||
Description: "test key no 01", | ||
} | ||
testCreateKey = servicedata.Key{ | ||
URN: "test-project-slug:servicedata_key:test-key", | ||
ProjectID: testProjectID, | ||
ProjectSlug: testProjectSlug, | ||
Key: "test-key", | ||
Name: "test-key", | ||
Description: "test key no 01", | ||
ResourceID: testResourceID, | ||
} | ||
testCreatedKey = servicedata.Key{ | ||
URN: "test-project-slug:servicedata_key:test-key", | ||
ProjectID: testProjectID, | ||
Key: "test-key", | ||
Name: "test-key", | ||
Description: "test key no 01", | ||
ResourceID: testResourceID, | ||
} | ||
|
@@ -131,7 +133,7 @@ func TestService_CreateKey(t *testing.T) { | |
name: "CreateKeyEmpty", | ||
key: servicedata.Key{ | ||
ProjectID: testKey.ProjectID, | ||
Key: "", | ||
Name: "", | ||
Description: testKey.Description, | ||
}, | ||
setup: func(t *testing.T) *servicedata.Service { | ||
|
@@ -183,7 +185,7 @@ func TestService_CreateKey(t *testing.T) { | |
name: "CreateKeyInvalidProjectID", | ||
key: servicedata.Key{ | ||
ProjectID: "invalid-test-project-slug", | ||
Key: testKey.Key, | ||
Name: testKey.Name, | ||
Description: testKey.Description, | ||
}, | ||
email: "[email protected]", | ||
|
@@ -366,7 +368,7 @@ func TestService_Upsert(t *testing.T) { | |
name: "UpsertKeyEmpty", | ||
data: servicedata.ServiceData{ | ||
Key: servicedata.Key{ | ||
Key: "", | ||
Name: "", | ||
}, | ||
}, | ||
setup: func(t *testing.T) *servicedata.Service { | ||
|
@@ -402,7 +404,7 @@ func TestService_Upsert(t *testing.T) { | |
name: "UpsertInvalidProjectID", | ||
data: servicedata.ServiceData{ | ||
Key: servicedata.Key{ | ||
Key: testKey.Key, | ||
Name: testKey.Name, | ||
ProjectID: "invalid-test-project-slug", | ||
}, | ||
}, | ||
|
@@ -480,7 +482,7 @@ func TestService_Upsert(t *testing.T) { | |
testResourceID, action.Action{ID: "edit"}).Return(false, nil) | ||
return servicedata.NewService(testLogger, repository, resourceService, relationService, projectService, userService, activityService) | ||
}, | ||
wantErr: user.ErrInvalidEmail, | ||
wantErr: errorsPkg.ErrForbidden, | ||
}, | ||
{ | ||
name: "UpsertErr", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
package user | ||
|
||
type Filter struct { | ||
Limit int32 | ||
Page int32 | ||
Keyword string | ||
Limit int32 | ||
Page int32 | ||
Keyword string | ||
ProjectID string | ||
ServiceDataKeyResourceIds []string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.