Repository navigation
Conversation
westonpace
left a comment
There was a problem hiding this comment.
Yes, we probably need this. My only concern is that this is implemented as a backwards incompatible change. There are a few users of this library and these users would suddenly break without warning.
Could we start with the default of insecure=true? We could log a warning if the user doesn't specifically set insecure saying the default will be changing soon and they should explicitly set a value to disable the warning and then change it in a future release?
| * No actual messages are sent yet. | ||
| * | ||
| * @param host The hostname / port of the server, separated by a colon | ||
| * @param insecure If true, connect without TLS. Defaults to false (TLS is used). |
There was a problem hiding this comment.
Is this a backwards incompatible change? Was the previous default that we didn't use TLS?
There was a problem hiding this comment.
oh right! yeah I didn't know this had users. makes perfect sense.
In the past:
- TLS was always off.
insecurewas an option but didn't actually do anything. - Docs implied that TLS was on by default. (didn't really say so explicitly, but just the docstring on
insecuresaidIs the server using TLS? If not, this must be set to true.)
So a current user might assume either that TLS is on by default or off by default 😅
But I agree with your instinct that it's better to match old behavior than old docs. So I've switched the default to be insecure=true.
3254524 to
fed6502
Compare
This PR lets us use TLS (accidentally(?) ignored before) and adds a bunch of tests.
Bug fix:
insecurewas ignoredClientOptions.insecurewas documented but never read. The Flight client always created plaintext credentials, so TLS connections could not work. Connections now use TLS by default and plaintext only wheninsecure: trueis passed, which is what the docs always said.Breaking change: anyone connecting to a plaintext server without
insecure: truewill now fail the TLS handshake. The README calls this out. No merged code in LanceDB depends on this package yet, so nothing released needs to absorb it.Also fixed:
getFlightInfocalledresolveafterrejecton the error path.Tests
Added ~50 unit tests and 8 integration tests. Integration tests (more valuable imo) include: bad credentials, invalid SQL, empty result sets, a full multi-batch read checked against
COUNT(*), type mapping across ten SQL types, early exit from a stream, a concurrent burst, and importing the published package from an ES module.