Skip to content

Conversation

@roji
Copy link
Member

@roji roji commented Mar 4, 2023

Closes #4966

@roji roji requested a review from vonzshik as a code owner March 4, 2023 15:08
@roji roji force-pushed the EncryptionBeGone branch 2 times, most recently from db2cacb to e0774a5 Compare March 4, 2023 15:43
Copy link
Contributor

@vonzshik vonzshik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, one small nit

/// Enables to possibility to use TLS/SSl encryption for connections to PostgreSQL. This does not guarantee that encryption will
/// actually be used; see <see href="https://www.npgsql.org/doc/security.html"/> for more details.
/// </summary>
public NpgsqlSlimDataSourceBuilder EnableEncryption()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could just call it Add* instead of enable

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked over it the naming again... Most of the other APIs on the builder are called Use*; but they actually mean that the feature will be used (e.g. UseClientCertificate, UseLoggerFactory). There's EnableParameterLogging, which is about turning a feature on or off (UseParameterLogging makes no sense), and also aligns with EF (in case that matters.

I think EnableEncryption and EnableRanges is consistent - it's just turning a feature on... SystemTextJson is annoying, since it's both turning on the possibility to use JSON (if using the slim builder) and also configuring it with serializer options etc. (which is why it's also exposed on the non-slim builder).

Long story short... Add also seems fine; I admit I slightly prefer Enable since it's very clearly about turning something on/off; but it's also consistent with the existing EnableParameterLogging, which is also a point in its favor...

I'll go ahead and merge this for now, but am perfectly ok rediscussing the naming and changing.

@roji roji force-pushed the EncryptionBeGone branch from e0774a5 to c051b2b Compare March 7, 2023 22:31
@roji roji enabled auto-merge (squash) March 7, 2023 22:32
@roji roji merged commit dda36e6 into npgsql:main Mar 7, 2023
@roji roji deleted the EncryptionBeGone branch March 7, 2023 22:43
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

Successfully merging this pull request may close these issues.

Allow disabling encryption to reduce binary size

3 participants