Google Cloud KMS grpc or rest?
Is this using the grpc or the rest apis?
These Elixir libraries all use the REST endpoints.
I was trying on using the grpc. I was able to generate the code from the googele cloud kms protos
{:ok, token} = Goth.Token.for_scope("https://www.googleapis.com/auth/cloudkms")
request = Google.Cloud.Kms.V1.ListKeyRingsRequest.new(parent: "project_id")
headers = ["x-google-request-params": request.parent, "Authorization": "Bearer #{token.token}"]
{:ok, channel} = GRPC.Stub.connect("cloudkms.googleapis.com", "443", headers)
reply = channel |> Google.Cloud.Kms.V1.KeyManagementService.Stub.list_key_rings(request)
I keep getting below error
{:error, %GRPC.RPCError{ message: "{:connection_error, :protocol_error, :\"Invalid connection preface received. (RFC7540 3.5)\"}", status: 2 }}
Can anyone suggest anything on this
I don't have much experience with the GRPC library for Elixir. (Are you using https://github.com/elixir-grpc/grpc for GRPC?) I suggest asking in the GRPC library's issues.