metal-stack-cloud / api

MIT License
1 stars 0 forks source link

Make it possible to allow individual functions from a service #28

Closed Pilzington closed 2 years ago

Pilzington commented 2 years ago

Problem is here: https://github.com/metal-stack-cloud/api-server/blob/main/cmd/server/server.go#L103

        AllowedServices: []grpc.ServiceDesc{
            healthv1.Health_ServiceDesc,
            v1.VersionService_ServiceDesc,
            v1.AssetService_ServiceDesc,
            { // FIXME: is there a better way to define individual allowed methods from a service?
                ServiceName: "api.v1.PaymentService",
                HandlerType: (*v1.PaymentServiceServer)(nil),
                Methods: []grpc.MethodDesc{
                    {
                        MethodName: "GetDefaultPrices",
                    },
                },
                Streams:  []grpc.StreamDesc{},
                Metadata: "api/v1/payment.proto",
            },
        },

Maybe we can solve it with introducing annotations into the proto files.

majst01 commented 2 years ago

I take care of it