Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary dependencies for non-Kerberos users #971

Closed
AGWA opened this issue May 27, 2020 · 2 comments
Closed

Unnecessary dependencies for non-Kerberos users #971

AGWA opened this issue May 27, 2020 · 2 comments

Comments

@AGWA
Copy link
Contributor

AGWA commented May 27, 2020

An unfortunate consequence of the recently-merged Kerberos support (#970) is that users who don't use Kerberos are now forced to pull in 8 dependencies (previously pq had no dependencies) which increases both technical and legal risk. Of particular concern is that the jcmturner libraries are licensed under a more restrictive license (Apache 2) than pq itself. This license isn't compatible with GPLv2, which means it's no longer legal for GPLv2 projects to use pq.

My proposal for fixing this (which I am volunteering to implement if you are OK with it) is to move krb_unix.go and krb_windows.go to their own package and module. They would have an init function that would register the NewGSS function with pq. When pq needs to create a Gss object it would call the registered function (or return an error if no Kerberos implementation has been registered). The users who need Kerberos support would import the Kerberos package with a blank package name - much like how pq is often imported. The users who don't need Kerberos wouldn't import this package and won't pay the cost of the additional dependencies.

@maddyblue
Copy link
Collaborator

Yes, I'd merge that.

@amenzhinsky
Copy link

amenzhinsky commented Jun 1, 2020

Totally agree.
The reason I really like this module over pgx or anything else is the fact it has zero dependencies, but after the latest upgrade our binaries grew ~3mb in size.

otan added a commit to otan-cockroach/pgconn that referenced this issue Apr 10, 2022
This commit adds the GSSAPI authentication to pgx. This roughly follows
the lib/pq implementation:
* We require registering a provider to avoid mass dependency inclusions
  that may not be desired (lib/pq#971).
* Requires the pgproto3 package be updated. I've included my custom fork
  for now.
otan added a commit to otan-cockroach/pgconn that referenced this issue Apr 11, 2022
This commit adds the GSSAPI authentication to pgx. This roughly follows
the lib/pq implementation:
* We require registering a provider to avoid mass dependency inclusions
  that may not be desired (lib/pq#971).
* Requires the pgproto3 package be updated. I've included my custom fork
  for now.
otan added a commit to otan-cockroach/pgconn that referenced this issue Apr 11, 2022
This commit adds the GSSAPI authentication to pgx. This roughly follows
the lib/pq implementation:
* We require registering a provider to avoid mass dependency inclusions
  that may not be desired (lib/pq#971).
* Requires the pgproto3 package be updated. I've included my custom fork
  for now.
otan added a commit to otan-cockroach/pgconn that referenced this issue Apr 12, 2022
This commit adds the GSSAPI authentication to pgx. This roughly follows
the lib/pq implementation:
* We require registering a provider to avoid mass dependency inclusions
  that may not be desired (lib/pq#971).
* Requires the pgproto3 package be updated. I've included my custom fork
  for now.
otan added a commit to otan-cockroach/pgconn that referenced this issue Apr 12, 2022
This commit adds the GSSAPI authentication to pgx. This roughly follows
the lib/pq implementation:
* We require registering a provider to avoid mass dependency inclusions
  that may not be desired (lib/pq#971).
* Requires the pgproto3 package be updated. I've included my custom fork
  for now.
otan added a commit to otan-cockroach/pgconn that referenced this issue Apr 12, 2022
This commit adds the GSSAPI authentication to pgx. This roughly follows
the lib/pq implementation:
* We require registering a provider to avoid mass dependency inclusions
  that may not be desired (lib/pq#971).
* Requires the pgproto3 package be updated. I've included my custom fork
  for now.
jackc pushed a commit to jackc/pgconn that referenced this issue Apr 15, 2022
This commit adds the GSSAPI authentication to pgx. This roughly follows
the lib/pq implementation:
* We require registering a provider to avoid mass dependency inclusions
  that may not be desired (lib/pq#971).
* Requires the pgproto3 package be updated. I've included my custom fork
  for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants