Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dWNOy-0005r6-Lz for pgsql-jdbc@arkaria.postgresql.org; Sat, 15 Jul 2017 13:46:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dWNOw-0000pf-GW for pgsql-jdbc@arkaria.postgresql.org; Sat, 15 Jul 2017 13:46:30 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dWNOu-0000pA-EM for pgsql-jdbc@postgresql.org; Sat, 15 Jul 2017 13:46:28 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dWNOl-00050S-A3 for pgsql-jdbc@postgresql.org; Sat, 15 Jul 2017 13:46:26 +0000 Received: by mail-wm0-x230.google.com with SMTP id w126so41490878wme.0 for ; Sat, 15 Jul 2017 06:46:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=8kdata-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=eXu4kmMrIgAigGKNtPdbGiDCNJuRV2Tb1C/abn937Lg=; b=n3qSdnv7JxtkWYSUGjIfNo0fFG5yVOkXcStUNiTZNcpoB0J7DgfCWYNfE9gn5/pA61 X7g9ZbYf5G51V5qyZxaWv2ixxfu3mUM8zuF1BMrGsB1bQ8pPpw2ZrtcMg14TtUSh0y93 rNCRjeSMd+H6pDhrOVdfdhDncTzHPQYXfPfDw2EHD8jBMHCY1qowV2DNIuusaCbbdMD/ hbhKcA8gq2dGYrGigWsPgoJ3zHs4ILvzMPyxADfYR74AIn8TK7oZS2pjhWr33mlyhhi6 Pb4PX/4meeY4NvazBMRf7Enr+tsHmALigdq+VndnOOJBABcW0SCr06RWOX7ZEDZmuUac ZWhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=eXu4kmMrIgAigGKNtPdbGiDCNJuRV2Tb1C/abn937Lg=; b=gDG6n8lkX5FC+pABXfbK2VTC8VzG26cjKdvb6Qd7abA7Ae9h2IZ5qBpfsV7W64Nfjq MzhHcR8nsjh4TmUK3A+5qVkT1YoT+rSStAPcEHab75uqAO2jqB3JPTlThN8y72UPvURV cD3u51SDrQJhlaR95bZZL49LLG4DKTJ7D2/rpg38U6Z2lQ0h4FRNDQY6sIIJWuAp5IGZ Ls80zz+Cw/kpYs/o3MbjzZxZtck8jyXAmM4akiuby6DDix4aLBP4Tke7nk1s0TUfM6ev Tbv2g3LChJO46XN0dZiYRp/sZZVwaR7eAt6nqp0Y/l5hajOKN/KFNKo6tXU/6Es+iZnm ftOA== X-Gm-Message-State: AIVw112AgZ3pBcfnq4K9ZYNlRnspNnZ9QETfl36v4KjOp+cQeTNk+X6O h54BDXinAZV9V229MWM2RQ== X-Received: by 10.28.145.12 with SMTP id t12mr1090074wmd.11.1500126376934; Sat, 15 Jul 2017 06:46:16 -0700 (PDT) Received: from [192.168.42.105] ([31.4.241.221]) by smtp.gmail.com with ESMTPSA id 3sm6187491wrs.18.2017.07.15.06.46.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Jul 2017 06:46:16 -0700 (PDT) Subject: Re: SCRAM client vs pgjdbc packaging To: Dave Cramer , =?UTF-8?Q?Jorge_Sol=c3=b3rzano?= Cc: Vladimir Sitnikov , List References: From: =?UTF-8?Q?=c3=81lvaro_Hern=c3=a1ndez_Tortosa?= Message-ID: <49222805-4cb8-2179-6f0d-c648fdc00574@8kdata.com> Date: Sat, 15 Jul 2017 16:46:13 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------E4D404C9DAC9AB165DD45805" Content-Language: en-US List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org This is a multi-part message in MIME format. --------------E4D404C9DAC9AB165DD45805 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit I completely agree. Maven/XXX users will just pull the dependency and their transitive dependencies. Shading is only necessary for users who directly download and use the jar. And for these cases, the easier for the user, the better. I will update the PR with the changes to Maven. Álvaro On 13/07/17 21:58, Dave Cramer wrote: > # 2 is my vote! > > Dave Cramer > > davec@postgresintl.com > www.postgresintl.com > > On 13 July 2017 at 18:06, Jorge Solórzano > wrote: > > I vote for #2, with the maven-shade-plugin it should be easy to > have an uber-jar. > > Jorge Solórzano > > On Thu, Jul 13, 2017 at 5:14 AM, Vladimir Sitnikov > > > wrote: > > Hello, > > Álvaro has implemented SCRAM support for pgjdbc (see > https://github.com/pgjdbc/pgjdbc/pull/842 > ), and it would be > great to merge that. > > However, there might be a packaging issue. > > Technically speaking, the client is implemented in > https://github.com/ongres/scram > (BSD 2-clause "Simplified" > License). > > I expect SCRAM to become the main way to authenticate, so it > would be nice if pgjdbc could just work with no need to add > different jars to the classpath. > > The question is how should we deal with the dependency. > > 1) We could make it optional & dynamic. That is we refrain > from including the client to pgjdbc artifacts. In case backend > is configured for SASL, pgjdbc would bail out with "please add > scram-client-whatever.jar to the classpath" error. > The drawback is pgjdbc would require a certain versions of > scram-client, so it might cause troubles in future if > application code and pgjdbc would require different > incompatible versions of the client. > > 2) We could incorporate scram-client to the pgjdbc artifacts, > so it would just work if backend requests SASL. This option > enables us to repackage the client with our own name (e.g. > org.postgresql.ongress.scram...), so it will enable > applications to use scram-clients of their choice. > > I'm inclined to #2 (incorporate scram-client at build time), > however I am not sure if it will ripple via some packaging issues. > > Note: I expect we might want to add new dependencies later > (e.g. for "SASL string preparation", or Netty for networking > layer), so it would be nice to know limits/edge packaging cases. > > Vladimir > > > -- Álvaro Hernández Tortosa ----------- <8K>data --------------E4D404C9DAC9AB165DD45805 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
    I completely agree.

    Maven/XXX users will just pull the dependency and their transitive dependencies. Shading is only necessary for users who directly download and use the jar. And for these cases, the easier for the user, the better.

    I will update the PR with the changes to Maven.


    Álvaro



On 13/07/17 21:58, Dave Cramer wrote:
# 2 is my vote!


On 13 July 2017 at 18:06, Jorge Solórzano <jorsol@gmail.com> wrote:
I vote for #2, with the maven-shade-plugin it should be easy to have an uber-jar.

Jorge Solórzano

On Thu, Jul 13, 2017 at 5:14 AM, Vladimir Sitnikov <sitnikov.vladimir@gmail.com> wrote:
Hello,

Álvaro has implemented SCRAM support for pgjdbc (see https://github.com/pgjdbc/pgjdbc/pull/842 ), and it would be great to merge that.

However, there might be a packaging issue.

Technically speaking, the client is implemented in https://github.com/ongres/scram (BSD 2-clause "Simplified" License).

I expect SCRAM to become the main way to authenticate, so it would be nice if pgjdbc could just work with no need to add different jars to the classpath.

The question is how should we deal with the dependency.

1) We could make it optional & dynamic. That is we refrain from including the client to pgjdbc artifacts. In case backend is configured for SASL, pgjdbc would bail out with "please add scram-client-whatever.jar to the classpath" error.
The drawback is pgjdbc would require a certain versions of scram-client, so it might cause troubles in future if application code and pgjdbc would require different incompatible versions of the client.

2) We could incorporate scram-client to the pgjdbc artifacts, so it would just work if backend requests SASL. This option enables us to repackage the client with our own name (e.g. org.postgresql.ongress.scram...), so it will enable applications to use scram-clients of their choice.

I'm inclined to #2 (incorporate scram-client at build time), however I am not sure if it will ripple via some packaging issues.

Note: I expect we might want to add new dependencies later (e.g. for "SASL string preparation", or Netty for networking layer), so it would be nice to know limits/edge packaging cases.

Vladimir



-- 

Álvaro Hernández Tortosa


-----------
<8K>data
--------------E4D404C9DAC9AB165DD45805--