mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 04:07:31 +00:00
feat: System api (#3461)
* feat: start system api * feat: remove auth * feat: change gitignore * feat: run system api * feat: remove clear view form admin api * feat: search instances * feat: add instance * fix: set primary domain * Update .gitignore * fix: add instance * fix: add instance * fix: handle errors * fix: handle instance name * fix: test Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
package admin_test
|
||||
package admin
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
admin_grpc "github.com/caos/zitadel/internal/api/grpc/admin"
|
||||
"github.com/caos/zitadel/internal/test"
|
||||
"github.com/caos/zitadel/internal/view/model"
|
||||
admin_pb "github.com/caos/zitadel/pkg/grpc/admin"
|
||||
@@ -34,7 +33,7 @@ func TestFailedEventsToPbFields(t *testing.T) {
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got := admin_grpc.FailedEventsViewToPb(tt.args.failedEvents)
|
||||
got := FailedEventsViewToPb(tt.args.failedEvents)
|
||||
for _, g := range got {
|
||||
test.AssertFieldsMapped(t, g)
|
||||
}
|
||||
@@ -64,7 +63,7 @@ func TestFailedEventToPbFields(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
converted := admin_grpc.FailedEventViewToPb(tt.args.failedEvent)
|
||||
converted := FailedEventViewToPb(tt.args.failedEvent)
|
||||
test.AssertFieldsMapped(t, converted)
|
||||
}
|
||||
}
|
||||
@@ -89,7 +88,7 @@ func TestRemoveFailedEventRequestToModelFields(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
converted := admin_grpc.RemoveFailedEventRequestToModel(tt.args.req)
|
||||
converted := RemoveFailedEventRequestToModel(tt.args.req)
|
||||
test.AssertFieldsMapped(t, converted, "FailureCount", "ErrMsg")
|
||||
}
|
||||
}
|
||||
|
@@ -22,16 +22,3 @@ func (s *Server) ListViews(ctx context.Context, _ *admin_pb.ListViewsRequest) (*
|
||||
convertedCurrentSequences = append(convertedCurrentSequences, convertedViews...)
|
||||
return &admin_pb.ListViewsResponse{Result: convertedCurrentSequences}, nil
|
||||
}
|
||||
|
||||
func (s *Server) ClearView(ctx context.Context, req *admin_pb.ClearViewRequest) (*admin_pb.ClearViewResponse, error) {
|
||||
var err error
|
||||
if req.Database != "zitadel" {
|
||||
err = s.administrator.ClearView(ctx, req.Database, req.ViewName)
|
||||
} else {
|
||||
err = s.query.ClearCurrentSequence(ctx, req.ViewName)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &admin_pb.ClearViewResponse{}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user