Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: missing audit (#13909)

ecmadao983c1768b749
diff --git a/backend/api/v1/acl.go b/backend/api/v1/acl.go
index 3b1563cd2c..8b8c99de88 100644
--- a/backend/api/v1/acl.go
+++ b/backend/api/v1/acl.go
@@ -234,12 +234,6 @@ var projectRegex = regexp.MustCompile(`^projects/[^/]+`)
var databaseRegex = regexp.MustCompile(`^instances/[^/]+/databases/[^/]+`)
func populateRawResources(ctx context.Context, stores *store.Store, authContext *common.AuthContext, request any, method string) error {
- if authContext.AllowWithoutCredential {
- return nil
- }
- if authContext.AuthMethod != common.AuthMethodIAM {
- return nil
- }
resources, err := getResourceFromRequest(request, method)
if err != nil {
return err
@@ -367,9 +361,6 @@ func getResourceFromSingleRequest(mr protoreflect.Message, shortMethod string) *
isUpdate := strings.HasPrefix(shortMethod, "Update")
isRemove := strings.HasPrefix(shortMethod, "Remove")
isTest := strings.HasPrefix(shortMethod, "Test")
- if !isCreate && !isUpdate && !isRemove && !isTest {
- return nil
- }
var resourceName string
if isCreate {
resourceName = strings.TrimPrefix(shortMethod, "Create")
diff --git a/backend/api/v1/acl_test.go b/backend/api/v1/acl_test.go
index c45c45869c..10cc52cf52 100644
--- a/backend/api/v1/acl_test.go
+++ b/backend/api/v1/acl_test.go
@@ -19,7 +19,9 @@ func TestGetResourceFromRequest(t *testing.T) {
{
request: &v1pb.LoginRequest{Email: "[email protected]"},
method: "/bytebase.v1.AuthService/Login",
- want: nil,
+ want: []*common.Resource{
+ {Workspace: true},
+ },
},
{
request: &v1pb.CreateProjectRequest{