mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 19:14:23 +00:00
c25d853820
* feat: add domain list * feat: domain tests * feat: add redirect url on adding instance domain * Update internal/command/instance_domain.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * feat: remove unused code * fix Co-authored-by: Livio Amstutz <livio.a@gmail.com>
30 lines
762 B
Go
30 lines
762 B
Go
package admin
|
|
|
|
import (
|
|
"context"
|
|
|
|
instance_grpc "github.com/caos/zitadel/internal/api/grpc/instance"
|
|
"github.com/caos/zitadel/internal/api/grpc/object"
|
|
admin_pb "github.com/caos/zitadel/pkg/grpc/admin"
|
|
)
|
|
|
|
func (s *Server) GetInstanceDomains(ctx context.Context, req *admin_pb.ListInstanceDomainsRequest) (*admin_pb.ListInstanceDomainsResponse, error) {
|
|
queries, err := ListInstanceDomainsRequestToModel(req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
domains, err := s.query.SearchInstanceDomains(ctx, queries)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &admin_pb.ListInstanceDomainsResponse{
|
|
Result: instance_grpc.DomainsToPb(domains.Domains),
|
|
Details: object.ToListDetails(
|
|
domains.Count,
|
|
domains.Sequence,
|
|
domains.Timestamp,
|
|
),
|
|
}, nil
|
|
}
|