Re: [grpc-io] Uniquely identifying clients in gRPC c++

2020-08-16 Thread Sachin Bharadwaj S
Hi Mya,

Thanks for your response.

I was planning to generate a unique ID for each client in the register RPC
and send the same in the metadata.
The client can cache that value and pass it in all further RPCs so that
server can identify it.

Regards,
Sachin

On Wed, Aug 12, 2020 at 8:35 PM 'Mya Pitzeruse' via grpc.io <
grpc-io@googlegroups.com> wrote:

> You can generate a UUID in code, but that will only be valid for the
> length of deployment. This could be passed in as an option to your client.
> The best way to identify clients and do it securely is using mTLS (which
> gRPC does support).
>
> On Wed, Aug 12, 2020 at 6:28 AM Sachin Bharadwaj S <
> ssachinbharad...@gmail.com> wrote:
>
>>
>> I am implementing gRPC server application and multiple clients are
>> connected to my server and starts to call RPCs.
>>
>>
>> How can the server uniquely identify which client is calling the RPC?
>>
>>
>> Let us assume that server exposes a register RPC and client is
>> implemented in such a way that it calls the register API only once and at
>> the start of the client.
>>
>>
>> Let us also assume that the server guarantees to generate and assign a
>> unique ID for each client in the register RPC.
>>
>>
>> For example,
>>
>> Client A -> ID=1
>>
>> Client B -> ID=2
>>
>>
>> Is there a way to get back the ID associated with the client when an RPC
>> is called?
>>
>>
>> We do not want to send the ID to the client and ask the client to send
>> the same ID in all the further RPCs which leads to change in the .proto
>> file.
>>
>> How can this be handled in gRPC?
>>
>>
>> Can I keep this sticky ID somewhere in the context and get back in all
>> the RPC associated with the same client?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "grpc.io" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to grpc-io+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/grpc-io/d77ee459-64c8-4730-836d-670878d63948o%40googlegroups.com
>> 
>> .
>>
>
>
> --
>
> Mya Pitzeruse
>
> Principal Software Engineer - Service Infrastructure
>
> Gender Pronouns: She, Her, Hers
>
> mjp...@indeed.com
>
>
> Indeed - We help people get jobs.
>
> Indeed.com 
>
> Facebook   |  Twitter
>   |  Instagram
> 
>
> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to grpc-io+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/grpc-io/CAHa8AVROwfxycc3KOFsXaCc_bggtpfdEru6f%2B0Uo2wK5FudEzQ%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CA%2BbEEAchddB4s_DK4LwXwSxncAT38EJ_0uCNkOV4mK4dj52GpA%40mail.gmail.com.


Re: [grpc-io] Uniquely identifying clients in gRPC c++

2020-08-12 Thread 'Mya Pitzeruse' via grpc.io
You can generate a UUID in code, but that will only be valid for the length
of deployment. This could be passed in as an option to your client. The
best way to identify clients and do it securely is using mTLS (which gRPC
does support).

On Wed, Aug 12, 2020 at 6:28 AM Sachin Bharadwaj S <
ssachinbharad...@gmail.com> wrote:

>
> I am implementing gRPC server application and multiple clients are
> connected to my server and starts to call RPCs.
>
>
> How can the server uniquely identify which client is calling the RPC?
>
>
> Let us assume that server exposes a register RPC and client is implemented
> in such a way that it calls the register API only once and at the start of
> the client.
>
>
> Let us also assume that the server guarantees to generate and assign a
> unique ID for each client in the register RPC.
>
>
> For example,
>
> Client A -> ID=1
>
> Client B -> ID=2
>
>
> Is there a way to get back the ID associated with the client when an RPC
> is called?
>
>
> We do not want to send the ID to the client and ask the client to send the
> same ID in all the further RPCs which leads to change in the .proto file.
>
> How can this be handled in gRPC?
>
>
> Can I keep this sticky ID somewhere in the context and get back in all the
> RPC associated with the same client?
>
> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to grpc-io+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/grpc-io/d77ee459-64c8-4730-836d-670878d63948o%40googlegroups.com
> 
> .
>


-- 

Mya Pitzeruse

Principal Software Engineer - Service Infrastructure

Gender Pronouns: She, Her, Hers

mjp...@indeed.com


Indeed - We help people get jobs.

Indeed.com 

Facebook   |  Twitter
  |  Instagram


-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CAHa8AVROwfxycc3KOFsXaCc_bggtpfdEru6f%2B0Uo2wK5FudEzQ%40mail.gmail.com.


[grpc-io] Uniquely identifying clients in gRPC c++

2020-08-12 Thread Sachin Bharadwaj S


I am implementing gRPC server application and multiple clients are 
connected to my server and starts to call RPCs.


How can the server uniquely identify which client is calling the RPC?


Let us assume that server exposes a register RPC and client is implemented 
in such a way that it calls the register API only once and at the start of 
the client.


Let us also assume that the server guarantees to generate and assign a 
unique ID for each client in the register RPC.


For example,

Client A -> ID=1

Client B -> ID=2


Is there a way to get back the ID associated with the client when an RPC is 
called?


We do not want to send the ID to the client and ask the client to send the 
same ID in all the further RPCs which leads to change in the .proto file.

How can this be handled in gRPC?


Can I keep this sticky ID somewhere in the context and get back in all the 
RPC associated with the same client?

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/d77ee459-64c8-4730-836d-670878d63948o%40googlegroups.com.