apache / arrow-rs

Official Rust implementation of Apache Arrow
https://arrow.apache.org/
Apache License 2.0
2.62k stars 802 forks source link

[FlightSQL] Inconsistent base64 encoding for arrow-go and arrow-rust #6753

Open niebayes opened 3 days ago

niebayes commented 3 days ago

For the handshake between a Flight SQL client and a Flight SQL server, the Arrow Rust implementation uses Base64 standard encoding with padding, while the Arrow Go implementation uses Base64 standard encoding without padding. Since these two are incompatible, our Flight SQL server cannot authenticate Go and Rust clients in a unified manner.

niebayes commented 3 days ago

Well, we have found a way for consistent decoding:

let my_base64 = GeneralPurpose::new(
            &alphabet::STANDARD,
            GeneralPurposeConfig::new().with_decode_padding_mode(DecodePaddingMode::Indifferent),
        );

We have to construct our own general-purpose decoder in the server side and set the decode padding mode to Indifferent so that the base64 decoder would allow the encoded string being padded or not padded.

niebayes commented 16 hours ago

But I think this is still a issue since not all FlightSQL server implementations would notice the inconsistent base64 encoding in the client side. And this inconsistency would make them hard to handle cross-language requests.