diff --git a/internal/api/grpc/admin/iam_settings.go b/internal/api/grpc/admin/iam_settings.go index cfbf285637..a4be248eec 100644 --- a/internal/api/grpc/admin/iam_settings.go +++ b/internal/api/grpc/admin/iam_settings.go @@ -18,6 +18,7 @@ func (s *Server) ListSecretGenerators(ctx context.Context, req *admin_pb.ListSec return nil, err } return &admin_pb.ListSecretGeneratorsResponse{ + Result: SecretGeneratorsToPb(result.SecretGenerators), Details: object.ToListDetails(result.Count, result.Sequence, result.Timestamp), }, nil } diff --git a/internal/api/grpc/admin/iam_settings_converter.go b/internal/api/grpc/admin/iam_settings_converter.go index c93f8fbf4f..7dfd1a381e 100644 --- a/internal/api/grpc/admin/iam_settings_converter.go +++ b/internal/api/grpc/admin/iam_settings_converter.go @@ -62,6 +62,14 @@ func UpdateSecretGeneratorToConfig(req *admin_pb.UpdateSecretGeneratorRequest) * } } +func SecretGeneratorsToPb(generators []*query.SecretGenerator) []*settings_pb.SecretGenerator { + list := make([]*settings_pb.SecretGenerator, len(generators)) + for i, generator := range generators { + list[i] = SecretGeneratorToPb(generator) + } + return list +} + func SecretGeneratorToPb(generator *query.SecretGenerator) *settings_pb.SecretGenerator { mapped := &settings_pb.SecretGenerator{ Length: uint32(generator.Length),