Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 67100200C45 for ; Tue, 28 Mar 2017 18:36:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 64158160B89; Tue, 28 Mar 2017 16:36:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AB083160B6B for ; Tue, 28 Mar 2017 18:36:26 +0200 (CEST) Received: (qmail 62016 invoked by uid 500); 28 Mar 2017 16:36:25 -0000 Mailing-List: contact dev-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list dev@thrift.apache.org Received: (qmail 62000 invoked by uid 99); 28 Mar 2017 16:36:24 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Mar 2017 16:36:24 +0000 Received: from mail-qk0-f176.google.com (mail-qk0-f176.google.com [209.85.220.176]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id C4B091A0701 for ; Tue, 28 Mar 2017 16:36:23 +0000 (UTC) Received: by mail-qk0-f176.google.com with SMTP id r142so41596019qke.2 for ; Tue, 28 Mar 2017 09:36:23 -0700 (PDT) X-Gm-Message-State: AFeK/H1pdaIDjVMv3ewZVIdvsuUBwnrctjp0GZfWWhNMJH1hIbdDgKQYF29Nq2203uxMy9eyMIEtGR1YQN39JQ== X-Received: by 10.55.23.87 with SMTP id i84mr26334557qkh.201.1490718982844; Tue, 28 Mar 2017 09:36:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.46.37 with HTTP; Tue, 28 Mar 2017 09:36:22 -0700 (PDT) From: "James E. King, III" Date: Tue, 28 Mar 2017 12:36:22 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: multitenancy To: dev@thrift.apache.org Content-Type: multipart/alternative; boundary=001a114728986edae3054bcd0f13 archived-at: Tue, 28 Mar 2017 16:36:27 -0000 --001a114728986edae3054bcd0f13 Content-Type: text/plain; charset=UTF-8 Thrift has no concept of users or stateful sessions. While clients can connect to a server and issue multiple commands, each command is independent as no identifying information about the connection is sent to the handler. Anything like user sessions would need to be handled at a layer above Thrift, using something analogous to cookies in a web browser. In the past when I have had to do this in a Thrift IDL, I needed to add another parameter to every method to carry state from the client to the server, and I needed to add a method just to generate that session/state token. There may already be a Jira ticket for an enhancement to Thrift to add the capability to have stateful sessions. For example in the C++ implementation it would be possible to modify the TConnectedClient class and assign a GUID to each connected client and put it into thread local storage. Then any handler would be able to ask thread local storage for the unique connection ID. This would only be valid for the duration of a connected client, however. I often thought this would work well with the Multiplexed Protocol. One could put an authentication API on one channel, and then one could selectively enable other channels based on the permissions of the user. All of these ideas I discussed however are just ideas, and not part of the Thrift project today. - Jim --001a114728986edae3054bcd0f13--