Re: Support waffle>1.7.4

From: Christian Ullrich <chris(at)chrullrich(dot)net>
To: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Cc: Craig Ringer <craig(at)2ndquadrant(dot)com>
Subject: Re: Support waffle>1.7.4
Date: 2016-05-09 23:49:21
Message-ID: f52e2052-0c2e-7ed4-6185-de4e02b444d4@chrullrich.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

* Christian Ullrich wrote:

> I thought about writing a few [SSPI tests], and I may yet get around
> to that,

Attached is a proposed patch; I cannot send it as a PR because it is
dependent on Pavel Raiskup's as yet unmerged #546. The Waffle-free build
option is clearly coming, and there is little point in having SSPI tests
that then cannot be turned off.

Some explanations:

- Both successful and unsuccessful authentication is tested, the latter
to ensure that a configuration mistake (such as a "trust" line left
in pg_hba.conf) has not caused *both* tests to succeed when they
should have failed.

- Setting up to run these tests is not entirely (or at all) trivial; it
requires running the database server as an account that is capable of
SSPI authentication (such as a virtual service account, e.g.
"NT SERVICE\PostgreSQL") on both domain member and non-member
systems, or a domain user account.

- Additionally, both pg_hba.conf and, in most cases, pg_ident.conf must
be configured. In particular, the user account that runs the tests
must be permitted to authenticate as the database role configured in
build.properties.

- The tests are not run when Waffle is disabled. I would have preferred
to have a separate option to turn them off even when building with
Waffle because the setup is so difficult. I could not think of a way
to make Maven do this, mostly because profiles cannot be chained, and
profile activation cannot use two variables, for example
(!enableWaffle || disableSSPITests).

- There is an intermittent problem where testUnauthorized() fails
because it gets the wrong exception: It expects SQLSTATE 28000 from
the server, but sometimes it gets 08001 generated internally in the
driver. No idea what causes that. I did not want to blindly accept any
error as proof of failed authentication.

--
Christian

Attachment Content-Type Size
sspi-test.patch text/plain 5.5 KB

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2016-05-10 00:34:39 Re: Support waffle>1.7.4
Previous Message Christian Ullrich 2016-05-09 17:03:20 Re: Support waffle>1.7.4